summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPali Rohár <[email protected]>2021-11-26 11:42:42 +0100
committerTom Rini <[email protected]>2022-01-12 14:21:24 -0500
commit2b29d79be83ab0d34582577300bf1de8f39dd97e (patch)
treee39c55eaee15d5067a5a0e871bee1586a96a82bf /drivers
parent2a8d4025c3bdeeca0484ab45606e08649f8b85a3 (diff)
pci: gt64120: Use PCI_CONF1_ADDRESS() macro
PCI gt64120 driver uses standard format of Config Address for PCI Configuration Mechanism #1. So use new U-Boot macro PCI_CONF1_ADDRESS() and remove old custom driver address macros. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci_gt64120.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pci/pci_gt64120.c b/drivers/pci/pci_gt64120.c
index 153c65b119a..2c2a80eeaa0 100644
--- a/drivers/pci/pci_gt64120.c
+++ b/drivers/pci/pci_gt64120.c
@@ -48,7 +48,7 @@ static int gt_config_access(struct gt64120_pci_controller *gt,
{
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);
u32 intr;
u32 addr;
u32 val;
@@ -65,10 +65,7 @@ static int gt_config_access(struct gt64120_pci_controller *gt,
/* Clear cause register bits */
writel(~GT_INTRCAUSE_ABORT_BITS, &gt->regs->intrcause);
- addr = GT_PCI0_CFGADDR_CONFIGEN_BIT;
- addr |= bus << GT_PCI0_CFGADDR_BUSNUM_SHF;
- addr |= devfn << GT_PCI0_CFGADDR_FUNCTNUM_SHF;
- addr |= (where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF;
+ addr = PCI_CONF1_ADDRESS(bus, dev, func, where);
/* Setup address */
writel(addr, &gt->regs->pci0_cfgaddr);