From: Frank Li <Frank.Li@nxp.com>
To: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Abraham I" <kishon@kernel.org>,
"Saravana Kannan" <saravanak@google.com>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
"Jesper Nilsson" <jesper.nilsson@axis.com>,
"Richard Zhu" <hongxing.zhu@nxp.com>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Frank Li" <Frank.Li@nxp.com>
Subject: [PATCH 0/9] PCI-EP: Add 'ranges' support for PCI endpoint devices
Date: Thu, 19 Sep 2024 18:03:00 -0400 [thread overview]
Message-ID: <20240919-pcie_ep_range-v1-0-b3e9d62780b7@nxp.com> (raw)
The PCI bus device tree supports 'ranges' properties that indicate
how to convert PCI addresses to CPU addresses. Many PCI controllers
are dual-role controllers, supporting both Root Complex (RC) and
Endpoint (EP) modes. The EP side also needs similar information for
proper address translation.
This commit introduces several changes to add 'ranges' support for
PCI endpoint devices:
1. **Modify of_address.c**: Add support for the new `device_type`
"pci-ep", enabling it to parse 'ranges' using the same functions
as for PCI devices.
2. **Update DesignWare PCIe EP driver**: Enhance the driver to
support 'ranges' when 'addr_space' is missing, maintaining
compatibility with existing drivers.
3. **Update binding documentation**: Modify the device tree bindings
to include 'ranges' support and make 'addr_space' an optional
entry in 'reg-names'.
4. **Add i.MX8QXP EP support**: Incorporate support for the
i.MX8QXP PCIe EP in the driver.
i.MX8QXP PCIe dts is upstreaming. Below is pcie-ep part.
pcieb_ep: pcie-ep@5f010000 {
compatible = "fsl,imx8q-pcie-ep";
reg = <0x5f010000 0x00010000>;
reg-names = "dbi";
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci-ep";
ranges = <0x82000000 0 0x80000000 0x70000000 0 0x10000000>;
num-lanes = <1>;
interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "dma";
clocks = <&pcieb_lpcg IMX_LPCG_CLK_6>,
<&pcieb_lpcg IMX_LPCG_CLK_4>,
<&pcieb_lpcg IMX_LPCG_CLK_5>;
clock-names = "dbi", "mstr", "slv";
power-domains = <&pd IMX_SC_R_PCIE_B>;
fsl,max-link-speed = <3>;
num-ib-windows = <6>;
num-ob-windows = <6>;
status = "disabled";
};
These changes improve PCIe EP support by allowing proper address
translation using 'ranges', ensuring compatibility with devices that
rely on this information.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Frank Li (9):
dt-bindings: PCI: pci-ep: Document 'ranges' property
of: address: Add argument 'name' for of_node_is_pcie()
of: address: Add device type pci-ep
dt-bindings: PCI: snps,dw-pcie-ep: 'addr_space' not required if 'ranges' present
PCI: dwc: ep: Replace phys_base and addr_size with range
PCI: dwc: ep: Use 'ranges' from DT if 'addr_space' is missing
dt-bindings: PCI: fsl,imx6q-pcie-ep: Add compatible string fsl,imx8q-pcie-ep
PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext()
PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support
.../devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 42 +++++++++++++++++++++-
Documentation/devicetree/bindings/pci/pci-ep.yaml | 30 ++++++++++++++++
.../bindings/pci/snps,dw-pcie-common.yaml | 4 +--
.../devicetree/bindings/pci/snps,dw-pcie-ep.yaml | 21 ++++++++---
drivers/of/address.c | 30 ++++++++++++----
drivers/pci/controller/dwc/pci-imx6.c | 24 ++++++++++++-
drivers/pci/controller/dwc/pcie-artpec6.c | 2 +-
drivers/pci/controller/dwc/pcie-designware-ep.c | 23 ++++++++----
drivers/pci/controller/dwc/pcie-designware.h | 4 +--
9 files changed, 157 insertions(+), 23 deletions(-)
---
base-commit: 909eac36208b70a22fd0d1c3097e3af98dca7599
change-id: 20240918-pcie_ep_range-4c5c5e300e19
Best regards,
---
Frank Li <Frank.Li@nxp.com>
next reply other threads:[~2024-09-19 22:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 22:03 Frank Li [this message]
2024-09-19 22:03 ` [PATCH 1/9] dt-bindings: PCI: pci-ep: Document 'ranges' property Frank Li
2024-09-19 22:03 ` [PATCH 2/9] of: address: Add argument 'name' for of_node_is_pcie() Frank Li
2024-09-19 22:03 ` [PATCH 3/9] of: address: Add device type pci-ep Frank Li
2024-09-19 22:03 ` [PATCH 4/9] dt-bindings: PCI: snps,dw-pcie-ep: 'addr_space' not required if 'ranges' present Frank Li
2024-09-19 22:03 ` [PATCH 5/9] PCI: dwc: ep: Replace phys_base and addr_size with range Frank Li
2024-09-19 22:03 ` [PATCH 6/9] PCI: dwc: ep: Use 'ranges' from DT if 'addr_space' is missing Frank Li
2024-09-19 22:03 ` [PATCH 7/9] dt-bindings: PCI: fsl,imx6q-pcie-ep: Add compatible string fsl,imx8q-pcie-ep Frank Li
2024-09-19 22:03 ` [PATCH 8/9] PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext() Frank Li
2024-09-19 22:03 ` [PATCH 9/9] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Frank Li
2024-09-21 14:43 ` [PATCH 0/9] PCI-EP: Add 'ranges' support for PCI endpoint devices Rob Herring
2024-09-21 19:18 ` Frank Li
2024-09-23 16:14 ` Frank Li
2024-09-23 19:02 ` Frank Li
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=20240919-pcie_ep_range-v1-0-b3e9d62780b7@nxp.com \
--to=frank.li@nxp.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=gustavo.pimentel@synopsys.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=jesper.nilsson@axis.com \
--cc=jingoohan1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kw@linux.com \
--cc=kwilczynski@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@axis.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=saravanak@google.com \
--cc=shawnguo@kernel.org \
/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).