diff options
author | Pali Rohár <pali@kernel.org> | 2021-11-24 20:00:31 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-12 22:21:24 +0300 |
commit | fbfa15c0b82b4e1ee1e974e2a85075cead502976 (patch) | |
tree | 2f3db707a562832cb746fefdaf68a2887ef1cc1b | |
parent | ca4b097d7ba88778189ae36b549ea81be89db650 (diff) | |
download | u-boot-fbfa15c0b82b4e1ee1e974e2a85075cead502976.tar.xz |
pci: pcie-brcmstb: Use PCIE_ECAM_OFFSET() macro
Replace custom driver macros by PCIE_ECAM_OFFSET() macro from pci.h
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
-rw-r--r-- | drivers/pci/pcie_brcmstb.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c index 90225f6779..1de2802113 100644 --- a/drivers/pci/pcie_brcmstb.c +++ b/drivers/pci/pcie_brcmstb.c @@ -97,9 +97,6 @@ #define PCIE_EXT_CFG_DATA 0x8000 #define PCIE_EXT_CFG_INDEX 0x9000 -#define PCIE_EXT_BUSNUM_SHIFT 20 -#define PCIE_EXT_SLOT_SHIFT 15 -#define PCIE_EXT_FUNC_SHIFT 12 #define PCIE_RGR1_SW_INIT_1 0x9210 #define RGR1_SW_INIT_1_PERST_MASK 0x1 @@ -227,9 +224,7 @@ static int brcm_pcie_config_address(const struct udevice *dev, pci_dev_t bdf, } /* For devices, write to the config space index register */ - idx = (pci_bus << PCIE_EXT_BUSNUM_SHIFT) - | (pci_dev << PCIE_EXT_SLOT_SHIFT) - | (pci_func << PCIE_EXT_FUNC_SHIFT); + idx = PCIE_ECAM_OFFSET(pci_bus, pci_dev, pci_func, 0); writel(idx, pcie->base + PCIE_EXT_CFG_INDEX); *paddress = pcie->base + PCIE_EXT_CFG_DATA + offset; |