]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci-host-ecam-generic: Convert to ofnode functions
authorMaksim Kiselev <bigunclemax@gmail.com>
Wed, 14 Feb 2024 20:30:01 +0000 (23:30 +0300)
committerTom Rini <trini@konsulko.com>
Sat, 2 Mar 2024 17:26:56 +0000 (12:26 -0500)
FDT functions is not working when OF_LIVE is enabled.
Convert fdt parsing functions to ofnode parsing functions

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
drivers/pci/pcie_ecam_generic.c

index 2e089b0e0332e0ac983bd806e777cb5f227d66fc..f5bc6e3d92d646b6123921dabd902298731729dd 100644 (file)
@@ -10,7 +10,7 @@
 #include <common.h>
 #include <dm.h>
 #include <pci.h>
-#include <asm/global_data.h>
+#include <linux/ioport.h>
 #include <linux/printk.h>
 
 #include <asm/io.h>
@@ -133,18 +133,17 @@ static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
 static int pci_generic_ecam_of_to_plat(struct udevice *dev)
 {
        struct generic_ecam_pcie *pcie = dev_get_priv(dev);
-       struct fdt_resource reg_res;
-       DECLARE_GLOBAL_DATA_PTR;
+       ofnode node = dev_ofnode(dev);
+       struct resource reg_res;
        int err;
 
-       err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
-                              0, &reg_res);
+       err = ofnode_read_resource(node, 0, &reg_res);
        if (err < 0) {
                pr_err("\"reg\" resource not found\n");
                return err;
        }
 
-       pcie->size = fdt_resource_size(&reg_res);
+       pcie->size = resource_size(&reg_res);
        pcie->cfg_base = map_physmem(reg_res.start, pcie->size, MAP_NOCACHE);
 
        return 0;