From: "Marek Behún" <kabel@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sasha Levin <sashal@kernel.org>
Cc: pali@kernel.org, stable@vger.kernel.org,
"Evan Wang" <xswang@marvell.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Victor Gu" <xigu@marvell.com>,
"Nadav Haklai" <nadavh@marvell.com>,
"Marek Behún" <kabel@kernel.org>
Subject: [PATCH 4.14 14/24] PCI: aardvark: Remove PCIe outbound window configuration
Date: Wed, 24 Nov 2021 23:49:23 +0100 [thread overview]
Message-ID: <20211124224933.24275-15-kabel@kernel.org> (raw)
In-Reply-To: <20211124224933.24275-1-kabel@kernel.org>
From: Evan Wang <xswang@marvell.com>
commit 6df6ba974a55678a2c7d9a0c06eb15cde0c4b184 upstream.
Outbound window is used to translate CPU space addresses to PCIe space
addresses when the CPU initiates PCIe transactions.
According to the suggestion of the HW designers, the recommended
solution is to use the default outbound parameters, even though the
current outbound window setting does not cause any known functional
issue.
This patch doesn't address any known functional issue, but aligns to
HW design guidelines, and removes code that isn't needed.
Signed-off-by: Evan Wang <xswang@marvell.com>
[Thomas: tweak commit log.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[lorenzo.pieralisi@arm.com: handled host->controller dir move]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Victor Gu <xigu@marvell.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/pci/host/pci-aardvark.c | 55 ---------------------------------
1 file changed, 55 deletions(-)
diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c
index 66c4b9282420..4021c4d1c6e8 100644
--- a/drivers/pci/host/pci-aardvark.c
+++ b/drivers/pci/host/pci-aardvark.c
@@ -107,24 +107,6 @@
#define PCIE_MSI_PAYLOAD_REG (CONTROL_BASE_ADDR + 0x9C)
#define PCIE_MSI_DATA_MASK GENMASK(15, 0)
-/* PCIe window configuration */
-#define OB_WIN_BASE_ADDR 0x4c00
-#define OB_WIN_BLOCK_SIZE 0x20
-#define OB_WIN_REG_ADDR(win, offset) (OB_WIN_BASE_ADDR + \
- OB_WIN_BLOCK_SIZE * (win) + \
- (offset))
-#define OB_WIN_MATCH_LS(win) OB_WIN_REG_ADDR(win, 0x00)
-#define OB_WIN_MATCH_MS(win) OB_WIN_REG_ADDR(win, 0x04)
-#define OB_WIN_REMAP_LS(win) OB_WIN_REG_ADDR(win, 0x08)
-#define OB_WIN_REMAP_MS(win) OB_WIN_REG_ADDR(win, 0x0c)
-#define OB_WIN_MASK_LS(win) OB_WIN_REG_ADDR(win, 0x10)
-#define OB_WIN_MASK_MS(win) OB_WIN_REG_ADDR(win, 0x14)
-#define OB_WIN_ACTIONS(win) OB_WIN_REG_ADDR(win, 0x18)
-
-/* PCIe window types */
-#define OB_PCIE_MEM 0x0
-#define OB_PCIE_IO 0x4
-
/* LMI registers base address and register offsets */
#define LMI_BASE_ADDR 0x6000
#define CFG_REG (LMI_BASE_ADDR + 0x0)
@@ -248,26 +230,6 @@ static int advk_pcie_wait_for_link(struct advk_pcie *pcie)
return -ETIMEDOUT;
}
-/*
- * Set PCIe address window register which could be used for memory
- * mapping.
- */
-static void advk_pcie_set_ob_win(struct advk_pcie *pcie,
- u32 win_num, u32 match_ms,
- u32 match_ls, u32 mask_ms,
- u32 mask_ls, u32 remap_ms,
- u32 remap_ls, u32 action)
-{
- advk_writel(pcie, match_ls, OB_WIN_MATCH_LS(win_num));
- advk_writel(pcie, match_ms, OB_WIN_MATCH_MS(win_num));
- advk_writel(pcie, mask_ms, OB_WIN_MASK_MS(win_num));
- advk_writel(pcie, mask_ls, OB_WIN_MASK_LS(win_num));
- advk_writel(pcie, remap_ms, OB_WIN_REMAP_MS(win_num));
- advk_writel(pcie, remap_ls, OB_WIN_REMAP_LS(win_num));
- advk_writel(pcie, action, OB_WIN_ACTIONS(win_num));
- advk_writel(pcie, match_ls | BIT(0), OB_WIN_MATCH_LS(win_num));
-}
-
static void advk_pcie_issue_perst(struct advk_pcie *pcie)
{
u32 reg;
@@ -391,11 +353,6 @@ static void advk_pcie_train_link(struct advk_pcie *pcie)
static void advk_pcie_setup_hw(struct advk_pcie *pcie)
{
u32 reg;
- int i;
-
- /* Point PCIe unit MBUS decode windows to DRAM space */
- for (i = 0; i < 8; i++)
- advk_pcie_set_ob_win(pcie, i, 0, 0, 0, 0, 0, 0, 0);
/* Set to Direct mode */
reg = advk_readl(pcie, CTRL_CONFIG_REG);
@@ -1048,12 +1005,6 @@ static int advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie)
switch (resource_type(res)) {
case IORESOURCE_IO:
- advk_pcie_set_ob_win(pcie, 1,
- upper_32_bits(res->start),
- lower_32_bits(res->start),
- 0, 0xF8000000, 0,
- lower_32_bits(res->start),
- OB_PCIE_IO);
err = devm_pci_remap_iospace(dev, res, iobase);
if (err) {
dev_warn(dev, "error %d: failed to map resource %pR\n",
@@ -1062,12 +1013,6 @@ static int advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie)
}
break;
case IORESOURCE_MEM:
- advk_pcie_set_ob_win(pcie, 0,
- upper_32_bits(res->start),
- lower_32_bits(res->start),
- 0x0, 0xF8000000, 0,
- lower_32_bits(res->start),
- (2 << 20) | OB_PCIE_MEM);
res_valid |= !(res->flags & IORESOURCE_PREFETCH);
break;
case IORESOURCE_BUS:
--
2.32.0
next prev parent reply other threads:[~2021-11-24 22:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 22:49 [PATCH 4.14 00/24] Armada 3720 PCIe fixes for 4.14 Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 01/24] PCI: aardvark: Fix I/O space page leak Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 02/24] PCI: aardvark: Fix a leaked reference by adding missing of_node_put() Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 03/24] PCI: aardvark: Wait for endpoint to be ready before training link Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 04/24] PCI: aardvark: Train link immediately after enabling training Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 05/24] PCI: aardvark: Improve link training Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 06/24] PCI: aardvark: Issue PERST via GPIO Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 07/24] PCI: aardvark: Replace custom macros by standard linux/pci_regs.h macros Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 08/24] PCI: aardvark: Indicate error in 'val' when config read fails Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 09/24] PCI: aardvark: Introduce an advk_pcie_valid_device() helper Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 10/24] PCI: aardvark: Don't touch PCIe registers if no card connected Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 11/24] PCI: aardvark: Fix compilation on s390 Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 12/24] PCI: aardvark: Move PCIe reset card code to advk_pcie_train_link() Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 13/24] PCI: aardvark: Update comment about disabling link training Marek Behún
2021-11-24 22:49 ` Marek Behún [this message]
2021-11-24 22:49 ` [PATCH 4.14 15/24] PCI: aardvark: Configure PCIe resources from 'ranges' DT property Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 16/24] PCI: aardvark: Fix PCIe Max Payload Size setting Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 17/24] PCI: Add PCI_EXP_LNKCTL2_TLS* macros Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 18/24] PCI: aardvark: Fix link training Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 19/24] PCI: aardvark: Fix checking for link up via LTSSM state Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 20/24] pinctrl: armada-37xx: Correct mpp definitions Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 21/24] pinctrl: armada-37xx: add missing pin: PCIe1 Wakeup Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 22/24] pinctrl: armada-37xx: Correct PWM pins definitions Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 23/24] arm64: dts: marvell: armada-37xx: declare PCIe reset pin Marek Behún
2021-11-24 22:49 ` [PATCH 4.14 24/24] arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function Marek Behún
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=20211124224933.24275-15-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=nadavh@marvell.com \
--cc=pali@kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=xigu@marvell.com \
--cc=xswang@marvell.com \
/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