summaryrefslogtreecommitdiff
path: root/drivers/pci/pci_msc01.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-11-26 11:42:44 +0100
committerTom Rini <trini@konsulko.com>2022-01-12 14:21:24 -0500
commitf146bd96e448200d05261e92738812ca6e37c372 (patch)
tree15bcca4b4c5b671384137fe052ed588e6fe7a990 /drivers/pci/pci_msc01.c
parent247ffc6b36ac2605d54fe31628ae6b827603d0ac (diff)
pci: msc01: Use PCI_CONF1_ADDRESS() macro
PCI msc01 driver uses standard format of Config Address for PCI Configuration Mechanism #1 but with cleared Enable bit. So use new U-Boot macro PCI_CONF1_ADDRESS() with clearing PCI_CONF1_ENABLE bit and remove old custom driver address macros. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pci/pci_msc01.c')
-rw-r--r--drivers/pci/pci_msc01.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pci/pci_msc01.c b/drivers/pci/pci_msc01.c
index 2f1b688fc3..8d363d6049 100644
--- a/drivers/pci/pci_msc01.c
+++ b/drivers/pci/pci_msc01.c
@@ -34,16 +34,13 @@ static int msc01_config_access(struct msc01_pci_controller *msc01,
void *cfgdata = msc01->base + MSC01_PCI_CFGDATA_OFS;
unsigned int bus = PCI_BUS(bdf);
unsigned int dev = PCI_DEV(bdf);
- unsigned int devfn = PCI_DEV(bdf) << 3 | PCI_FUNC(bdf);
+ unsigned int func = PCI_FUNC(bdf);
/* clear abort status */
__raw_writel(aborts, intstat);
/* setup address */
- __raw_writel((bus << MSC01_PCI_CFGADDR_BNUM_SHF) |
- (dev << MSC01_PCI_CFGADDR_DNUM_SHF) |
- (devfn << MSC01_PCI_CFGADDR_FNUM_SHF) |
- ((where / 4) << MSC01_PCI_CFGADDR_RNUM_SHF),
+ __raw_writel((PCI_CONF1_ADDRESS(bus, dev, func, where) & ~PCI_CONF1_ENABLE),
msc01->base + MSC01_PCI_CFGADDR_OFS);
/* perform access */