Commit 86be29e9d985b57e03e2eede6394e0c1edc6660a
Committed by
Tom Rini
1 parent
d0dd49f929
Exists in
emb_lf_v2022.04
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>
Showing 1 changed file with 3 additions and 8 deletions Side-by-side Diff
drivers/pci/pci_tegra.c
... | ... | @@ -275,13 +275,6 @@ |
275 | 275 | writel(value, port->regs.start + offset); |
276 | 276 | } |
277 | 277 | |
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 | - | |
285 | 278 | static int tegra_pcie_conf_address(struct tegra_pcie *pcie, pci_dev_t bdf, |
286 | 279 | int where, unsigned long *address) |
287 | 280 | { |
... | ... | @@ -305,7 +298,9 @@ |
305 | 298 | return -EFAULT; |
306 | 299 | #endif |
307 | 300 | |
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); | |
309 | 304 | return 0; |
310 | 305 | } |
311 | 306 | } |