#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>
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;