From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>, Simon Glass <sjg@chromium.org>,
Bin Meng <bmeng.cn@gmail.com>,
Nicolas Saenz Julienne <nsaenz@kernel.org>,
Matthias Brugger <mbrugger@suse.com>
Cc: u-boot@lists.denx.de
Subject: [PATCH u-boot-next 2/4] pci: pcie-brcmstb: Use PCIE_ECAM_OFFSET() macro
Date: Wed, 24 Nov 2021 18:00:31 +0100 [thread overview]
Message-ID: <20211124170033.4137-3-pali@kernel.org> (raw)
In-Reply-To: <20211124170033.4137-1-pali@kernel.org>
Replace custom driver macros by PCIE_ECAM_OFFSET() macro from pci.h
Signed-off-by: Pali Rohár <pali@kernel.org>
---
drivers/pci/pcie_brcmstb.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c
index 90225f677955..1de28021138a 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;
--
2.20.1
next prev parent reply other threads:[~2021-11-24 17:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 17:00 [PATCH u-boot-next 0/4] pci: Use PCIE_ECAM_OFFSET() macro Pali Rohár
2021-11-24 17:00 ` [PATCH u-boot-next 1/4] vexpress64: Remove unused macro XR3PCI_ECAM_OFFSET Pali Rohár
2022-01-13 1:50 ` Tom Rini
2021-11-24 17:00 ` Pali Rohár [this message]
2021-11-30 12:09 ` [PATCH u-boot-next 2/4] pci: pcie-brcmstb: Use PCIE_ECAM_OFFSET() macro nicolas saenz julienne
2022-01-13 1:50 ` Tom Rini
2021-11-24 17:00 ` [PATCH u-boot-next 3/4] pci: pcie_iproc: " Pali Rohár
2022-01-13 1:50 ` Tom Rini
2021-11-24 17:00 ` [PATCH u-boot-next 4/4] pci: pci_octeontx: " Pali Rohár
2021-12-16 14:02 ` Stefan Roese
2022-01-13 1:51 ` Tom Rini
2021-12-16 11:28 ` [PATCH u-boot-next 0/4] pci: " Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211124170033.4137-3-pali@kernel.org \
--to=pali@kernel.org \
--cc=bmeng.cn@gmail.com \
--cc=mbrugger@suse.com \
--cc=nsaenz@kernel.org \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).