]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: mpc85xx: Do not try to access extended PCIe registers
authorPali Rohár <pali@kernel.org>
Thu, 13 Apr 2023 20:41:46 +0000 (22:41 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 1 May 2023 22:59:33 +0000 (18:59 -0400)
Driver pci_mpc85xx.c is PCI controller driver for old PCI Local Bus,
which does not support access to extended PCIe registers (above 0xff),
as opposite of the PCIe driver pcie_fsl.c for the same platform.

So do not try to access extended PCIe registers as it cannot work.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
drivers/pci/pci_mpc85xx.c

index d144f2b791b81329e356def3cd96fd09de121e54..833de816c459570cb9cf0533f60452ebf6b43f3f 100644 (file)
@@ -22,7 +22,12 @@ static int mpc85xx_pci_dm_read_config(const struct udevice *dev, pci_dev_t bdf,
        struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
        u32 addr;
 
-       addr = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset);
+       if (offset > 0xff) {
+               *value = pci_get_ff(size);
+               return 0;
+       }
+
+       addr = PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset);
        out_be32(priv->cfg_addr, addr);
        sync();
 
@@ -48,7 +53,10 @@ static int mpc85xx_pci_dm_write_config(struct udevice *dev, pci_dev_t bdf,
        struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
        u32 addr;
 
-       addr = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset);
+       if (offset > 0xff)
+               return 0;
+
+       addr = PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset);
        out_be32(priv->cfg_addr, addr);
        sync();