From 67c7f14af34bb27c5fdc9189089e5a5ae156082f Mon Sep 17 00:00:00 2001 From: Maksim Kiselev Date: Wed, 14 Feb 2024 23:30:01 +0300 Subject: [PATCH] pci-host-ecam-generic: Convert to ofnode functions FDT functions is not working when OF_LIVE is enabled. Convert fdt parsing functions to ofnode parsing functions Signed-off-by: Maksim Kiselev --- drivers/pci/pcie_ecam_generic.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c index 2e089b0e03..f5bc6e3d92 100644 --- a/drivers/pci/pcie_ecam_generic.c +++ b/drivers/pci/pcie_ecam_generic.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -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, ®_res); + err = ofnode_read_resource(node, 0, ®_res); if (err < 0) { pr_err("\"reg\" resource not found\n"); return err; } - pcie->size = fdt_resource_size(®_res); + pcie->size = resource_size(®_res); pcie->cfg_base = map_physmem(reg_res.start, pcie->size, MAP_NOCACHE); return 0; -- 2.39.5