Skip to content

Commit

Permalink
pci: mpc85xx: Use PCI_CONF1_EXT_ADDRESS() macro
Browse files Browse the repository at this point in the history
PCI mpc85xx driver uses extended format of Config Address for PCI
Configuration Mechanism #1.

So use new U-Boot macro PCI_CONF1_EXT_ADDRESS().

Signed-off-by: Pali Rohár <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
pali authored and trini committed Jan 12, 2022
1 parent 2b29d79 commit 247ffc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/pci_mpc85xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ 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 = bdf | (offset & 0xfc) | ((offset & 0xf00) << 16) | 0x80000000;
addr = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset);
out_be32(priv->cfg_addr, addr);
sync();
*value = pci_conv_32_to_size(in_le32(priv->cfg_data), offset, size);
Expand All @@ -38,7 +38,7 @@ 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 = bdf | (offset & 0xfc) | ((offset & 0xf00) << 16) | 0x80000000;
addr = PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset);
out_be32(priv->cfg_addr, addr);
sync();
out_le32(priv->cfg_data, pci_conv_size_to_32(0, value, offset, size));
Expand Down

0 comments on commit 247ffc6

Please sign in to comment.