Skip to content

Commit 86be29e

Browse files
palitrini
authored andcommitted
pci: tegra: Use PCI_CONF1_EXT_ADDRESS() macro
PCI tegra driver uses extended format of Config Address for PCI Configuration Mechanism #1 but with cleared Enable bit. So use new U-Boot macro PCI_CONF1_EXT_ADDRESS() with clearing PCI_CONF1_ENABLE bit and remove old custom driver address function. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
1 parent d0dd49f commit 86be29e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/pci/pci_tegra.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,6 @@ static void rp_writel(struct tegra_pcie_port *port, unsigned long value,
275275
writel(value, port->regs.start + offset);
276276
}
277277

278-
static unsigned long tegra_pcie_conf_offset(pci_dev_t bdf, int where)
279-
{
280-
return ((where & 0xf00) << 16) | (PCI_BUS(bdf) << 16) |
281-
(PCI_DEV(bdf) << 11) | (PCI_FUNC(bdf) << 8) |
282-
(where & 0xfc);
283-
}
284-
285278
static int tegra_pcie_conf_address(struct tegra_pcie *pcie, pci_dev_t bdf,
286279
int where, unsigned long *address)
287280
{
@@ -305,7 +298,9 @@ static int tegra_pcie_conf_address(struct tegra_pcie *pcie, pci_dev_t bdf,
305298
return -EFAULT;
306299
#endif
307300

308-
*address = pcie->cs.start + tegra_pcie_conf_offset(bdf, where);
301+
*address = pcie->cs.start +
302+
(PCI_CONF1_EXT_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf),
303+
PCI_FUNC(bdf), where) & ~PCI_CONF1_ENABLE);
309304
return 0;
310305
}
311306
}

0 commit comments

Comments
 (0)