Add Tegra194 PCIe support
Subsystems (7)
v2 cover Add Tegra194 PCIe support
Tegra194 has six PCIe controllers based on Synopsys DesignWare core. There are two Universal PHY (UPHY) blocks with each supporting 12(HSIO:
Hisg Speed IO) and 8(NVHS: NVIDIA High Speed) lanes respectively. Controllers:0~4 use UPHY lanes from HSIO brick whereas Controller:5 uses UPHY lanes from NVHS brick. Lane mapping in HSIO UPHY brick to each PCIe controller (0~4) is controlled in XBAR module by BPMP-FW. Since PCIe core has PIPE interface, a glue module called PIPE-to-UPHY (P2U) is used to connect each UPHY lane (applicable to both HSIO and NVHS UPHY bricks) to PCIe controller
This patch series
- Adds support for P2U PHY driver
- Adds support for PCIe host controller
- Adds device tree nodes each PCIe controllers
- Enables nodes applicable to p2972-0000 platform
- Adds helper APIs in Designware core driver to get capability regs offset
- Adds defines for new feature registers of PCIe spec revision 4
- Makes changes in DesignWare core driver to get Tegra194 PCIe working
Testing done on P2972-0000 platform
- Able to get PCIe link up with on-board Marvel eSATA controller
- Able to get PCIe link up with NVMe cards connected to M.2 Key-M slot
- Able to do data transfers with both SATA drives and NVMe cards
Note
- Enabling x8 slot on P2972-0000 platform requires pinmux driver for Tegra194. It is being worked on currently and hence Controller:5 (i.e. x8 slot) is disabled in this patch series. A future patch series would enable this.
- This series is based on top of the following series
Jisheng's patches to add support to .remove() in Designware sub-system
https://patchwork.kernel.org/project/linux-pci/list/?series=98559
My patches made on top of Jisheng's patches to export various symbols
https://patchwork.kernel.org/project/linux-pci/list/?series=101259
Changes since [v1]:
* Addressed review comments from Bjorn, Thierry, Jonathan, Rob & Kishon
* Added more patches in v2 series
Vidya Sagar (16):
PCI: Add #defines for PCIe spec r4.0 features PCI/PME: Export pcie_pme_disable_msi() API
PCI: Export pcie_bus_config symbol
PCI: dwc: Perform dbi regs write lock towards the end
PCI: dwc: Move config space capability search API
PCI: dwc: Add ext config space capability search API
dt-bindings: PCI: designware: Add binding for CDM register check
PCI: dwc: Add support to enable CDM register check Documentation/devicetree: Add PCIe supports-clkreq property
dt-bindings: PCI: tegra: Add device tree support for T194
dt-bindings: PHY: P2U: Add Tegra 194 P2U block
arm64: tegra: Add P2U and PCIe controller nodes to Tegra194 DT
arm64: tegra: Enable PCIe slots in P2972-0000 board
phy: tegra: Add PCIe PIPE2UPHY support
PCI: tegra: Add Tegra194 PCIe support
arm64: Add Tegra194 PCIe driver to defconfig
.../devicetree/bindings/pci/designware-pcie.txt | 4 + .../bindings/pci/nvidia,tegra194-pcie.txt | 181 ++ Documentation/devicetree/bindings/pci/pci.txt | 5 + .../devicetree/bindings/phy/phy-tegra194-p2u.txt | 28 + arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 50 + arch/arm64/boot/dts/nvidia/tegra194.dtsi | 449 +++++ arch/arm64/configs/defconfig | 1 + drivers/pci/controller/dwc/Kconfig | 11 + drivers/pci/controller/dwc/Makefile | 1 + drivers/pci/controller/dwc/pcie-designware-ep.c | 37 +- drivers/pci/controller/dwc/pcie-designware-host.c | 3 - drivers/pci/controller/dwc/pcie-designware.c | 81 + drivers/pci/controller/dwc/pcie-designware.h | 12 + drivers/pci/controller/dwc/pcie-tegra194.c | 1760 ++++++++++++++++++++ drivers/pci/pci.c | 1 + drivers/pci/pcie/pme.c | 6 + drivers/pci/pcie/portdrv.h | 5 +- drivers/phy/tegra/Kconfig | 7 + drivers/phy/tegra/Makefile | 1 + drivers/phy/tegra/pcie-p2u-tegra194.c | 120 ++ include/uapi/linux/pci_regs.h | 22 +- 22 files changed, 2743 insertions(+), 44 deletions(-) create mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt create mode 100644 Documentation/devicetree/bindings/phy/phy-tegra194-p2u.txt create mode 100644 drivers/pci/controller/dwc/pcie-tegra194.c create mode 100644 drivers/phy/tegra/pcie-p2u-tegra194.c
Signature · 1 line
2.7.4
PATCH v2 1/16 PCI: Add #defines for PCIe spec r4.0 features
Add #defines for the Data Link Feature and Physical Layer 16.0 GT/s features.
---
Changes from [v1]:
* None
include/uapi/linux/pci_regs.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
include/uapi/linux/pci_regs.h +21 -1
@@ -705,7 +705,9 @@#define PCI_EXT_CAP_ID_DPC 0x1D/* Downstream Port Containment */ #define PCI_EXT_CAP_ID_L1SS 0x1E/* L1 PM Substates */ #define PCI_EXT_CAP_ID_PTM 0x1F/* Precision Time Measurement */ -#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM +#define PCI_EXT_CAP_ID_DLF 0x25/* Data Link Feature */ +#define PCI_EXT_CAP_ID_PL 0x26/* Physical Layer 16.0 GT/s */ +#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL#define PCI_EXT_CAP_DSN_SIZEOF 12#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
@@ -1045,4 +1047,22 @@#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000/* LTR_L1.2_THRESHOLD_Scale */ #define PCI_L1SS_CTL2 0x0c/* Control 2 Register */ +/* Data Link Feature */ +#define PCI_DLF_CAP 0x04/* Capabilities Register */ +#define PCI_DLF_LOCAL_DLF_SUP_MASK 0x007fffff/* Local Data Link Feature Supported */ +#define PCI_DLF_EXCHANGE_ENABLE 0x80000000/* Data Link Feature Exchange Enable */ +#define PCI_DLF_STS 0x08/* Status Register */ +#define PCI_DLF_REMOTE_DLF_SUP_MASK 0x007fffff/* Remote Data Link Feature Supported */ +#define PCI_DLF_REMOTE_DLF_SUP_VALID 0x80000000/* Remote Data Link Feature Support Valid */ + +/* Physical Layer 16.0 GT/s */ +#define PCI_PL_16GT_CAP 0x04/* Capabilities Register */ +#define PCI_PL_16GT_CTRL 0x08/* Control Register */ +#define PCI_PL_16GT_STS 0x0c/* Status Register */ +#define PCI_PL_16GT_LDPM_STS 0x10/* Local Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_FRDPM_STS 0x14/* First Retimer Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_SRDPM_STS 0x18/* Second Retimer Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_RSVD 0x1C/* Reserved */ +#define PCI_PL_16GT_LE_CTRL 0x20/* Lane Equalization Control Register */ +#endif /* LINUX_PCI_REGS_H */
Signature · 1 line
2.7.4
Re: [PATCH V2 01/16] PCI: Add #defines for PCIe spec r4.0 features
Quoted 37 lines · Vidya Sagar
Add #defines for the Data Link Feature and Physical Layer 16.0 GT/s features.
Signed-off-by Vidya Sagar <[email protected]>---
Changes from [v1]:
* Noneinclude/uapi/linux/pci_regs.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)include/uapi/linux/pci_regs.h +10
-1@@ -705,7 +705,9 @@#define PCI_EXT_CAP_ID_DPC 0x1D/* Downstream Port Containment */ #define PCI_EXT_CAP_ID_L1SS 0x1E/* L1 PM Substates */ #define PCI_EXT_CAP_ID_PTM 0x1F/* Precision Time Measurement */ -#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM +#define PCI_EXT_CAP_ID_DLF 0x25/* Data Link Feature */ +#define PCI_EXT_CAP_ID_PL 0x26/* Physical Layer 16.0 GT/s */ +#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL#define PCI_EXT_CAP_DSN_SIZEOF 12#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40@@ -1045,4 +1047,22 @@#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000/* LTR_L1.2_THRESHOLD_Scale */ #define PCI_L1SS_CTL2 0x0c/* Control 2 Register */ +/* Data Link Feature */ +#define PCI_DLF_CAP 0x04/* Capabilities Register */ +#define PCI_DLF_LOCAL_DLF_SUP_MASK 0x007fffff/* Local Data Link Feature Supported */ +#define PCI_DLF_EXCHANGE_ENABLE 0x80000000/* Data Link Feature Exchange Enable */ +#define PCI_DLF_STS 0x08/* Status Register */ +#define PCI_DLF_REMOTE_DLF_SUP_MASK 0x007fffff/* Remote Data Link Feature Supported */ +#define PCI_DLF_REMOTE_DLF_SUP_VALID 0x80000000/* Remote Data Link Feature Support Valid */
include/uapi/linux/pci_regs.h line 1066
Quoted 10 lines
include/uapi/linux/pci_regs.h +10
-0+ +/* Physical Layer 16.0 GT/s */ +#define PCI_PL_16GT_CAP 0x04/* Capabilities Register */ +#define PCI_PL_16GT_CTRL 0x08/* Control Register */ +#define PCI_PL_16GT_STS 0x0c/* Status Register */ +#define PCI_PL_16GT_LDPM_STS 0x10/* Local Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_FRDPM_STS 0x14/* First Retimer Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_SRDPM_STS 0x18/* Second Retimer Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_RSVD 0x1C/* Reserved */ +#define PCI_PL_16GT_LE_CTRL 0x20/* Lane Equalization Control Register */
This looks correct comparing to the specification. However, this leaves out some definitions, so I'm wondering if perhaps this should include all field definitions. There are also extended capabilities between the current maximum 0x1F and 0x25. Perhaps those should be added as well. I guess this could always be done as a follow-up.
Perhaps it'd be better to change the subject to more accurately reflect that you're only adding a couple of PCIe 4.0 features.
Other than that:
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH V2 01/16] PCI: Add #defines for PCIe spec r4.0 features
Quoted 55 lines · Thierry Reding
Quoted 37 lines · Vidya Sagar
Add #defines for the Data Link Feature and Physical Layer 16.0 GT/s features.
Signed-off-by Vidya Sagar <[email protected]>---
Changes from [v1]:
* Noneinclude/uapi/linux/pci_regs.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)include/uapi/linux/pci_regs.h +10
-1@@ -705,7 +705,9 @@#define PCI_EXT_CAP_ID_DPC 0x1D/* Downstream Port Containment */ #define PCI_EXT_CAP_ID_L1SS 0x1E/* L1 PM Substates */ #define PCI_EXT_CAP_ID_PTM 0x1F/* Precision Time Measurement */ -#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM +#define PCI_EXT_CAP_ID_DLF 0x25/* Data Link Feature */ +#define PCI_EXT_CAP_ID_PL 0x26/* Physical Layer 16.0 GT/s */ +#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL#define PCI_EXT_CAP_DSN_SIZEOF 12#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40@@ -1045,4 +1047,22 @@#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000/* LTR_L1.2_THRESHOLD_Scale */ #define PCI_L1SS_CTL2 0x0c/* Control 2 Register */ +/* Data Link Feature */ +#define PCI_DLF_CAP 0x04/* Capabilities Register */ +#define PCI_DLF_LOCAL_DLF_SUP_MASK 0x007fffff/* Local Data Link Feature Supported */ +#define PCI_DLF_EXCHANGE_ENABLE 0x80000000/* Data Link Feature Exchange Enable */ +#define PCI_DLF_STS 0x08/* Status Register */ +#define PCI_DLF_REMOTE_DLF_SUP_MASK 0x007fffff/* Remote Data Link Feature Supported */ +#define PCI_DLF_REMOTE_DLF_SUP_VALID 0x80000000/* Remote Data Link Feature Support Valid */ include/uapi/linux/pci_regs.h line 1066
Quoted 10 lines
include/uapi/linux/pci_regs.h +10
-0+ +/* Physical Layer 16.0 GT/s */ +#define PCI_PL_16GT_CAP 0x04/* Capabilities Register */ +#define PCI_PL_16GT_CTRL 0x08/* Control Register */ +#define PCI_PL_16GT_STS 0x0c/* Status Register */ +#define PCI_PL_16GT_LDPM_STS 0x10/* Local Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_FRDPM_STS 0x14/* First Retimer Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_SRDPM_STS 0x18/* Second Retimer Data Parity Mismatch Status Register */ +#define PCI_PL_16GT_RSVD 0x1C/* Reserved */ +#define PCI_PL_16GT_LE_CTRL 0x20/* Lane Equalization Control Register */ This looks correct comparing to the specification. However, this leaves out some definitions, so I'm wondering if perhaps this should include all field definitions. There are also extended capabilities between the current maximum
0x1Fand0x25. Perhaps those should be added as well. I guess this could always be done as a follow-up.
Quoted 2 lines
Perhaps it'd be better to change the subject to more accurately reflect that you're only adding a couple of PCIe 4.0 features.
I'll change subject accordingly.
Quoted 5 lines
Other than that:
Reviewed-by Thierry Reding <[email protected]>
PATCH v2 2/16 PCI/PME: Export pcie_pme_disable_msi() API
In reply to Vidya SagarExport pcie_pme_disable_msi() API to enable drivers using this API be able to build as loadable modules
---
Changes from [v1]:
* This is a new patch in v2 series
drivers/pci/pcie/pme.c | 6 ++++++ drivers/pci/pcie/portdrv.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/pci/pcie/pme.c +6 -0
@@ -27,6 +27,12 @@*/ bool pcie_pme_msi_disabled; +void pcie_pme_disable_msi (void ) +{ + pcie_pme_msi_disabled = true; +} +EXPORT_SYMBOL_GPL (pcie_pme_disable_msi); +static int __init pcie_pme_setup (char *str) {if (!strncmp (str,"nomsi" ,5 ))
drivers/pci/pcie/portdrv.h +1 -4
@@ -127,10 +127,7 @@ struct pci_dev;#ifdef CONFIG_PCIE_PME extern bool pcie_pme_msi_disabled; -static inline void pcie_pme_disable_msi (void ) -{ - pcie_pme_msi_disabled = true; -} +void pcie_pme_disable_msi (void );static inline bool pcie_pme_no_msi (void ) {
Signature · 1 line
2.7.4
Re: [PATCH V2 02/16] PCI/PME: Export pcie_pme_disable_msi() API
Quoted 35 lines · Vidya Sagar
Export
pcie_pme_disable_msi()API to enable drivers using this API be able to build as loadable modulesSigned-off-by Vidya Sagar <[email protected]>---
Changes from [v1]:
* This is a new patch in v2 seriesdrivers/pci/pcie/pme.c | 6 ++++++ drivers/pci/pcie/portdrv.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-)drivers/pci/pcie/pme.c +6
-0@@ -27,6 +27,12 @@*/ bool pcie_pme_msi_disabled; +void pcie_pme_disable_msi (void ) +{ + pcie_pme_msi_disabled = true; +} +EXPORT_SYMBOL_GPL (pcie_pme_disable_msi); +static int __init pcie_pme_setup (char *str) {if (!strncmp (str,"nomsi" ,5 ))drivers/pci/pcie/portdrv.h +0
-0@@ -127,10 +127,7 @@ struct pci_dev;#ifdef CONFIG_PCIE_PME
drivers/pci/pcie/portdrv.h struct pci_dev; · line 133
Quoted 10 lines
drivers/pci/pcie/portdrv.h +1
-4extern bool pcie_pme_msi_disabled; -static inline void pcie_pme_disable_msi (void ) -{ - pcie_pme_msi_disabled = true; -} +void pcie_pme_disable_msi (void );static inline bool pcie_pme_no_msi (void ) {
Perhaps also export pcie_pme_no_msi()? That way you could get rid of the extern declaration of the pcie_pme_msi_disabled variable and make it static to drivers/pci/pcie/pme.c?
Thierry
Re: [PATCH V2 02/16] PCI/PME: Export pcie_pme_disable_msi() API
Quoted 44 lines · Thierry Reding
Quoted 43 lines · Vidya Sagar
Export
pcie_pme_disable_msi()API to enable drivers using this API be able to build as loadable modulesSigned-off-by Vidya Sagar <[email protected]>---
Changes from [v1]:
* This is a new patch in v2 seriesdrivers/pci/pcie/pme.c | 6 ++++++ drivers/pci/pcie/portdrv.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-)drivers/pci/pcie/pme.c +6
-0@@ -27,6 +27,12 @@*/ bool pcie_pme_msi_disabled; +void pcie_pme_disable_msi (void ) +{ + pcie_pme_msi_disabled = true; +} +EXPORT_SYMBOL_GPL (pcie_pme_disable_msi); +static int __init pcie_pme_setup (char *str) {if (!strncmp (str,"nomsi" ,5 ))drivers/pci/pcie/portdrv.h +1
-4@@ -127,10 +127,7 @@ struct pci_dev;#ifdef CONFIG_PCIE_PME extern bool pcie_pme_msi_disabled; -static inline void pcie_pme_disable_msi (void ) -{ - pcie_pme_msi_disabled = true; -} +void pcie_pme_disable_msi (void );
Quoted 6 lines
drivers/pci/pcie/portdrv.h struct pci_dev; · line 133
Quoted 2 lines
drivers/pci/pcie/portdrv.h +0
-0static inline bool pcie_pme_no_msi (void ) {Perhaps also export
pcie_pme_no_msi()? That way you could get rid of the extern declaration of thepcie_pme_msi_disabledvariable and make it static todrivers/pci/pcie/pme.c?
Agree. I'll take care of this in V3 patch series.
Quoted 3 lines
Thierry
PATCH v2 3/16 PCI: Export pcie_bus_config symbol
In reply to Vidya SagarExport pcie_bus_config to enable host controller drivers setting it to a specific configuration be able to build as loadable modules
---
Changes since [v1]:
* This is a new patch in v2 series
drivers/pci/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/pci.c +1 -0
@@ -94,6 +94,7 @@ unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;unsigned long pci_hotplug_bus_size =DEFAULT_HOTPLUG_BUS_SIZE ;enum pcie_bus_config_types pcie_bus_config =PCIE_BUS_DEFAULT ; +EXPORT_SYMBOL_GPL (pcie_bus_config);/* * The default CLS is used if arch didn't set CLS explicitly and not
Signature · 1 line
2.7.4
PATCH v2 4/16 PCI: dwc: Perform dbi regs write lock towards the end
In reply to Vidya SagarRemove multiple write enable and disable sequences of dbi registers as Tegra194 implements writes to BAR-0 register (offset: 0x10) controlled by DBI write-lock enable bit thereby not allowing any further writes to BAR-0 register in config space to take place. Hence disabling write permission only towards the end.
---
Changes since [v1]:
* None
drivers/pci/controller/dwc/pcie-designware-host.c | 3 --- 1 file changed, 3 deletions(-)
drivers/pci/controller/dwc/pcie-designware-host.c +0 -3
@@ -683,7 +683,6 @@ void dw_pcie_setup_rc(struct pcie_port *pp) val &=0xffff00ff ; val |=0x00000100 ;dw_pcie_writel_dbi (pci,PCI_INTERRUPT_LINE , val); -dw_pcie_dbi_ro_wr_dis (pci);/* Setup bus numbers */ val =dw_pcie_readl_dbi (pci,PCI_PRIMARY_BUS );
@@ -723,8 +722,6 @@ void dw_pcie_setup_rc(struct pcie_port *pp)dw_pcie_wr_own_conf (pp,PCI_BASE_ADDRESS_0 ,4 ,0 ); -/* Enable write permission for the DBI read-only register */ -dw_pcie_dbi_ro_wr_en (pci);/* Program correct class for RC */ dw_pcie_wr_own_conf (pp,PCI_CLASS_DEVICE ,2 ,PCI_CLASS_BRIDGE_PCI );/* Better disable write permission right after the update */
Signature · 1 line
2.7.4
PATCH v2 5/16 PCI: dwc: Move config space capability search API
In reply to Vidya Sagarmove PCIe config space capability search API to common designware file as this can be used by both host and ep mode codes.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1554407724; bh=jQR9nFs/LVuU16O+4g9VUt8D0FYqHU7ch/l131xrbHM=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=UQuc2NpvbrIMAshj2IXJEkV3wFJq0l81Jo3mwW0lXy/2z4n8L/QCv6hleUg+PSjLJ cZKmeQw9F+O8e7lzmOJy+RJCmB/eLuwUx6yl/Fhxas0mTeGgJBKfO0MZB/IaXJ6SVx EmFpH475a02Q6jGpCNYyRw8K5TWqhu4u3Iionn7cXnxXOFTdrxWa08djN3kqhI5mXq y43RdlUolSXGCAgYy1kY9ATl8ULBi61dj9ELsR+51Y6w8ImtJt41f8ClEXq+cErRl/ Zl7l/7GlEBEiFFydE4GHStH3xtWUgNiC3kNtHzSxtlhIouO0Jhwd7ICYIYyEyzRBV+ XQ0NU8oh5uPZg==
---
Changes from [v1]:
* Removed dw_pcie_find_next_ext_capability() API from here and made a separate patch for that
drivers/pci/controller/dwc/pcie-designware-ep.c | 37 ++----------------------- drivers/pci/controller/dwc/pcie-designware.c | 33 ++++++++++++++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 2 ++ 3 files changed, 37 insertions(+), 35 deletions(-)
drivers/pci/controller/dwc/pcie-designware-ep.c +2 -35
@@ -40,39 +40,6 @@ void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar)__dw_pcie_ep_reset_bar (pci, bar,0 ); } -static u8 __dw_pcie_ep_find_next_cap (struct dw_pcie *pci,u8 cap_ptr, -u8 cap) -{ -u8 cap_id, next_cap_ptr; -u16 reg; - - reg =dw_pcie_readw_dbi (pci, cap_ptr); - next_cap_ptr = (reg &0xff00 ) >>8 ; - cap_id = (reg &0x00ff ); - -if (!next_cap_ptr || cap_id >PCI_CAP_ID_MAX ) -return 0 ; - -if (cap_id == cap) -return cap_ptr; - -return __dw_pcie_ep_find_next_cap (pci, next_cap_ptr, cap); -} - -static u8 dw_pcie_ep_find_capability (struct dw_pcie *pci,u8 cap) -{ -u8 next_cap_ptr; -u16 reg; - - reg =dw_pcie_readw_dbi (pci,PCI_CAPABILITY_LIST ); - next_cap_ptr = (reg &0x00ff ); - -if (!next_cap_ptr) -return 0 ; - -return __dw_pcie_ep_find_next_cap (pci, next_cap_ptr, cap); -} -static int dw_pcie_ep_write_header (struct pci_epc *epc,u8 func_no,struct pci_epf_header *hdr) {
@@ -591,9 +558,9 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)dev_err (dev,"Failed to reserve memory for MSI/MSI-X\n" );return -ENOMEM ; } - ep->msi_cap =dw_pcie_ep_find_capability (pci,PCI_CAP_ID_MSI ); + ep->msi_cap =dw_pcie_find_capability (pci,PCI_CAP_ID_MSI ); - ep->msix_cap =dw_pcie_ep_find_capability (pci,PCI_CAP_ID_MSIX ); + ep->msix_cap =dw_pcie_find_capability (pci,PCI_CAP_ID_MSIX );dw_pcie_setup (pci);
drivers/pci/controller/dwc/pcie-designware.c +33 -0
@@ -20,6 +20,39 @@#define PCIE_PHY_DEBUG_R1_LINK_UP (0x1 << 4)#define PCIE_PHY_DEBUG_R1_LINK_IN_TRAINING (0x1 << 29) +static u8 __dw_pcie_find_next_cap (struct dw_pcie *pci,u8 cap_ptr, +u8 cap) +{ +u8 cap_id, next_cap_ptr; +u16 reg; + + reg =dw_pcie_readw_dbi (pci, cap_ptr); + next_cap_ptr = (reg &0xff00 ) >>8 ; + cap_id = (reg &0x00ff ); + +if (!next_cap_ptr || cap_id >PCI_CAP_ID_MAX ) +return 0 ; + +if (cap_id == cap) +return cap_ptr; + +return __dw_pcie_find_next_cap (pci, next_cap_ptr, cap); +} + +u8 dw_pcie_find_capability (struct dw_pcie *pci,u8 cap) +{ +u8 next_cap_ptr; +u16 reg; + + reg =dw_pcie_readw_dbi (pci,PCI_CAPABILITY_LIST ); + next_cap_ptr = (reg &0x00ff ); + +if (!next_cap_ptr) +return 0 ; + +return __dw_pcie_find_next_cap (pci, next_cap_ptr, cap); +} +int dw_pcie_read (void __iomem *addr,int size,u32 *val) {if (!IS_ALIGNED ((uintptr_t )addr, size)) {
drivers/pci/controller/dwc/pcie-designware.h +2 -0
@@ -247,6 +247,8 @@ struct dw_pcie {#define to_dw_pcie_from_ep (endpoint) \ container_of((endpoint), struct dw_pcie, ep) +u8 dw_pcie_find_capability (struct dw_pcie *pci,u8 cap); +int dw_pcie_read (void __iomem *addr,int size,u32 *val);int dw_pcie_write (void __iomem *addr,int size,u32 val);
Signature · 1 line
2.7.4
PATCH v2 6/16 PCI: dwc: Add ext config space capability search API
In reply to Vidya SagarAdd extended configuration space capability search API using struct dw_pcie * pointer
---
Changes from [v1]:
* This is a new patch in v2 series
drivers/pci/controller/dwc/pcie-designware.c | 41 ++++++++++++++++++++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 42 insertions(+)
drivers/pci/controller/dwc/pcie-designware.c +41 -0
@@ -53,6 +53,47 @@ u8 dw_pcie_find_capability(struct dw_pcie *pci, u8 cap)return __dw_pcie_find_next_cap (pci, next_cap_ptr, cap); } +static int dw_pcie_find_next_ext_capability (struct dw_pcie *pci,int start, +int cap) +{ +u32 header; +int ttl; +int pos =PCI_CFG_SPACE_SIZE ; + +/* minimum 8 bytes per capability */ + ttl = (PCI_CFG_SPACE_EXP_SIZE -PCI_CFG_SPACE_SIZE ) /8 ; + +if (start) + pos = start; + + header =dw_pcie_readl_dbi (pci, pos); +/* +* If we have no capabilities, this is indicated by cap ID, +* cap version and next pointer all being 0. +*/ +if (header ==0 ) +return 0 ; + +while (ttl-- >0 ) { +if (PCI_EXT_CAP_ID (header) == cap && pos != start) +return pos; + + pos =PCI_EXT_CAP_NEXT (header); +if (pos <PCI_CFG_SPACE_SIZE ) +break ; + + header =dw_pcie_readl_dbi (pci, pos); + } + +return 0 ; +} + +int dw_pcie_find_ext_capability (struct dw_pcie *pci,int cap) +{ +return dw_pcie_find_next_ext_capability (pci,0 , cap); +} +EXPORT_SYMBOL_GPL (dw_pcie_find_ext_capability); +int dw_pcie_read (void __iomem *addr,int size,u32 *val) {if (!IS_ALIGNED ((uintptr_t )addr, size)) {
drivers/pci/controller/dwc/pcie-designware.h +1 -0
@@ -248,6 +248,7 @@ struct dw_pcie { container_of((endpoint), struct dw_pcie, ep)u8 dw_pcie_find_capability (struct dw_pcie *pci,u8 cap); +int dw_pcie_find_ext_capability (struct dw_pcie *pci,int cap);int dw_pcie_read (void __iomem *addr,int size,u32 *val);int dw_pcie_write (void __iomem *addr,int size,u32 val);
Signature · 1 line
2.7.4
PATCH v2 7/16 dt-bindings: PCI: designware: Add binding for CDM register check
In reply to Vidya SagarAdd support to enable CDM (Configuration Dependent Module) registers check for any data corruption. CDM registers include standard PCIe configuration space registers, Port Logic registers and iATU and DMA registers. Refer Section S.4 of Synopsys DesignWare Cores PCI Express Controller Databook Version 4.90a
---
Changes since [v1]:
* This is a new patch in v2 series
Documentation/devicetree/bindings/pci/designware-pcie.txt | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/pci/designware-pcie.txt +4 -0
@@ -31,6 +31,10 @@ Optional properties: - clock-names: Must include the following entries: - "pcie" - "pcie_bus" +- cdm-check: This is a boolean property and if present enables automatic + checking of CDM (Configuration Dependent Module) registers for data + corruption. CDM registers include configuration space registers and iATU + (internal Address Translation Unit) registers. RC mode: - num-viewport: number of view ports configured in hardware. If a platform does not specify it, the driver assumes 2.
Signature · 1 line
2.7.4
Re: [PATCH V2 07/16] dt-bindings: PCI: designware: Add binding for CDM register check
Quoted 19 lines · Vidya Sagar
Add support to enable CDM (Configuration Dependent Module) registers check for any data corruption. CDM registers include standard PCIe configuration space registers, Port Logic registers and iATU and DMA registers. Refer Section S.4 of Synopsys DesignWare Cores PCI Express Controller Databook Version 4.90a
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* This is a new patch in v2 seriesDocumentation/devicetree/bindings/pci/designware-pcie.txt | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/pci/designware-pcie.txt +0
-0
Documentation/devicetree/bindings/pci/designware-pcie.txt Optional properties: · line 37
Quoted 7 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt +4
-0@@ -31,6 +31,10 @@ Optional properties: - clock-names: Must include the following entries: - "pcie" - "pcie_bus" +- cdm-check: This is a boolean property and if present enables automatic + checking of CDM (Configuration Dependent Module) registers for data + corruption. CDM registers include configuration space registers and iATU + (internal Address Translation Unit) registers.
By comparison the commit message also lists "Port Logic" and "DMA" registers as being part of the CDM registers. Shouldn't they be part of the bindings document as well?
Perhaps it'd also be a good idea to rename this property to something more imperative, like "enable-cdm" or similar.
Thierry
Quoted 6 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt +0
-0RC mode: - num-viewport: number of view ports configured in hardware. If a platform does not specify it, the driver assumes 2.Signature · 1 line
2.7.4
Re: [PATCH V2 07/16] dt-bindings: PCI: designware: Add binding for CDM register check
Quoted 15 lines · Thierry Reding
Quoted 14 lines · Vidya Sagar
Add support to enable CDM (Configuration Dependent Module) registers check for any data corruption. CDM registers include standard PCIe configuration space registers, Port Logic registers and iATU and DMA registers. Refer Section S.4 of Synopsys DesignWare Cores PCI Express Controller Databook Version 4.90a
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* This is a new patch in v2 seriesDocumentation/devicetree/bindings/pci/designware-pcie.txt | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 16 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt Optional properties: · line 37
Quoted 12 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt +4
-0@@ -31,6 +31,10 @@ Optional properties: - clock-names: Must include the following entries: - "pcie" - "pcie_bus" +- cdm-check: This is a boolean property and if present enables automatic + checking of CDM (Configuration Dependent Module) registers for data + corruption. CDM registers include configuration space registers and iATU + (internal Address Translation Unit) registers.By comparison the commit message also lists "Port Logic" and "DMA" registers as being part of the CDM registers. Shouldn't they be part of the bindings document as well?
Ok. I'll add them in V3 patch series.
Quoted 3 lines
Perhaps it'd also be a good idea to rename this property to something more imperative, like "enable-cdm" or similar.
Ok. I'll go with "enable-cdm-check". I hope that should be fine.
Quoted 9 lines
Thierry
Quoted 6 lines
Documentation/devicetree/bindings/pci/designware-pcie.txt +0
-0RC mode: - num-viewport: number of view ports configured in hardware. If a platform does not specify it, the driver assumes 2.Signature · 1 line
2.7.4
PATCH v2 8/16 PCI: dwc: Add support to enable CDM register check
In reply to Vidya SagarAdd support to enable CDM (Configuration Dependent Module) register check for any data corruption based on the device-tree flag 'cdm-check'.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1554407755; bh=2r+BgN7djIZIxyR3cmeJ0J62WCNAe33ly16bcMnz9q8=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=jLHEUHlBamovZNPYATDeG+mAEhwsN0zLWWiCGweGfpraYOnfqL+E3D69AK5kFiAib budyFZtqm4w+diWOItNQ1pmUxDm0mvr8imgg5GLOEf43l8SBeBSmJRfb+YCam456lV OOUxY/jpKfotvgE47iQO4T80Bl7btqoSbWr5LunATdEQoDneSA1tZZNbw6U20+npyd hGegs9NrJxHGun6RN+jpp8YvzjpWa2Z45d48SAyapr2p83H4LLXUczSQ5DfwDjhTHh 5AIajG4i4gaNhKBTymVygdSaOL0FCtN0702w0dRjviWmtxKfpUuJW0V7Xx7L3cwyOn Wn5g5OlZa2hLg==
---
Changes since [v1]:
* This is a new patch in v2 series
drivers/pci/controller/dwc/pcie-designware.c | 7 +++++++ drivers/pci/controller/dwc/pcie-designware.h | 9 +++++++++ 2 files changed, 16 insertions(+)
drivers/pci/controller/dwc/pcie-designware.c +7 -0
@@ -503,4 +503,11 @@ void dw_pcie_setup(struct dw_pcie *pci)break ; }dw_pcie_writel_dbi (pci,PCIE_LINK_WIDTH_SPEED_CONTROL , val); + +if (of_property_read_bool (np,"cdm-check" )) { + val =dw_pcie_readl_dbi (pci,PCIE_PL_CHK_REG_CONTROL_STATUS ); + val |=PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS | +PCIE_PL_CHK_REG_CHK_REG_START ; +dw_pcie_writel_dbi (pci,PCIE_PL_CHK_REG_CONTROL_STATUS , val); + } }
drivers/pci/controller/dwc/pcie-designware.h +9 -0
@@ -83,6 +83,15 @@#define PCIE_MISC_CONTROL_1_OFF 0x8BC#define PCIE_DBI_RO_WR_EN BIT(0) +#define PCIE_PL_CHK_REG_CONTROL_STATUS 0xB20 +#define PCIE_PL_CHK_REG_CHK_REG_START BIT(0) +#define PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS BIT(1) +#define PCIE_PL_CHK_REG_CHK_REG_COMPARISON_ERROR BIT(16) +#define PCIE_PL_CHK_REG_CHK_REG_LOGIC_ERROR BIT(17) +#define PCIE_PL_CHK_REG_CHK_REG_COMPLETE BIT(18) + +#define PCIE_PL_CHK_REG_ERR_ADDR 0xB28 +/* * iATU Unroll-specific register definitions * From 4.80 core version the address translation will be made by unroll
Signature · 1 line
2.7.4
PATCH v2 9/16 Documentation/devicetree: Add PCIe supports-clkreq property
In reply to Vidya SagarSome host controllers need to know the existence of clkreq signal routing to downstream devices to be able to advertise low power features like ASPM L1 substates. Without clkreq signal routing being present, enabling ASPM L1 sub states might lead to downstream devices falling off the bus. Hence a new device tree property 'supports-clkreq' is added to make such host controllers aware of clkreq signal routing to downstream devices.
---
Changes since [v1]:
* This is a new patch in v2 series
Documentation/devicetree/bindings/pci/pci.txt | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/pci/pci.txt +5 -0
@@ -24,3 +24,8 @@ driver implementation may support the following properties: unsupported link speed, for instance, trying to do training for unsupported link speed, etc. Must be '4' for gen4, '3' for gen3, '2' for gen2, and '1' for gen1. Any other values are invalid. +- supports-clkreq: + If present this property specifies that CLKREQ signal routing exists from + root port to downstream device and host bridge drivers can do programming + which depends on CLKREQ signal existence. For example, programming root port + not to advertise ASPM L1 Sub-States support if there is no CLKREQ signal.
Signature · 1 line
2.7.4
PATCH v2 10/16 dt-bindings: PCI: tegra: Add device tree support for T194
In reply to Vidya SagarAdd support for Tegra194 PCIe controllers. These controllers are based on Synopsys DesignWare core IP.
---
Changes since [v1]:
* Added documentation for 'power-domains' property
* Removed 'window1' and 'window2' properties
* Removed '_clk' and '_rst' from clock and reset names
* Dropped 'pcie' from phy-names
* Added entry for BPMP-FW handle
* Removed offsets for some of the registers and added them in code and would be pickedup based on controller ID
* Changed 'nvidia,max-speed' to 'max-link-speed' and is made as an optional
* Changed 'nvidia,disable-clock-request' to 'supports-clkreq' with inverted operation
* Added more documentation for 'nvidia,update-fc-fixup' property
* Removed 'nvidia,enable-power-down' and 'nvidia,plat-gpios' properties
* Added '-us' to all properties that represent time in microseconds
* Moved P2U documentation to a separate file
.../bindings/pci/nvidia,tegra194-pcie.txt | 181 +++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +181 -0
@@ -0,0 +1,181 @@ +NVIDIA Tegra PCIe controller (Synopsys DesignWare Core based) + +This PCIe host controller is based on the Synopsis Designware PCIe IP +and thus inherits all the common properties defined in designware-pcie.txt. + +Required properties: +- compatible: For Tegra19x, must contain "nvidia,tegra194-pcie". +- device_type: Must be "pci" +- power-domains: A phandle to the node that controls power to the respective + PCIe controller and a specifier name for the PCIe controller. Following are + the specifiers for the different PCIe controllers + - Controller-0 - TEGRA194_POWER_DOMAIN_PCIEX8B + - Controller-1 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-2 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-3 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-4 - TEGRA194_POWER_DOMAIN_PCIEX4A + - Controller-5 - TEGRA194_POWER_DOMAIN_PCIEX8A +- reg: A list of physical base address and length for each set of controller + registers. Must contain an entry for each entry in the reg-names property. +- reg-names: Must include the following entries: + "appl": Controller's application logic registers + "config": As per the definition in designware-pcie.txt + "atu_dma": iATU and DMA registers. This is where the iATU (internal Address + Translation Unit) registers of the PCIe core are made available + fow SW access. + "dbi": The aperture where root port's own configuration registers are + available +- interrupts: A list of interrupt outputs of the controller. Must contain an + entry for each entry in the interrupt-names property. +- interrupt-names: Must include the following entries: + "intr": The Tegra interrupt that is asserted for controller interrupts + "msi": The Tegra interrupt that is asserted when an MSI is received +- bus-range: Range of bus numbers associated with this controller +- #address-cells: Address representation for root ports (must be 3) + - cell 0 specifies the bus and device numbers of the root port: + [23:16]: bus number + [15:11]: device number + - cell 1 denotes the upper 32 address bits and should be 0 + - cell 2 contains the lower 32 address bits and is used to translate to the + CPU address space +- #size-cells: Size representation for root ports (must be 2) +- ranges: Describes the translation of addresses for root ports and standard + PCI regions. The entries must be 7 cells each, where the first three cells + correspond to the address as described for the #address-cells property + above, the fourth and fifth cells are for the physical CPU address to + translate to and the sixth and seventh cells are as described for the + #size-cells property above. + - Entries setup the mapping for the standard I/O, memory and + prefetchable PCI regions. The first cell determines the type of region + that is setup: + - 0x81000000: I/O memory region + - 0x82000000: non-prefetchable memory region + - 0xc2000000: prefetchable memory region + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- #interrupt-cells: Size representation for interrupts (must be 1) +- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. +- clock-names: Must include the following entries: + - core +- resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. +- reset-names: Must include the following entries: + - core_apb + - core +- phys: Must contain a phandle to P2U PHY for each entry in phy-names. +- phy-names: Must include an entry for each active lane. + "p2u-N": where N ranges from 0 to one less than the total number of lanes +- nvidia,bpmp: Must contain a phandle to BPMP controller node. +- nvidia,controller-id : Controller specific ID + 0 - C0 + 1 - C1 + 2 - C2 + 3 - C3 + 4 - C4 + 5 - C5 +- vddio-pex-ctl-supply: Regulator supply for PCIe side band signals + +Optional properties: +- max-link-speed: Limits controllers max speed to this value. For more info, + please refer to Documentation/devicetree/bindings/pci/pci.txt file. +- nvidia,init-speed: Limits controllers init speed to this value. + 1 - Gen-1 (2. 5 GT/s) + 2 - Gen-2 (5 GT/s) + 3 - Gen-3 (8 GT/s) + 4 - Gen-4 (16 GT/s) +- nvidia,disable-aspm-states : Controls advertisement of ASPM states + bit-0 to '1' : Disables advertisement of ASPM-L0s + bit-1 to '1' : Disables advertisement of ASPM-L1. This also disables + advertisement of ASPM-L1.1 and ASPM-L1.2 + bit-2 to '1' : Disables advertisement of ASPM-L1.1 + bit-3 to '1' : Disables advertisement of ASPM-L1.2 +- supports-clkreq : Refer to Documentation/devicetree/bindings/pci/pci.txt +- nvidia,update-fc-fixup : This is a boolean property and needs to be present to + improve perf when a platform is designed in such a way that it satisfies at + least one of the following conditions thereby enabling root port to + exchange optimum number of FC (Flow Control) credits with downstream devices + 1. If C0/C4/C5 run at x1/x2 link widths (irrespective of speed and MPS) + 2. If C0/C1/C2/C3/C4/C5 operate at their respective max link widths and + a) speed is Gen-2 and MPS is 256B + b) speed is >= Gen-3 with any MPS +- nvidia,cdm-check : Enables CDM checking. For more information, refer Synopsis + DesignWare Cores PCI Express Controller Databook r4.90a Chapter S.4 +- "nvidia,pex-wake" : Add PEX_WAKE gpio number to provide wake support. +- "nvidia,aspm-cmrt-us" : Common Mode Restore time for proper operation of ASPM + to be specified in microseconds +- "nvidia,aspm-pwr-on-t-us" : Power On time for proper operation of ASPM to be + specified in microseconds +- "nvidia,aspm-l0s-entrance-latency-us" : ASPM L0s entrance latency to be + specified in microseconds + +Examples: +========= + +Tegra194: +-------- + +SoC DTSI: + + pcie@14180000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x38040000 0x0 0x00040000>; /* iATU_DMA reg space (256K) */ + reg-names = "appl", "config", "atu_dma"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + linux,pci-domain = <0>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_0>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_0_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_0>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 72 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <0>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0x82000000 0x0 0x38200000 0x0 0x38200000 0x0 0x01E00000 /* non-prefetchable memory (30MB) */ + 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x4 0x00000000>; /* prefetchable memory (16GB) */ + }; + +Board DTS: + + pcie@14180000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_2>, + <&p2u_3>, + <&p2u_4>, + <&p2u_5>; + phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3"; + };
Signature · 1 line
2.7.4
Re: [PATCH V2 10/16] dt-bindings: PCI: tegra: Add device tree support for T194
Quoted 37 lines · Vidya Sagar
Add support for Tegra194 PCIe controllers. These controllers are based on Synopsys DesignWare core IP.
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* Added documentation for 'power-domains' property
* Removed 'window1' and 'window2' properties
* Removed '_clk' and '_rst' from clock and reset names
* Dropped 'pcie' from phy-names
* Added entry for BPMP-FW handle
* Removed offsets for some of the registers and added them in code and would be pickedup based on controller ID
* Changed 'nvidia,max-speed' to 'max-link-speed' and is made as an optional
* Changed 'nvidia,disable-clock-request' to 'supports-clkreq' with inverted operation
* Added more documentation for 'nvidia,update-fc-fixup' property
* Removed 'nvidia,enable-power-down' and 'nvidia,plat-gpios' properties
* Added '-us' to all properties that represent time in microseconds
* Moved P2U documentation to a separate file.../bindings/pci/nvidia,tegra194-pcie.txt | 181 +++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txtDocumentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +7
-0@@ -0,0 +1,181 @@ +NVIDIA Tegra PCIe controller (Synopsys DesignWare Core based) + +This PCIe host controller is based on the Synopsis Designware PCIe IP +and thus inherits all the common properties defined in designware-pcie.txt. + +Required properties: +- compatible: For Tegra19x, must contain "nvidia,tegra194-pcie".
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 17
Quoted 10 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+- device_type: Must be "pci" +- power-domains: A phandle to the node that controls power to the respective + PCIe controller and a specifier name for the PCIe controller. Following are + the specifiers for the different PCIe controllers + - Controller-0 - TEGRA194_POWER_DOMAIN_PCIEX8B + - Controller-1 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-2 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-3 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-4 - TEGRA194_POWER_DOMAIN_PCIEX4A + - Controller-5 - TEGRA194_POWER_DOMAIN_PCIEX8A
I'm not sure if I missed it, but is there an include file that contains definitions for these symbolic names? Might be worth referring to such an include from this document.
Also, why do we have two different ways of specifying the controllers? Why are they called Controller-* in one place and PCIEX* in another? Can we just pick one and stick with it?
Quoted 52 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +52
-0+- reg: A list of physical base address and length for each set of controller + registers. Must contain an entry for each entry in the reg-names property. +- reg-names: Must include the following entries: + "appl": Controller's application logic registers + "config": As per the definition in designware-pcie.txt + "atu_dma": iATU and DMA registers. This is where the iATU (internal Address + Translation Unit) registers of the PCIe core are made available + fow SW access. + "dbi": The aperture where root port's own configuration registers are + available +- interrupts: A list of interrupt outputs of the controller. Must contain an + entry for each entry in the interrupt-names property. +- interrupt-names: Must include the following entries: + "intr": The Tegra interrupt that is asserted for controller interrupts + "msi": The Tegra interrupt that is asserted when an MSI is received +- bus-range: Range of bus numbers associated with this controller +- #address-cells: Address representation for root ports (must be 3) + - cell 0 specifies the bus and device numbers of the root port: + [23:16]: bus number + [15:11]: device number + - cell 1 denotes the upper 32 address bits and should be 0 + - cell 2 contains the lower 32 address bits and is used to translate to the + CPU address space +- #size-cells: Size representation for root ports (must be 2) +- ranges: Describes the translation of addresses for root ports and standard + PCI regions. The entries must be 7 cells each, where the first three cells + correspond to the address as described for the #address-cells property + above, the fourth and fifth cells are for the physical CPU address to + translate to and the sixth and seventh cells are as described for the + #size-cells property above. + - Entries setup the mapping for the standard I/O, memory and + prefetchable PCI regions. The first cell determines the type of region + that is setup: + - 0x81000000: I/O memory region + - 0x82000000: non-prefetchable memory region + - 0xc2000000: prefetchable memory region + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- #interrupt-cells: Size representation for interrupts (must be 1) +- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. +- clock-names: Must include the following entries: + - core +- resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. +- reset-names: Must include the following entries: + - core_apb + - core +- phys: Must contain a phandle to P2U PHY for each entry in phy-names.
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 79
Quoted 10 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+- phy-names: Must include an entry for each active lane. + "p2u-N": where N ranges from 0 to one less than the total number of lanes +- nvidia,bpmp: Must contain a phandle to BPMP controller node. +- nvidia,controller-id : Controller specific ID + 0 - C0 + 1 - C1 + 2 - C2 + 3 - C3 + 4 - C4 + 5 - C5
Again, here you use a different name to refer to the controllers than before, although it's fairly obvious that these correspond to the earlier Controller-*. But best to pick one and stick with it.
Also, the list for the power-domains property has description - value, whereas you have value - description here. Since eventually the device tree bindings will be converted to YAML, perhaps stick with:
value: description
To help with a subsequent conversion.
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 89
Quoted 10 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+- vddio-pex-ctl-supply: Regulator supply for PCIe side band signals + +Optional properties: +- max-link-speed: Limits controllers max speed to this value. For more info, + please refer to Documentation/devicetree/bindings/pci/pci.txt file. +- nvidia,init-speed: Limits controllers init speed to this value. + 1 - Gen-1 (2. 5 GT/s) + 2 - Gen-2 (5 GT/s) + 3 - Gen-3 (8 GT/s) + 4 - Gen-4 (16 GT/s)
Please provide a description for when to use this and what the effects are. "Limits controller's init speed" doesn't say anything about whether the speed can be increased later, or whether it will always stay at this speed. Also, does it actually mean "set" the initial speed, or would the controller also be able to start out at a lower speed than the one given by "nvidia,init-speed"? "Limits" would suggest the latter, but best to clarify.
Quoted 8 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +8
-0+- nvidia,disable-aspm-states : Controls advertisement of ASPM states + bit-0 to '1' : Disables advertisement of ASPM-L0s + bit-1 to '1' : Disables advertisement of ASPM-L1. This also disables + advertisement of ASPM-L1.1 and ASPM-L1.2 + bit-2 to '1' : Disables advertisement of ASPM-L1.1 + bit-3 to '1' : Disables advertisement of ASPM-L1.2 +- supports-clkreq : Refer to Documentation/devicetree/bindings/pci/pci.txt +- nvidia,update-fc-fixup : This is a boolean property and needs to be present to
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 107
Quoted 10 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+ improve perf when a platform is designed in such a way that it satisfies at + least one of the following conditions thereby enabling root port to + exchange optimum number of FC (Flow Control) credits with downstream devices + 1. If C0/C4/C5 run at x1/x2 link widths (irrespective of speed and MPS) + 2. If C0/C1/C2/C3/C4/C5 operate at their respective max link widths and + a) speed is Gen-2 and MPS is 256B + b) speed is >= Gen-3 with any MPS +- nvidia,cdm-check : Enables CDM checking. For more information, refer Synopsis + DesignWare Cores PCI Express Controller Databook r4.90a Chapter S.4 +- "nvidia,pex-wake" : Add PEX_WAKE gpio number to provide wake support.
If it's a GPIO number it should have a -gpio or -gpios suffix. I think -gpios is preferred. Since the parent of the property is already a PEX controller, perhaps omit the pex- prefix and just call this:
"nvidia,wake-gpios"
?
Thierry
Quoted 77 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +74
-0+- "nvidia,aspm-cmrt-us" : Common Mode Restore time for proper operation of ASPM + to be specified in microseconds +- "nvidia,aspm-pwr-on-t-us" : Power On time for proper operation of ASPM to be + specified in microseconds +- "nvidia,aspm-l0s-entrance-latency-us" : ASPM L0s entrance latency to be + specified in microseconds + +Examples: +========= + +Tegra194: +-------- + +SoC DTSI: + + pcie@14180000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x38040000 0x0 0x00040000>; /* iATU_DMA reg space (256K) */ + reg-names = "appl", "config", "atu_dma"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + linux,pci-domain = <0>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_0>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_0_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_0>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 72 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <0>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0x82000000 0x0 0x38200000 0x0 0x38200000 0x0 0x01E00000 /* non-prefetchable memory (30MB) */ + 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x4 0x00000000>; /* prefetchable memory (16GB) */ + }; + +Board DTS: + + pcie@14180000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_2>, + <&p2u_3>, + <&p2u_4>, + <&p2u_5>; + phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3"; + };Signature · 1 line
2.7.4
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH V2 10/16] dt-bindings: PCI: tegra: Add device tree support for T194
Quoted 44 lines · Thierry Reding
Quoted 43 lines · Vidya Sagar
Add support for Tegra194 PCIe controllers. These controllers are based on Synopsys DesignWare core IP.
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* Added documentation for 'power-domains' property
* Removed 'window1' and 'window2' properties
* Removed '_clk' and '_rst' from clock and reset names
* Dropped 'pcie' from phy-names
* Added entry for BPMP-FW handle
* Removed offsets for some of the registers and added them in code and would be pickedup based on controller ID
* Changed 'nvidia,max-speed' to 'max-link-speed' and is made as an optional
* Changed 'nvidia,disable-clock-request' to 'supports-clkreq' with inverted operation
* Added more documentation for 'nvidia,update-fc-fixup' property
* Removed 'nvidia,enable-power-down' and 'nvidia,plat-gpios' properties
* Added '-us' to all properties that represent time in microseconds
* Moved P2U documentation to a separate file.../bindings/pci/nvidia,tegra194-pcie.txt | 181 +++++++++++++++++++++ 1 file changed, 181 insertions(+)create mode 100644
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txtDocumentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +13
-0@@ -0,0 +1,181 @@ +NVIDIA Tegra PCIe controller (Synopsys DesignWare Core based) + +This PCIe host controller is based on the Synopsis Designware PCIe IP +and thus inherits all the common properties defined in designware-pcie.txt. + +Required properties: +- compatible: For Tegra19x, must contain "nvidia,tegra194-pcie". +- device_type: Must be "pci" +- power-domains: A phandle to the node that controls power to the respective + PCIe controller and a specifier name for the PCIe controller. Following are + the specifiers for the different PCIe controllers + - Controller-0 - TEGRA194_POWER_DOMAIN_PCIEX8B + - Controller-1 - TEGRA194_POWER_DOMAIN_PCIEX1A
Quoted 8 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 17
Quoted 4 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +4
-0+ - Controller-2 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-3 - TEGRA194_POWER_DOMAIN_PCIEX1A + - Controller-4 - TEGRA194_POWER_DOMAIN_PCIEX4A + - Controller-5 - TEGRA194_POWER_DOMAIN_PCIEX8AI'm not sure if I missed it, but is there an include file that contains definitions for these symbolic names? Might be worth referring to such an include from this document.
These are macros for power domains of different PCIe controller. I'll give the path of header where these macros are defined.
Quoted 4 lines
Also, why do we have two different ways of specifying the controllers? Why are they called Controller-* in one place and PCIEX* in another? Can we just pick one and stick with it?
Since I've been using C0, C1, C2...Etc, I'll stick to it this format and PCIEX* is part of macro name and is used only here.
Quoted 68 lines
Quoted 53 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +52
-0+- reg: A list of physical base address and length for each set of controller + registers. Must contain an entry for each entry in the reg-names property. +- reg-names: Must include the following entries: + "appl": Controller's application logic registers + "config": As per the definition in designware-pcie.txt + "atu_dma": iATU and DMA registers. This is where the iATU (internal Address + Translation Unit) registers of the PCIe core are made available + fow SW access. + "dbi": The aperture where root port's own configuration registers are + available +- interrupts: A list of interrupt outputs of the controller. Must contain an + entry for each entry in the interrupt-names property. +- interrupt-names: Must include the following entries: + "intr": The Tegra interrupt that is asserted for controller interrupts + "msi": The Tegra interrupt that is asserted when an MSI is received +- bus-range: Range of bus numbers associated with this controller +- #address-cells: Address representation for root ports (must be 3) + - cell 0 specifies the bus and device numbers of the root port: + [23:16]: bus number + [15:11]: device number + - cell 1 denotes the upper 32 address bits and should be 0 + - cell 2 contains the lower 32 address bits and is used to translate to the + CPU address space +- #size-cells: Size representation for root ports (must be 2) +- ranges: Describes the translation of addresses for root ports and standard + PCI regions. The entries must be 7 cells each, where the first three cells + correspond to the address as described for the #address-cells property + above, the fourth and fifth cells are for the physical CPU address to + translate to and the sixth and seventh cells are as described for the + #size-cells property above. + - Entries setup the mapping for the standard I/O, memory and + prefetchable PCI regions. The first cell determines the type of region + that is setup: + - 0x81000000: I/O memory region + - 0x82000000: non-prefetchable memory region + - 0xc2000000: prefetchable memory region + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- #interrupt-cells: Size representation for interrupts (must be 1) +- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. +- clock-names: Must include the following entries: + - core +- resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. +- reset-names: Must include the following entries: + - core_apb + - core +- phys: Must contain a phandle to P2U PHY for each entry in phy-names.Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 79
Quoted 10 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+- phy-names: Must include an entry for each active lane. + "p2u-N": where N ranges from 0 to one less than the total number of lanes +- nvidia,bpmp: Must contain a phandle to BPMP controller node. +- nvidia,controller-id : Controller specific ID + 0 - C0 + 1 - C1 + 2 - C2 + 3 - C3 + 4 - C4 + 5 - C5Again, here you use a different name to refer to the controllers than before, although it's fairly obvious that these correspond to the earlier Controller-*. But best to pick one and stick with it.
Quoted 7 lines
Also, the list for the power-domains property has description - value, whereas you have value - description here. Since eventually the device tree bindings will be converted to YAML, perhaps stick with:
value: description
To help with a subsequent conversion.
Done.
Quoted 12 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 89
Quoted 11 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+- vddio-pex-ctl-supply: Regulator supply for PCIe side band signals + +Optional properties: +- max-link-speed: Limits controllers max speed to this value. For more info, + please refer to Documentation/devicetree/bindings/pci/pci.txt file. +- nvidia,init-speed: Limits controllers init speed to this value. + 1 - Gen-1 (2. 5 GT/s) + 2 - Gen-2 (5 GT/s) + 3 - Gen-3 (8 GT/s) + 4 - Gen-4 (16 GT/s)
Quoted 7 lines
Please provide a description for when to use this and what the effects are. "Limits controller's init speed" doesn't say anything about whether the speed can be increased later, or whether it will always stay at this speed. Also, does it actually mean "set" the initial speed, or would the controller also be able to start out at a lower speed than the one given by "nvidia,init-speed"? "Limits" would suggest the latter, but best to clarify.
Ok. I'll provide more details in V3 patch series.
Quoted 108 lines
Quoted 9 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +8
-0+- nvidia,disable-aspm-states : Controls advertisement of ASPM states + bit-0 to '1' : Disables advertisement of ASPM-L0s + bit-1 to '1' : Disables advertisement of ASPM-L1. This also disables + advertisement of ASPM-L1.1 and ASPM-L1.2 + bit-2 to '1' : Disables advertisement of ASPM-L1.1 + bit-3 to '1' : Disables advertisement of ASPM-L1.2 +- supports-clkreq : Refer to Documentation/devicetree/bindings/pci/pci.txt +- nvidia,update-fc-fixup : This is a boolean property and needs to be present toDocumentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt line 107
Quoted 10 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +10
-0+ improve perf when a platform is designed in such a way that it satisfies at + least one of the following conditions thereby enabling root port to + exchange optimum number of FC (Flow Control) credits with downstream devices + 1. If C0/C4/C5 run at x1/x2 link widths (irrespective of speed and MPS) + 2. If C0/C1/C2/C3/C4/C5 operate at their respective max link widths and + a) speed is Gen-2 and MPS is 256B + b) speed is >= Gen-3 with any MPS +- nvidia,cdm-check : Enables CDM checking. For more information, refer Synopsis + DesignWare Cores PCI Express Controller Databook r4.90a Chapter S.4 +- "nvidia,pex-wake" : Add PEX_WAKE gpio number to provide wake support.If it's a GPIO number it should have a -gpio or -gpios suffix. I think -gpios is preferred. Since the parent of the property is already a PEX controller, perhaps omit the pex- prefix and just call this:
"nvidia,wake-gpios"
?Fine. I'll change it to 'nvidia,wake-gpios'.
Thierry
Quoted 77 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt new file +74
-0+- "nvidia,aspm-cmrt-us" : Common Mode Restore time for proper operation of ASPM + to be specified in microseconds +- "nvidia,aspm-pwr-on-t-us" : Power On time for proper operation of ASPM to be + specified in microseconds +- "nvidia,aspm-l0s-entrance-latency-us" : ASPM L0s entrance latency to be + specified in microseconds + +Examples: +========= + +Tegra194: +-------- + +SoC DTSI: + + pcie@14180000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x38040000 0x0 0x00040000>; /* iATU_DMA reg space (256K) */ + reg-names = "appl", "config", "atu_dma"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + linux,pci-domain = <0>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_0>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_0_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_0>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 72 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <0>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0x82000000 0x0 0x38200000 0x0 0x38200000 0x0 0x01E00000 /* non-prefetchable memory (30MB) */ + 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x4 0x00000000>; /* prefetchable memory (16GB) */ + }; + +Board DTS: + + pcie@14180000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_2>, + <&p2u_3>, + <&p2u_4>, + <&p2u_5>; + phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3"; + };Signature · 1 line
2.7.4
PATCH v2 11/16 dt-bindings: PHY: P2U: Add Tegra 194 P2U block
In reply to Vidya SagarAdd support for Tegra194 P2U (PIPE to UPHY) module block which is a glue module instantiated one for each PCIe lane between Synopsys Designware core based PCIe IP and Universal PHY block.
---
Changes since [v1]:
* This is a new patch in v2 series
.../devicetree/bindings/phy/phy-tegra194-p2u.txt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-tegra194-p2u.txt
Documentation/devicetree/bindings/phy/phy-tegra194-p2u.txt new file +28 -0
@@ -0,0 +1,28 @@ +NVIDIA Tegra194 P2U binding + +Tegra194 has two PHY bricks namely HSIO (High Speed IO) and NVHS (NVIDIA High +Speed) each interfacing with 12 and 8 P2U instances respectively. +A P2U instance is a glue logic between Synopsys DesignWare Core PCIe IP's PIPE +interface and PHY of HSIO/NVHS bricks. Each P2U instance represents one PCIe +lane. + +Required properties: +- compatible: For Tegra19x, must contain "nvidia,tegra194-p2u". +- reg: Should be the physical address space and length of respective each P2U + instance. +- reg-names: Must include the entry "ctl". + +Required properties for PHY port node: +- #phy-cells: Defined by generic PHY bindings. Must be 0. + +Refer to phy/phy-bindings.txt for the generic PHY binding properties. + +Example: + +p2u_0: p2u@03e10000 { + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e10000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; +};
Signature · 1 line
2.7.4
PATCH v2 12/16 arm64: tegra: Add P2U and PCIe controller nodes to Tegra194 DT
In reply to Vidya SagarAdd P2U (PIPE to UPHY) and PCIe controller nodes to device tree. The Tegra194 SoC contains six PCIe controllers and twenty P2U instances grouped into two different PHY bricks namely High-Speed IO (HSIO-12 P2Us) and NVIDIA High Speed (NVHS-8 P2Us) respectively.
---
Changes since [v1]:
* Flattened all P2U nodes by removing 'hsio-p2u' and 'nvhs-p2u' super nodes
* Changed P2U nodes compatible string from 'nvidia,tegra194-phy-p2u' to 'nvidia,tegra194-p2u'
* Changed reg-name from 'base' to 'ctl'
* Updated all PCIe nodes according to the changes made to DT documentation file
arch/arm64/boot/dts/nvidia/tegra194.dtsi | 449 +++++++++++++++++++++++++++++++ 1 file changed, 449 insertions(+)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +449 -0
@@ -884,6 +884,166 @@ nvidia,interface = <3>; }; }; + + p2u_0: p2u@03e10000 { /* HSIO-Lane-0 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e10000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_1: p2u@03e20000 { /* HSIO-Lane-1 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e20000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_2: p2u@03e30000 { /* HSIO-Lane-2 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e30000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_3: p2u@03e40000 { /* HSIO-Lane-3 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e40000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_4: p2u@03e50000 { /* HSIO-Lane-4 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e50000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_5: p2u@03e60000 { /* HSIO-Lane-5 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e60000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_6: p2u@03e70000 { /* HSIO-Lane-6 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e70000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_7: p2u@03e80000 { /* HSIO-Lane-7 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e80000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_8: p2u@03e90000 { /* HSIO-Lane-8 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e90000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_9: p2u@03ea0000 { /* HSIO-Lane-9 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03ea0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_12: p2u@03eb0000 { /* NVHS-Lane-0 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03eb0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_13: p2u@03ec0000 { /* NVHS-Lane-1 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03ec0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_14: p2u@03ed0000 { /* NVHS-Lane-2 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03ed0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_15: p2u@03ee0000 { /* NVHS-Lane-3 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03ee0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_16: p2u@03ef0000 { /* NVHS-Lane-4 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03ef0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_17: p2u@03f00000 { /* NVHS-Lane-5 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03f00000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_18: p2u@03f10000 { /* NVHS-Lane-6 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03f10000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_19: p2u@03f20000 { /* NVHS-Lane-7 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03f20000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_10: p2u@03f30000 { /* HSIO-Lane-10 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03f30000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; + + p2u_11: p2u@03f40000 { /* HSIO-Lane-11 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03f40000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; }; sysram@40000000 {
@@ -1054,4 +1214,293 @@ (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; interrupt-parent = <&gic>; }; + + pcie@14180000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x38040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x38080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + num-viewport = <8>; + linux,pci-domain = <0>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_0>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_0_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_0>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 72 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <0>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x1B 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; + + pcie@14100000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14100000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x30000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x30040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x30080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <1>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_1>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_1_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_1>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 45 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <1>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x30100000 0x0 0x30100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0x30000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14120000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14120000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x32000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x32040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x32080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <2>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_2>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_2_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_2>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 47 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <2>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x32100000 0x0 0x32100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0x70000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14140000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14140000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x34000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x34040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x34080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <3>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_3>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_3_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_3>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 49 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <3>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x34100000 0x0 0x34100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0xB0000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14160000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX4A>; + reg = <0x00 0x14160000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x36000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x36040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x36080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <4>; + num-viewport = <8>; + linux,pci-domain = <4>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_4>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_4_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_4>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 51 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <4>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x36100000 0x0 0x36100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x17 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; + + pcie@141a0000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8A>; + reg = <0x00 0x141a0000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x3a000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x3a040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x3a080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + num-viewport = <8>; + linux,pci-domain = <5>; + + clocks = <&bpmp TEGRA194_CLK_PEX1_CORE_5>, + <&bpmp TEGRA194_CLK_PEX1_CORE_5M>; + clock-names = "core", "core_m"; + + resets = <&bpmp TEGRA194_RESET_PEX1_CORE_5_APB>, + <&bpmp TEGRA194_RESET_PEX1_CORE_5>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + nvidia,bpmp = <&bpmp>; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 53 0x04>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <5>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x3a100000 0x0 0x3a100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; };
Signature · 1 line
2.7.4
Re: [PATCH V2 12/16] arm64: tegra: Add P2U and PCIe controller nodes to Tegra194 DT
Quoted 33 lines · Vidya Sagar
Add P2U (PIPE to UPHY) and PCIe controller nodes to device tree. The Tegra194 SoC contains six PCIe controllers and twenty P2U instances grouped into two different PHY bricks namely High-Speed IO (HSIO-12 P2Us) and NVIDIA High Speed (NVHS-8 P2Us) respectively.
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* Flattened all P2U nodes by removing 'hsio-p2u' and 'nvhs-p2u' super nodes
* Changed P2U nodes compatible string from 'nvidia,tegra194-phy-p2u' to 'nvidia,tegra194-p2u'
* Changed reg-name from 'base' to 'ctl'
* Updated all PCIe nodes according to the changes made to DT documentation filearch/arm64/boot/dts/nvidia/tegra194.dtsi | 449 +++++++++++++++++++++++++++++++ 1 file changed, 449 insertions(+)arch/arm64/boot/dts/nvidia/tegra194.dtsi +9
-0@@ -884,6 +884,166 @@ nvidia,interface = <3>; }; }; + + p2u_0: p2u@03e10000 { /* HSIO-Lane-0 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e10000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; +
[...]
arch/arm64/boot/dts/nvidia/tegra194.dtsi line 974
Quoted 7 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +7
-0+ p2u_12: p2u@03eb0000 { /* NVHS-Lane-0 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03eb0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + };
[...]
Do we perhaps want to include the type of P2U in the label? That would make it more obvious which ones to list in the PCIe controller nodes' phys properties. Something like:
p2u_hsio_0: p2u@3e10000 {
...
};
...
p2u_nvhs_0: p2u@3eb0000 {
...
};? Also, make sure to drop the leading 0 from unit-addresses. Recent versions of DTC have checks for that in place and will warn about it in recent Linux builds.
[...]
Quoted 36 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +32
-0@@ -1054,4 +1214,293 @@ (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; interrupt-parent = <&gic>; }; + + pcie@14180000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x38040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x38080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + num-viewport = <8>; + linux,pci-domain = <0>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_0>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_0_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_0>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>;
arch/arm64/boot/dts/nvidia/tegra194.dtsi line 1258
Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +10
-0+ interrupt-map = <0 0 0 0 &gic 0 72 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <0>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>;
Didn't you remove some of these from the bindings?
Thierry
Quoted 251 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +247
-0+ + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x1B 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; + + pcie@14100000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14100000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x30000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x30040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x30080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <1>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_1>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_1_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_1>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 45 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <1>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x30100000 0x0 0x30100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0x30000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14120000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14120000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x32000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x32040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x32080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <2>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_2>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_2_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_2>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 47 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <2>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x32100000 0x0 0x32100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0x70000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14140000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14140000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x34000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x34040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x34080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <3>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_3>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_3_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_3>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 49 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <3>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x34100000 0x0 0x34100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0xB0000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14160000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX4A>; + reg = <0x00 0x14160000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x36000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x36040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x36080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <4>; + num-viewport = <8>; + linux,pci-domain = <4>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_4>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_4_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_4>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 51 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <4>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x36100000 0x0 0x36100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x17 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; + + pcie@141a0000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8A>; + reg = <0x00 0x141a0000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x3a000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x3a040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x3a080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + num-viewport = <8>; + linux,pci-domain = <5>; + + clocks = <&bpmp TEGRA194_CLK_PEX1_CORE_5>, + <&bpmp TEGRA194_CLK_PEX1_CORE_5M>; + clock-names = "core", "core_m"; + + resets = <&bpmp TEGRA194_RESET_PEX1_CORE_5_APB>, + <&bpmp TEGRA194_RESET_PEX1_CORE_5>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + nvidia,bpmp = <&bpmp>; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 53 0x04>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <5>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x3a100000 0x0 0x3a100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; };Signature · 1 line
2.7.4
Re: [PATCH V2 12/16] arm64: tegra: Add P2U and PCIe controller nodes to Tegra194 DT
Quoted 58 lines · Thierry Reding
Quoted 33 lines · Vidya Sagar
Add P2U (PIPE to UPHY) and PCIe controller nodes to device tree. The Tegra194 SoC contains six PCIe controllers and twenty P2U instances grouped into two different PHY bricks namely High-Speed IO (HSIO-12 P2Us) and NVIDIA High Speed (NVHS-8 P2Us) respectively.
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* Flattened all P2U nodes by removing 'hsio-p2u' and 'nvhs-p2u' super nodes
* Changed P2U nodes compatible string from 'nvidia,tegra194-phy-p2u' to 'nvidia,tegra194-p2u'
* Changed reg-name from 'base' to 'ctl'
* Updated all PCIe nodes according to the changes made to DT documentation filearch/arm64/boot/dts/nvidia/tegra194.dtsi | 449 +++++++++++++++++++++++++++++++ 1 file changed, 449 insertions(+)arch/arm64/boot/dts/nvidia/tegra194.dtsi +9
-0@@ -884,6 +884,166 @@ nvidia,interface = <3>; }; }; + + p2u_0: p2u@03e10000 { /* HSIO-Lane-0 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03e10000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + }; +[...]
arch/arm64/boot/dts/nvidia/tegra194.dtsi line 974
Quoted 7 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +7
-0+ p2u_12: p2u@03eb0000 { /* NVHS-Lane-0 */ + compatible = "nvidia,tegra194-p2u"; + reg = <0x03eb0000 0x10000>; + reg-names = "ctl"; + + #phy-cells = <0>; + };[...]
Do we perhaps want to include the type of P2U in the label? That would make it more obvious which ones to list in the PCIe controller nodes' phys properties. Something like:
p2u_hsio_0: p2u@3e10000 { ... }; ... p2u_nvhs_0: p2u@3eb0000 { ... };
Quoted 3 lines
? Also, make sure to drop the leading 0 from unit-addresses. Recent versions of DTC have checks for that in place and will warn about it in recent Linux builds.
Done.
Quoted 42 lines
[...]
Quoted 40 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +36
-0@@ -1054,4 +1214,293 @@ (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; interrupt-parent = <&gic>; }; + + pcie@14180000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x38040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x38080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + num-viewport = <8>; + linux,pci-domain = <0>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_0>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_0_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_0>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 72 0x04>; + + nvidia,bpmp = <&bpmp>; +
Quoted 8 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi line 1258
Quoted 6 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +6
-0+ supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <0>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>;Didn't you remove some of these from the bindings?
I've removed some but what we see here are still present in bindings.
Quoted 254 lines
Thierry
Quoted 251 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +247
-0+ + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x38100000 0x0 0x38100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x18 0x00000000 0x18 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x1B 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; + + pcie@14100000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14100000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x30000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x30040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x30080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <1>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_1>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_1_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_1>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 45 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <1>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x30100000 0x0 0x30100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x00000000 0x12 0x00000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0x30000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14120000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14120000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x32000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x32040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x32080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <2>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_2>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_2_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_2>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 47 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <2>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x32100000 0x0 0x32100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x40000000 0x12 0x40000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0x70000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14140000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX1A>; + reg = <0x00 0x14140000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x34000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x34040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x34080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <1>; + num-viewport = <8>; + linux,pci-domain = <3>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_3>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_3_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_3>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 49 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <3>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x34100000 0x0 0x34100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x12 0x80000000 0x12 0x80000000 0x0 0x30000000 /* prefetchable memory (768MB) */ + 0x82000000 0x0 0x40000000 0x12 0xB0000000 0x0 0x10000000>; /* non-prefetchable memory (256MB) */ + }; + + pcie@14160000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX4A>; + reg = <0x00 0x14160000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x36000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x36040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x36080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <4>; + num-viewport = <8>; + linux,pci-domain = <4>; + + clocks = <&bpmp TEGRA194_CLK_PEX0_CORE_4>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX0_CORE_4_APB>, + <&bpmp TEGRA194_RESET_PEX0_CORE_4>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 51 0x04>; + + nvidia,bpmp = <&bpmp>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <4>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x36100000 0x0 0x36100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x14 0x00000000 0x14 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x17 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; + + pcie@141a0000 { + compatible = "nvidia,tegra194-pcie", "snps,dw-pcie"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8A>; + reg = <0x00 0x141a0000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x3a000000 0x0 0x00040000 /* configuration space (256K) */ + 0x00 0x3a040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x3a080000 0x0 0x00040000>; /* DBI reg space (256K) */ + reg-names = "appl", "config", "atu_dma", "dbi"; + + status = "disabled"; + + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + num-lanes = <8>; + num-viewport = <8>; + linux,pci-domain = <5>; + + clocks = <&bpmp TEGRA194_CLK_PEX1_CORE_5>, + <&bpmp TEGRA194_CLK_PEX1_CORE_5M>; + clock-names = "core", "core_m"; + + resets = <&bpmp TEGRA194_RESET_PEX1_CORE_5_APB>, + <&bpmp TEGRA194_RESET_PEX1_CORE_5>; + reset-names = "core_apb", "core"; + + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */ + <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ + interrupt-names = "intr", "msi"; + + nvidia,bpmp = <&bpmp>; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &gic 0 53 0x04>; + + supports-clkreq; + nvidia,disable-aspm-states = <0xf>; + nvidia,controller-id = <5>; + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + bus-range = <0x0 0xff>; + ranges = <0x81000000 0x0 0x3a100000 0x0 0x3a100000 0x0 0x00100000 /* downstream I/O (1MB) */ + 0xc2000000 0x1c 0x00000000 0x1c 0x00000000 0x3 0x40000000 /* prefetchable memory (13GB) */ + 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xC0000000>; /* non-prefetchable memory (3GB) */ + }; };Signature · 1 line
2.7.4
PATCH v2 13/16 arm64: tegra: Enable PCIe slots in P2972-0000 board
In reply to Vidya SagarEnable PCIe controller nodes to enable respective PCIe slots on P2972-0000 board. Following is the ownership of slots by different PCIe controllers.
Controller-0 : M.2 Key-M slot
Controller-1 : On-board Marvell eSATA controller Controller-3 : M.2 Key-E slot
---
Changes since [v1]:
* Dropped 'pcie-' from phy-names property strings
arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi +1 -1
@@ -191,7 +191,7 @@ regulator-boot-on; }; - sd3 { + vdd_1v8ao: sd3 { regulator-name = "VDD_1V8AO"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +50 -0
54 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH V2 13/16] arm64: tegra: Enable PCIe slots in P2972-0000 board
Quoted 37 lines · Vidya Sagar
Enable PCIe controller nodes to enable respective PCIe slots on P2972-0000 board. Following is the ownership of slots by different PCIe controllers.
Controller-0 : M.2 Key-M slot
Controller-1 : On-board Marvell eSATA controller Controller-3 : M.2 Key-E slotSigned-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* Dropped 'pcie-' from phy-names property stringsarch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-)arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi +1
-1@@ -191,7 +191,7 @@ regulator-boot-on; }; - sd3 { + vdd_1v8ao: sd3 { regulator-name = "VDD_1V8AO"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +0
-0@@ -169,4 +169,54 @@ }; }; };
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts line 181
Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +10
-0+ + pcie@14180000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_2>, + <&p2u_3>, + <&p2u_4>, + <&p2u_5>;
You can use multiple entries on a single line, especially if they are this short.
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts line 183
Quoted 2 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +2
-0+ phy-names = "p2u-0", "p2u-1", "p2u-2", + "p2u-3";
Same here.
Quoted 27 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +27
-0+ }; + + pcie@14100000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_0>; + phy-names = "p2u-0"; + }; + + pcie@14140000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_7>; + phy-names = "p2u-0"; + }; + + pcie@141a0000 { + status = "disabled"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_12>, + <&p2u_13>,
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts line 220
Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +10
-0+ <&p2u_14>, + <&p2u_15>, + <&p2u_16>, + <&p2u_17>, + <&p2u_18>, + <&p2u_19>; + + phy-names = "p2u-0", "p2u-1", "p2u-2", + "p2u-3", "p2u-4", "p2u-5", + "p2u-6", "p2u-7";
And here.
Thierry
Quoted 5 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +1
-0+ }; };Signature · 1 line
2.7.4
Re: [PATCH V2 13/16] arm64: tegra: Enable PCIe slots in P2972-0000 board
Quoted 88 lines · Thierry Reding
Quoted 37 lines · Vidya Sagar
Enable PCIe controller nodes to enable respective PCIe slots on P2972-0000 board. Following is the ownership of slots by different PCIe controllers.
Controller-0 : M.2 Key-M slot
Controller-1 : On-board Marvell eSATA controller Controller-3 : M.2 Key-E slotSigned-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* Dropped 'pcie-' from phy-names property stringsarch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 50 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-)arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi +1
-1@@ -191,7 +191,7 @@ regulator-boot-on; }; - sd3 { + vdd_1v8ao: sd3 { regulator-name = "VDD_1V8AO"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +0
-0@@ -169,4 +169,54 @@ }; }; };arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts line 181
Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +10
-0+ + pcie@14180000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_2>, + <&p2u_3>, + <&p2u_4>, + <&p2u_5>;You can use multiple entries on a single line, especially if they are this short.
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts line 183
Quoted 2 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +2
-0+ phy-names = "p2u-0", "p2u-1", "p2u-2", + "p2u-3";Same here.
Quoted 31 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +31
-0+ }; + + pcie@14100000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_0>; + phy-names = "p2u-0"; + }; + + pcie@14140000 { + status = "okay"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_7>; + phy-names = "p2u-0"; + }; + + pcie@141a0000 { + status = "disabled"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + phys = <&p2u_12>, + <&p2u_13>, + <&p2u_14>, + <&p2u_15>, + <&p2u_16>, + <&p2u_17>,
Quoted 8 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts line 220
Quoted 6 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +6
-0+ <&p2u_18>, + <&p2u_19>; + + phy-names = "p2u-0", "p2u-1", "p2u-2", + "p2u-3", "p2u-4", "p2u-5", + "p2u-6", "p2u-7";And here.
I'll take care of all these in V3 series.
Quoted 8 lines
Thierry
Quoted 5 lines
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +1
-0+ }; };Signature · 1 line
2.7.4
PATCH v2 14/16 phy: tegra: Add PCIe PIPE2UPHY support
In reply to Vidya SagarSynopsys DesignWare core based PCIe controllers in Tegra 194 SoC interface with Universal PHY (UPHY) module through a PIPE2UPHY (P2U) module. For each PCIe lane of a controller, there is a P2U unit instantiated at hardware level. This driver provides support for the programming required for each P2U that is going to be used for a PCIe controller.
---
Changes since [v1]:
* Added COMPILE_TEST in Kconfig
* Removed empty phy_ops implementations
* Modified code according to DT documentation file modifications
drivers/phy/tegra/Kconfig | 7 ++ drivers/phy/tegra/Makefile | 1 + drivers/phy/tegra/pcie-p2u-tegra194.c | 120 ++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 drivers/phy/tegra/pcie-p2u-tegra194.c
drivers/phy/tegra/Kconfig +7 -0
@@ -6,3 +6,10 @@ config PHY_TEGRA_XUSB To compile this driver as a module, choose M here: the module will be called phy-tegra-xusb. + +config PHY_TEGRA194_PCIE_P2U + tristate "NVIDIA Tegra P2U PHY Driver" + depends on ARCH_TEGRA || COMPILE_TEST + select GENERIC_PHY + help + Enable this to support the P2U (PIPE to UPHY) that is part of Tegra 19x SOCs.
drivers/phy/tegra/Makefile +1 -0
@@ -4,3 +4,4 @@ phy-tegra-xusb-y += xusb.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_124_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_132_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_210_SOC) += xusb-tegra210.o +obj-$(CONFIG_PHY_TEGRA194_PCIE_P2U) += pcie-p2u-tegra194.o
drivers/phy/tegra/pcie-p2u-tegra194.c new file +120 -0
120 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH V2 14/16] phy: tegra: Add PCIe PIPE2UPHY support
Quoted 24 lines · Vidya Sagar
Synopsys DesignWare core based PCIe controllers in Tegra 194 SoC interface with Universal PHY (UPHY) module through a PIPE2UPHY (P2U) module. For each PCIe lane of a controller, there is a P2U unit instantiated at hardware level. This driver provides support for the programming required for each P2U that is going to be used for a PCIe controller.
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* AddedCOMPILE_TESTinKconfig
* Removed emptyphy_opsimplementations
* Modified code according to DT documentation file modificationsdrivers/phy/tegra/Kconfig | 7 ++ drivers/phy/tegra/Makefile | 1 + drivers/phy/tegra/pcie-p2u-tegra194.c | 120 ++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 drivers/phy/tegra/pcie-p2u-tegra194.cdrivers/phy/tegra/Kconfig +0
-0
drivers/phy/tegra/Kconfig config PHY_TEGRA_XUSB · line 15
Quoted 10 lines
drivers/phy/tegra/Kconfig +7
-0@@ -6,3 +6,10 @@ config PHY_TEGRA_XUSB To compile this driver as a module, choose M here: the module will be called phy-tegra-xusb. + +config PHY_TEGRA194_PCIE_P2U + tristate "NVIDIA Tegra P2U PHY Driver" + depends on ARCH_TEGRA || COMPILE_TEST + select GENERIC_PHY + help + Enable this to support the P2U (PIPE to UPHY) that is part of Tegra 19x SOCs.
This should be using tabs for indentation.
Quoted 24 lines
drivers/phy/tegra/Makefile +1
-0@@ -4,3 +4,4 @@ phy-tegra-xusb-y += xusb.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_124_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_132_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_210_SOC) += xusb-tegra210.o +obj-$(CONFIG_PHY_TEGRA194_PCIE_P2U) += pcie-p2u-tegra194.odrivers/phy/tegra/pcie-p2u-tegra194.c new file +9
-0@@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* P2U (PIPE to UPHY) driver for Tegra T194 SoC +* +* Copyright (C) 2019 NVIDIA Corporation. +* +* Author: Vidya Sagar <[email protected]> +*/ +
drivers/phy/tegra/pcie-p2u-tegra194.c line 19
Quoted 10 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +10
-0+#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/phy/phy.h> +#include <linux/of.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/interrupt.h> +#include <linux/delay.h> +#include <linux/of_platform.h> +#include <soc/tegra/bpmp-abi.h>
It's a good idea to keep these sorted alphabetically. That makes it a lot easier to insert new ones in the right place subsequently.
drivers/phy/tegra/pcie-p2u-tegra194.c line 28
Quoted 9 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +9
-0+ +#define P2U_PERIODIC_EQ_CTRL_GEN3 0xc0 +#define P2U_PERIODIC_EQ_CTRL_GEN3_PERIODIC_EQ_EN BIT(0) +#define P2U_PERIODIC_EQ_CTRL_GEN3_INIT_PRESET_EQ_TRAIN_EN BIT(1) +#define P2U_PERIODIC_EQ_CTRL_GEN4 0xc4 +#define P2U_PERIODIC_EQ_CTRL_GEN4_INIT_PRESET_EQ_TRAIN_EN BIT(1) + +#define P2U_RX_DEBOUNCE_TIME 0xa4 +#define P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_MASK 0xFFFF
Use consistent case for hexadecimal. All other register definitions use lower-case, so this one should, too.
drivers/phy/tegra/pcie-p2u-tegra194.c line 32
Quoted 4 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +4
-0+#define P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_VAL 160 + +struct tegra_p2u { +void __iomem *base;
I personally wouldn't bother with the extra padding. A single space is enough and avoid extra churn if you ever add something here that doesn't fit into the existing padding space.
drivers/phy/tegra/pcie-p2u-tegra194.c line 38
Quoted 6 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +6
-0+}; + +static int tegra_p2u_power_on (struct phy *x) +{ +u32 val; +struct tegra_p2u *phy =phy_get_drvdata (x);
It's often common to structure these as "reverse christmas tree" so that the longest lines go first, followed by shorter lines. Not sure if Kishon cares, though.
Quoted 49 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +49
-0+ + val =readl (phy->base +P2U_PERIODIC_EQ_CTRL_GEN3 ); + val &= ~P2U_PERIODIC_EQ_CTRL_GEN3_PERIODIC_EQ_EN ; + val |=P2U_PERIODIC_EQ_CTRL_GEN3_INIT_PRESET_EQ_TRAIN_EN ; +writel (val, phy->base +P2U_PERIODIC_EQ_CTRL_GEN3 ); + + val =readl (phy->base +P2U_PERIODIC_EQ_CTRL_GEN4 ); + val |=P2U_PERIODIC_EQ_CTRL_GEN4_INIT_PRESET_EQ_TRAIN_EN ; +writel (val, phy->base +P2U_PERIODIC_EQ_CTRL_GEN4 ); + + val =readl (phy->base +P2U_RX_DEBOUNCE_TIME ); + val &= ~P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_MASK ; + val |=P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_VAL ; +writel (val, phy->base +P2U_RX_DEBOUNCE_TIME ); + +return 0 ; +} + +static const struct phy_ops ops = { + .power_on = tegra_p2u_power_on, + .owner =THIS_MODULE , +}; + +static int tegra_p2u_probe (struct platform_device *pdev) +{ +struct tegra_p2u *phy; +struct phy *generic_phy; +struct phy_provider *phy_provider; +struct device *dev = &pdev->dev; +struct resource *res; + + phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL ); +if (!phy) +return -ENOMEM ; + + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"ctl" ); + phy->base =devm_ioremap_resource (dev, res); +if (IS_ERR (phy->base)) +return PTR_ERR_OR_ZERO (phy->base); + +platform_set_drvdata (pdev, phy); + + generic_phy =devm_phy_create (dev,NULL , &ops); +if (IS_ERR (generic_phy)) +return PTR_ERR_OR_ZERO (generic_phy); + +phy_set_drvdata (generic_phy, phy); + + phy_provider =devm_of_phy_provider_register (dev, of_phy_simple_xlate);
drivers/phy/tegra/pcie-p2u-tegra194.c line 97
Quoted 10 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +10
-0+if (IS_ERR (phy_provider)) +return PTR_ERR_OR_ZERO (phy_provider); + +return 0 ; +} + +static int tegra_p2u_remove (struct platform_device *pdev) +{ +return 0 ; +}
I think you can drop this.
Quoted 12 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +12
-0+ +static const struct of_device_id tegra_p2u_id_table[] = { + { + .compatible ="nvidia,tegra194-p2u" , + }, + {} +}; +MODULE_DEVICE_TABLE (of, tegra_p2u_id_table); + +static struct platform_driver tegra_p2u_driver = { + .probe = tegra_p2u_probe, + .remove = tegra_p2u_remove,
drivers/phy/tegra/pcie-p2u-tegra194.c line 119
Quoted 10 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +10
-0+ .driver = { + .name = "tegra194-p2u", + .of_match_table = tegra_p2u_id_table, + }, +}; + +module_platform_driver (tegra_p2u_driver); + +MODULE_AUTHOR ("Vidya Sagar <[email protected]>" ); +MODULE_DESCRIPTION ("NVIDIA Tegra PIPE_To_UPHY phy driver" );
The driver description is somewhat odd here. Perhaps something like:
"NVIDIA Tegra PIPE to UPHY PHY driver"
?
Thierry
Quoted 4 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +1
-0+MODULE_LICENSE ("GPL v2" );Signature · 1 line
2.7.4
Re: [PATCH V2 14/16] phy: tegra: Add PCIe PIPE2UPHY support
Quoted 1 line · Thierry Reding
On Fri, Apr 05, 2019 at 01:24:41AM +0530, Vidya Sagar wrote:
[...]
Quoted 5 lines
Quoted 5 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +0
-0
[...]
Quoted 8 lines
drivers/phy/tegra/pcie-p2u-tegra194.c line 119
Quoted 2 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +2
-0+MODULE_AUTHOR ("Vidya Sagar <[email protected]>" ); +MODULE_DESCRIPTION ("NVIDIA Tegra PIPE_To_UPHY phy driver" );The driver description is somewhat odd here. Perhaps something like:
"NVIDIA Tegra PIPE to UPHY PHY driver"
?
Or perhaps just
"NVIDIA Tegra PIPE2UPHY PHY driver"
which is what you already use in the commit subject.
Thierry
Re: [PATCH V2 14/16] phy: tegra: Add PCIe PIPE2UPHY support
In reply to Thierry RedingQuoted 26 lines · Thierry Reding
Quoted 25 lines · Vidya Sagar
Synopsys DesignWare core based PCIe controllers in Tegra 194 SoC interface with Universal PHY (UPHY) module through a PIPE2UPHY (P2U) module. For each PCIe lane of a controller, there is a P2U unit instantiated at hardware level. This driver provides support for the programming required for each P2U that is going to be used for a PCIe controller.
Signed-off-by Vidya Sagar <[email protected]>---
Changes since [v1]:
* AddedCOMPILE_TESTinKconfig
* Removed emptyphy_opsimplementations
* Modified code according to DT documentation file modificationsdrivers/phy/tegra/Kconfig | 7 ++ drivers/phy/tegra/Makefile | 1 + drivers/phy/tegra/pcie-p2u-tegra194.c | 120 ++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+)create mode 100644
drivers/phy/tegra/pcie-p2u-tegra194.cdrivers/phy/tegra/Kconfig +0
-0@@ -6,3 +6,10 @@ config PHY_TEGRA_XUSB
Quoted 11 lines
drivers/phy/tegra/Kconfig config PHY_TEGRA_XUSB · line 15
Quoted 9 lines
drivers/phy/tegra/Kconfig +7
-0To compile this driver as a module, choose M here: the module will be called phy-tegra-xusb. + +config PHY_TEGRA194_PCIE_P2U + tristate "NVIDIA Tegra P2U PHY Driver" + depends on ARCH_TEGRA || COMPILE_TEST + select GENERIC_PHY + help + Enable this to support the P2U (PIPE to UPHY) that is part of Tegra 19x SOCs.This should be using tabs for indentation.
Done.
Quoted 30 lines
Quoted 30 lines
drivers/phy/tegra/Makefile +1
-0@@ -4,3 +4,4 @@ phy-tegra-xusb-y += xusb.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_124_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_132_SOC) += xusb-tegra124.o phy-tegra-xusb-$(CONFIG_ARCH_TEGRA_210_SOC) += xusb-tegra210.o +obj-$(CONFIG_PHY_TEGRA194_PCIE_P2U) += pcie-p2u-tegra194.odrivers/phy/tegra/pcie-p2u-tegra194.c new file +14
-0@@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* P2U (PIPE to UPHY) driver for Tegra T194 SoC +* +* Copyright (C) 2019 NVIDIA Corporation. +* +* Author: Vidya Sagar <[email protected]> +*/ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/phy/phy.h> +#include <linux/of.h> +#include <linux/err.h>
Quoted 8 lines
drivers/phy/tegra/pcie-p2u-tegra194.c line 19
Quoted 5 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +5
-0+#include <linux/io.h> +#include <linux/interrupt.h> +#include <linux/delay.h> +#include <linux/of_platform.h> +#include <soc/tegra/bpmp-abi.h> It's a good idea to keep these sorted alphabetically. That makes it a lot easier to insert new ones in the right place subsequently.
Done.
Quoted 14 lines
drivers/phy/tegra/pcie-p2u-tegra194.c line 28
Quoted 10 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +9
-0+ +#define P2U_PERIODIC_EQ_CTRL_GEN3 0xc0 +#define P2U_PERIODIC_EQ_CTRL_GEN3_PERIODIC_EQ_EN BIT(0) +#define P2U_PERIODIC_EQ_CTRL_GEN3_INIT_PRESET_EQ_TRAIN_EN BIT(1) +#define P2U_PERIODIC_EQ_CTRL_GEN4 0xc4 +#define P2U_PERIODIC_EQ_CTRL_GEN4_INIT_PRESET_EQ_TRAIN_EN BIT(1) + +#define P2U_RX_DEBOUNCE_TIME 0xa4 +#define P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_MASK 0xFFFFUse consistent case for hexadecimal. All other register definitions use lower-case, so this one should, too.
Quoted 8 lines
drivers/phy/tegra/pcie-p2u-tegra194.c line 32
Quoted 4 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +4
-0+#define P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_VAL 160 + +struct tegra_p2u { +void __iomem *base;I personally wouldn't bother with the extra padding. A single space is enough and avoid extra churn if you ever add something here that doesn't fit into the existing padding space.
Done.
Quoted 11 lines
drivers/phy/tegra/pcie-p2u-tegra194.c line 38
Quoted 7 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +6
-0+}; + +static int tegra_p2u_power_on (struct phy *x) +{ +u32 val; +struct tegra_p2u *phy =phy_get_drvdata (x);It's often common to structure these as "reverse christmas tree" so that the longest lines go first, followed by shorter lines. Not sure if Kishon cares, though.
Done. Took care of this in pcie-tegra194.c as well.
Quoted 54 lines
Quoted 54 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +53
-0+ + val =readl (phy->base +P2U_PERIODIC_EQ_CTRL_GEN3 ); + val &= ~P2U_PERIODIC_EQ_CTRL_GEN3_PERIODIC_EQ_EN ; + val |=P2U_PERIODIC_EQ_CTRL_GEN3_INIT_PRESET_EQ_TRAIN_EN ; +writel (val, phy->base +P2U_PERIODIC_EQ_CTRL_GEN3 ); + + val =readl (phy->base +P2U_PERIODIC_EQ_CTRL_GEN4 ); + val |=P2U_PERIODIC_EQ_CTRL_GEN4_INIT_PRESET_EQ_TRAIN_EN ; +writel (val, phy->base +P2U_PERIODIC_EQ_CTRL_GEN4 ); + + val =readl (phy->base +P2U_RX_DEBOUNCE_TIME ); + val &= ~P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_MASK ; + val |=P2U_RX_DEBOUNCE_TIME_DEBOUNCE_TIMER_VAL ; +writel (val, phy->base +P2U_RX_DEBOUNCE_TIME ); + +return 0 ; +} + +static const struct phy_ops ops = { + .power_on = tegra_p2u_power_on, + .owner =THIS_MODULE , +}; + +static int tegra_p2u_probe (struct platform_device *pdev) +{ +struct tegra_p2u *phy; +struct phy *generic_phy; +struct phy_provider *phy_provider; +struct device *dev = &pdev->dev; +struct resource *res; + + phy =devm_kzalloc (dev,sizeof (*phy),GFP_KERNEL ); +if (!phy) +return -ENOMEM ; + + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"ctl" ); + phy->base =devm_ioremap_resource (dev, res); +if (IS_ERR (phy->base)) +return PTR_ERR_OR_ZERO (phy->base); + +platform_set_drvdata (pdev, phy); + + generic_phy =devm_phy_create (dev,NULL , &ops); +if (IS_ERR (generic_phy)) +return PTR_ERR_OR_ZERO (generic_phy); + +phy_set_drvdata (generic_phy, phy); + + phy_provider =devm_of_phy_provider_register (dev, of_phy_simple_xlate); +if (IS_ERR (phy_provider)) +return PTR_ERR_OR_ZERO (phy_provider); + +return 0 ;
Quoted 8 lines
drivers/phy/tegra/pcie-p2u-tegra194.c line 97
Quoted 6 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +6
-0+} + +static int tegra_p2u_remove (struct platform_device *pdev) +{ +return 0 ; +}I think you can drop this.
I want to make this as a loadable module hence i kep t .remove() implementation.
Quoted 26 lines
Quoted 13 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +12
-0+ +static const struct of_device_id tegra_p2u_id_table[] = { + { + .compatible ="nvidia,tegra194-p2u" , + }, + {} +}; +MODULE_DEVICE_TABLE (of, tegra_p2u_id_table); + +static struct platform_driver tegra_p2u_driver = { + .probe = tegra_p2u_probe, + .remove = tegra_p2u_remove,drivers/phy/tegra/pcie-p2u-tegra194.c line 119
Quoted 10 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +10
-0+ .driver = { + .name = "tegra194-p2u", + .of_match_table = tegra_p2u_id_table, + }, +}; + +module_platform_driver (tegra_p2u_driver); + +MODULE_AUTHOR ("Vidya Sagar <[email protected]>" ); +MODULE_DESCRIPTION ("NVIDIA Tegra PIPE_To_UPHY phy driver" );The driver description is somewhat odd here. Perhaps something like:
Quoted 3 lines
"NVIDIA Tegra PIPE to UPHY PHY driver"
?
Done.
Quoted 7 lines
Thierry
Quoted 4 lines
drivers/phy/tegra/pcie-p2u-tegra194.c new file +1
-0+MODULE_LICENSE ("GPL v2" );Signature · 1 line
2.7.4
PATCH v2 15/16 PCI: tegra: Add Tegra194 PCIe support
In reply to Vidya SagarAdd support for Synopsys DesignWare core IP based PCIe host controller present in Tegra194 SoC.
---
Changes since [v1]:
* Made CONFIG_PCIE_TEGRA194 as 'm' by default from its previous 'y' state
* Modified code as per changes made to DT documentation
* Refactored code to address Bjorn & Thierry's review comments
* Added goto to avoid recursion in tegra_pcie_dw_host_init() API
* Merged .scan_bus() of dw_pcie_host_ops implementation to tegra_pcie_dw_host_init() API
drivers/pci/controller/dwc/Kconfig | 11 + drivers/pci/controller/dwc/Makefile | 1 + drivers/pci/controller/dwc/pcie-tegra194.c | 1760 ++++++++++++++++++++++++++++ 3 files changed, 1772 insertions(+) create mode 100644 drivers/pci/controller/dwc/pcie-tegra194.c
drivers/pci/controller/dwc/Kconfig +11 -0
@@ -213,4 +213,15 @@ config PCIE_UNIPHIER Say Y here if you want PCIe controller support on UniPhier SoCs. This driver supports LD20 and PXs3 SoCs. +config PCIE_TEGRA194 + tristate "NVIDIA Tegra (T194) PCIe controller" + depends on TEGRA_BPMP && (ARCH_TEGRA || COMPILE_TEST) + depends on PCI_MSI_IRQ_DOMAIN + select PCIE_DW_HOST + select PHY_TEGRA194_PCIE_P2U + default m + help + Say Y here if you want support for DesignWare core based PCIe host + controller found in NVIDIA Tegra T194 SoC. + endmenu
drivers/pci/controller/dwc/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_PCIE_KIRIN) += pcie-kirin.o obj-$(CONFIG_PCIE_HISI_STB) += pcie-histb.o obj-$(CONFIG_PCI_MESON) += pci-meson.o obj-$(CONFIG_PCIE_UNIPHIER) += pcie-uniphier.o +obj-$(CONFIG_PCIE_TEGRA194) += pcie-tegra194.o # The following drivers are for devices that use the generic ACPI # pci_root.c driver but don't support standard ECAM config access.
drivers/pci/controller/dwc/pcie-tegra194.c new file +1760 -0
1,760 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 16/16 arm64: Add Tegra194 PCIe driver to defconfig
In reply to Vidya SagarAdd PCIe host controller driver for DesignWare core based PCIe controller IP present in Tegra194.
---
Changes since [v1]:
* Changed CONFIG_PCIE_TEGRA194 from 'y' to 'm'
arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -87,6 +87,7 @@ CONFIG_PCIE_QCOM=y CONFIG_PCIE_ARMADA_8K=y CONFIG_PCIE_KIRIN=y CONFIG_PCIE_HISI_STB=y +CONFIG_PCIE_TEGRA194=m CONFIG_ARM64_VA_BITS_48=y CONFIG_SCHED_MC=y CONFIG_NUMA=y
Signature · 1 line
2.7.4