]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: mpc85xx: Support controller register physical address beyond 32-bit
authorBin Meng <bmeng.cn@gmail.com>
Thu, 25 Feb 2021 09:22:41 +0000 (17:22 +0800)
committerPriyanka Jain <priyanka.jain@nxp.com>
Fri, 5 Mar 2021 04:55:43 +0000 (10:25 +0530)
devfdt_get_addr_index() returns fdt_addr_t which might be a 64-bit
physical address. Use map_physmem() to return the virtual address
that can be used by a 32-bit machine.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
drivers/pci/pci_mpc85xx.c

index 7387a1edd9f9e414138e95fccef7e2d51e22750b..f0d469a8fac2ebf030e77bbf4c506003078d650a 100644 (file)
@@ -134,9 +134,8 @@ static int mpc85xx_pci_of_to_plat(struct udevice *dev)
        addr = devfdt_get_addr_index(dev, 0);
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;
-       priv->cfg_addr = (void __iomem *)addr;
-       addr += 4;
-       priv->cfg_data = (void __iomem *)addr;
+       priv->cfg_addr = (void __iomem *)map_physmem(addr, 0, MAP_NOCACHE);
+       priv->cfg_data = (void __iomem *)((ulong)priv->cfg_addr + 4);
 
        return 0;
 }