Add support for PCIe endpoint mode in Tegra194
Subsystems (5)
v2 cover Add support for PCIe endpoint mode in Tegra194
Tegra194 has three (C0, C4 & C5) dual mode PCIe controllers that can operate either in root port mode or in end point mode but only in one mode at a time. Platform P2972-0000 supports enabling endpoint mode for C5 controller. This patch series adds support for PCIe endpoint mode in both the driver as well as in DT.
This patch series depends on the changes made for Synopsys DesignWare endpoint mode subsystem that are currently under review
@ https://patchwork.kernel.org/project/linux-pci/list/?series=202211
which in turn depends on the patch made by Kishon
@ https://patchwork.kernel.org/patch/10975123/
which is also under review.
V2:
* Addressed Thierry & Bjorn's review comments
* Added EP mode specific binding documentation to already existing binding documentation file
* Removed patch that enables GPIO controller nodes explicitly as they are enabled already
Vidya Sagar (5):
soc/tegra: bpmp: Update ABI header
dt-bindings: PCI: tegra: Add DT support for PCIe EP nodes in Tegra194
PCI: tegra: Add support for PCIe endpoint mode in Tegra194
arm64: tegra: Add PCIe endpoint controllers nodes for Tegra194
arm64: tegra: Add support for PCIe endpoint mode in P2972-0000
platform
.../bindings/pci/nvidia,tegra194-pcie.txt | 125 ++- .../boot/dts/nvidia/tegra194-p2972-0000.dts | 18 + arch/arm64/boot/dts/nvidia/tegra194.dtsi | 99 +++ drivers/pci/controller/dwc/Kconfig | 30 +- drivers/pci/controller/dwc/pcie-tegra194.c | 782 +++++++++++++++++- include/soc/tegra/bpmp-abi.h | 10 +- 6 files changed, 1021 insertions(+), 43 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/5 soc/tegra: bpmp: Update ABI header
Update the firmware header to support uninitialization of UPHY PLL when the PCIe controller is operating in endpoint mode and host cuts the PCIe reference clock.
---
V2:
* Changed Copyright year from 2019 to 2020
include/soc/tegra/bpmp-abi.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
include/soc/tegra/bpmp-abi.h +9 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0-only */ /* -* Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. */ #ifndef _ABI_BPMP_ABI_H_
@@ -2119,6 +2119,7 @@ enum {CMD_UPHY_PCIE_LANE_MARGIN_STATUS =2 ,CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT =3 ,CMD_UPHY_PCIE_CONTROLLER_STATE =4 , +CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF =5 , CMD_UPHY_MAX, };
@@ -2151,6 +2152,11 @@ struct cmd_uphy_pcie_controller_state_request {uint8_t enable; } __ABI_PACKED; +struct cmd_uphy_ep_controller_pll_off_request { +/** @brief EP controller number, valid: 0, 4, 5 */ +uint8_t ep_controller; +} __ABI_PACKED; +/** * @ingroup UPHY * @brief Request with #MRQ_UPHY
@@ -2165,6 +2171,7 @@ struct cmd_uphy_pcie_controller_state_request {* |CMD_UPHY_PCIE_LANE_MARGIN_STATUS | | * |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_INIT |cmd_uphy_ep_controller_pll_init_request | * |CMD_UPHY_PCIE_CONTROLLER_STATE |cmd_uphy_pcie_controller_state_request | +* |CMD_UPHY_PCIE_EP_CONTROLLER_PLL_OFF |cmd_uphy_ep_controller_pll_off_request | * */
@@ -2178,6 +2185,7 @@ struct mrq_uphy_request {struct cmd_uphy_margin_control_request uphy_set_margin_control;struct cmd_uphy_ep_controller_pll_init_request ep_ctrlr_pll_init;struct cmd_uphy_pcie_controller_state_request controller_state; +struct cmd_uphy_ep_controller_pll_off_request ep_ctrlr_pll_off; } __UNION_ANON; } __ABI_PACKED;
Signature · 1 line
2.17.1
Re: [PATCH V2 1/5] soc/tegra: bpmp: Update ABI header
Quoted 11 lines · Vidya Sagar
Update the firmware header to support uninitialization of UPHY PLL when the PCIe controller is operating in endpoint mode and host cuts the PCIe reference clock.
Signed-off-by Vidya Sagar <[email protected]>---
V2:
* Changed Copyright year from 2019 to 2020include/soc/tegra/bpmp-abi.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
Bjorn, Lorenzo,
subsequent patches in this series depend on this patch, so I think it'd be best if you took this into the PCI tree along with the DT bindings and the PCI driver changes, so:
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 2/5 dt-bindings: PCI: tegra: Add DT support for PCIe EP nodes in Tegra194
In reply to Vidya SagarAdd support for PCIe controllers that can operate in endpoint mode in Tegra194.
---
V2:
* Addressed Thierry's review comments
* Merged EP specific information from tegra194-pcie-ep.txt to tegra194-pcie.txt itself
* Started using the standard 'reset-gpios' for PERST GPIO
* Added 'nvidia,refclk-select-gpios' to enable REFCLK signals
.../bindings/pci/nvidia,tegra194-pcie.txt | 125 ++++++++++++++---- 1 file changed, 99 insertions(+), 26 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.txt +99 -26
@@ -1,11 +1,11 @@ NVIDIA Tegra PCIe controller (Synopsys DesignWare Core based) -This PCIe host controller is based on the Synopsis Designware PCIe IP +This PCIe controller is based on the Synopsis Designware PCIe IP and thus inherits all the common properties defined in designware-pcie.txt. +Some of the controller instances are dual mode where in they can work either +in root port mode or endpoint mode but one at a time. 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
@@ -32,6 +32,32 @@ Required properties: 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 +- 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: + - 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 pair of phandle to BPMP controller node followed + by controller-id. Following are the controller ids for each controller. + 0: C0 + 1: C1 + 2: C2 + 3: C3 + 4: C4 + 5: C5 +- vddio-pex-ctl-supply: Regulator supply for PCIe side band signals + +RC mode: +- compatible: Tegra19x must contain "nvidia,tegra194-pcie" +- device_type: Must be "pci" for RC mode +- interrupt-names: Must include the following entries: "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)
@@ -60,27 +86,15 @@ Required properties: - 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: - - 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 pair of phandle to BPMP controller node followed - by controller-id. Following are the controller ids for each controller. - 0: C0 - 1: C1 - 2: C2 - 3: C3 - 4: C4 - 5: C5 -- vddio-pex-ctl-supply: Regulator supply for PCIe side band signals + +EP mode: +In Tegra194, Only controllers C0, C4 & C5 support EP mode. +- compatible: Tegra19x must contain "nvidia,tegra194-pcie-ep" +- reg-names: Must include the following entries: + "addr_space": Used to map remote RC address space +- reset-gpios: Must contain a phandle to a GPIO controller followed by + GPIO that is being used as PERST input signal. Please refer to pci.txt + document. Optional properties: - pinctrl-names: A list of pinctrl state names.
@@ -104,6 +118,8 @@ Optional properties: specified in microseconds - nvidia,aspm-l0s-entrance-latency-us: ASPM L0s entrance latency to be specified in microseconds + +RC mode: - vpcie3v3-supply: A phandle to the regulator node that supplies 3.3V to the slot if the platform has one such slot. (Ex:- x16 slot owned by C5 controller in p2972-0000 platform).
@@ -111,11 +127,18 @@ Optional properties: if the platform has one such slot. (Ex:- x16 slot owned by C5 controller in p2972-0000 platform). +EP mode: +- nvidia,refclk-select-gpios: Must contain a phandle to a GPIO controller + followed by GPIO that is being used to enable REFCLK to controller from host + +NOTE:- On Tegra194's P2972-0000 platform, only C5 controller can be enabled to +operate in the endpoint mode because of the way the platform is designed. + Examples: ========= -Tegra194: --------- +Tegra194 RC mode: +----------------- pcie@14180000 { compatible = "nvidia,tegra194-pcie", "snps,dw-pcie";
@@ -169,3 +192,53 @@ Tegra194: <&p2u_hsio_5>; phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3"; }; + +Tegra194 EP mode: +----------------- + + pcie_ep@141a0000 { + compatible = "nvidia,tegra194-pcie-ep", "snps,dw-pcie-ep"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8A>; + reg = <0x00 0x141a0000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x3a040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x3a080000 0x0 0x00040000 /* DBI reg space (256K) */ + 0x1c 0x00000000 0x4 0x00000000>; /* Address Space (16G) */ + reg-names = "appl", "atu_dma", "dbi", "addr_space"; + + num-lanes = <8>; + num-ib-windows = <2>; + num-ob-windows = <8>; + + pinctrl-names = "default"; + pinctrl-0 = <&clkreq_c5_bi_dir_state>; + + clocks = <&bpmp TEGRA194_CLK_PEX1_CORE_5>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX1_CORE_5_APB>, + <&bpmp TEGRA194_RESET_PEX1_CORE_5>; + reset-names = "apb", "core"; + + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; /* controller interrupt */ + interrupt-names = "intr"; + + nvidia,bpmp = <&bpmp 5>; + + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + reset-gpios = <&gpio TEGRA194_MAIN_GPIO(GG, 1) GPIO_ACTIVE_LOW>; + + nvidia,refclk-select-gpios = <&gpio_aon TEGRA194_AON_GPIO(AA, 5) + GPIO_ACTIVE_HIGH>; + + phys = <&p2u_nvhs_0>, <&p2u_nvhs_1>, <&p2u_nvhs_2>, + <&p2u_nvhs_3>, <&p2u_nvhs_4>, <&p2u_nvhs_5>, + <&p2u_nvhs_6>, <&p2u_nvhs_7>; + + phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3", "p2u-4", + "p2u-5", "p2u-6", "p2u-7"; + };
Signature · 1 line
2.17.1
Re: [PATCH V2 2/5] dt-bindings: PCI: tegra: Add DT support for PCIe EP nodes in Tegra194
Quoted 11 lines · Vidya Sagar
Add support for PCIe controllers that can operate in endpoint mode in Tegra194.
Signed-off-by Vidya Sagar <[email protected]>---
V2:
* Addressed Thierry's review comments
* Merged EP specific information from tegra194-pcie-ep.txt to tegra194-pcie.txt itself
* Started using the standard 'reset-gpios' for PERST GPIO
* Added 'nvidia,refclk-select-gpios' to enable REFCLK signals
Quoted 3 lines
.../bindings/pci/nvidia,tegra194-pcie.txt | 125 ++++++++++++++---- 1 file changed, 99 insertions(+), 26 deletions(-)
PATCH v2 3/5 PCI: tegra: Add support for PCIe endpoint mode in Tegra194
In reply to Vidya SagarAdd support for the endpoint mode of Synopsys DesignWare core based dual mode PCIe controllers present in Tegra194 SoC.
---
V2:
* Addressed Bjorn's review comments
* Made changes as part of addressing review comments for other patches
drivers/pci/controller/dwc/Kconfig | 30 +- drivers/pci/controller/dwc/pcie-tegra194.c | 782 ++++++++++++++++++++- 2 files changed, 796 insertions(+), 16 deletions(-)
drivers/pci/controller/dwc/Kconfig +27 -3
@@ -237,14 +237,38 @@ config PCI_MESON implement the driver. config PCIE_TEGRA194 - tristate "NVIDIA Tegra194 (and later) PCIe controller" + tristate + +config PCIE_TEGRA194_HOST + tristate "NVIDIA Tegra194 (and later) PCIe controller - Host Mode" depends on ARCH_TEGRA_194_SOC || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST select PHY_TEGRA194_P2U + select PCIE_TEGRA194 + default y + help + Enables support for the PCIe controller in the NVIDIA Tegra194 SoC to + work in host mode. There are two instances of PCIe controllers in + Tegra194. This controller can work either as EP or RC. In order to + enable host-specific features PCIE_TEGRA194_HOST must be selected and + in order to enable device-specific features PCIE_TEGRA194_EP must be + selected. This uses the DesignWare core. + +config PCIE_TEGRA194_EP + tristate "NVIDIA Tegra194 (and later) PCIe controller - Endpoint Mode" + depends on ARCH_TEGRA_194_SOC || COMPILE_TEST + depends on PCI_ENDPOINT + select PCIE_DW_EP + select PHY_TEGRA194_P2U + select PCIE_TEGRA194 help - Say Y here if you want support for DesignWare core based PCIe host - controller found in NVIDIA Tegra194 SoC. + Enables support for the PCIe controller in the NVIDIA Tegra194 SoC to + work in host mode. There are two instances of PCIe controllers in + Tegra194. This controller can work either as EP or RC. In order to + enable host-specific features PCIE_TEGRA194_HOST must be selected and + in order to enable device-specific features PCIE_TEGRA194_EP must be + selected. This uses the DesignWare core. config PCIE_UNIPHIER bool "Socionext UniPhier PCIe controllers"
drivers/pci/controller/dwc/pcie-tegra194.c +769 -13
925 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH V2 3/5] PCI: tegra: Add support for PCIe endpoint mode in Tegra194
Quoted 14 lines · Vidya Sagar
Add support for the endpoint mode of Synopsys DesignWare core based dual mode PCIe controllers present in Tegra194 SoC.
Signed-off-by Vidya Sagar <[email protected]>---
V2:
* Addressed Bjorn's review comments
* Made changes as part of addressing review comments for other patchesdrivers/pci/controller/dwc/Kconfig | 30 +- drivers/pci/controller/dwc/pcie-tegra194.c | 782 ++++++++++++++++++++- 2 files changed, 796 insertions(+), 16 deletions(-)drivers/pci/controller/dwc/pcie-tegra194.c +0
-0
[...]
Quoted 12 lines
drivers/pci/controller/dwc/pcie-tegra194.c +8
-0@@ -411,11 +466,66 @@ static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie)return IRQ_HANDLED ; } +static irqreturn_t tegra_pcie_ep_irq_handler (struct tegra_pcie_dw *pcie) +{ +struct dw_pcie_ep *ep = &pcie->pci.ep; +int spurious =1 ; +u32 val, tmp; + + val =appl_readl (pcie,APPL_INTR_STATUS_L0 ); +if (val &APPL_INTR_STATUS_L0_LINK_STATE_INT ) {
drivers/pci/controller/dwc/pcie-tegra194.c static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie) · line 486
Quoted 10 lines
drivers/pci/controller/dwc/pcie-tegra194.c +10
-0+ val =appl_readl (pcie,APPL_INTR_STATUS_L1_0_0 ); +appl_writel (pcie, val,APPL_INTR_STATUS_L1_0_0 ); +if (val &APPL_INTR_STATUS_L1_0_0_HOT_RESET_DONE ) { +/* clear any stale PEX_RST interrupt */ +if (!kfifo_put (&pcie->event_fifo,EP_HOT_RST_DONE )) { +dev_err (pcie->dev,"EVENT FIFO is full\n" ); +return IRQ_HANDLED ; + } +wake_up (&pcie->wq); + }
Overall this patch looks a little cluttered. A few blank lines before and after (or between) block statements would help make this more readable, in my opinion.
drivers/pci/controller/dwc/pcie-tegra194.c static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie) · line 490
Quoted 4 lines
drivers/pci/controller/dwc/pcie-tegra194.c +4
-0+if (val &APPL_INTR_STATUS_L1_0_0_RDLH_LINK_UP_CHGED ) { + tmp =appl_readl (pcie,APPL_LINK_STATUS ); +if (tmp &APPL_LINK_STATUS_RDLH_LINK_UP ) { +dev_info (pcie->dev,"Link is up with Host\n" );
Do we want this to be an info message? Looks to me like this is mostly useful for debug purposes, as a quick way to check if the link is up. For production use, this would perhaps be better to expose as a sysfs attribute so that userspace can query it at runtime rather than search through kernel logs.
Quoted 30 lines
drivers/pci/controller/dwc/pcie-tegra194.c +28
-0+dw_pcie_ep_linkup (ep); + } + } + spurious =0 ; + } + +if (val &APPL_INTR_STATUS_L0_PCI_CMD_EN_INT ) { + val =appl_readl (pcie,APPL_INTR_STATUS_L1_15 ); +appl_writel (pcie, val,APPL_INTR_STATUS_L1_15 ); +if (val &APPL_INTR_STATUS_L1_15_CFG_BME_CHGED ) { +if (!kfifo_put (&pcie->event_fifo,EP_BME_CHANGE )) { +dev_err (pcie->dev,"EVENT FIFO is full\n" ); +return IRQ_HANDLED ; + } +wake_up (&pcie->wq); + } + spurious =0 ; + } + +if (spurious) { +dev_warn (pcie->dev,"Random interrupt (STATUS = 0x%08X)\n" , + val); +appl_writel (pcie, val,APPL_INTR_STATUS_L0 ); + } + +return IRQ_HANDLED ; +} +static irqreturn_t tegra_pcie_irq_handler (int irq,void *arg) {
drivers/pci/controller/dwc/pcie-tegra194.c static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie) · line 529
Quoted 10 lines
drivers/pci/controller/dwc/pcie-tegra194.c +6
-1struct tegra_pcie_dw *pcie = arg; -return tegra_pcie_rp_irq_handler (pcie); +if (pcie->mode ==DW_PCIE_RC_TYPE ) +return tegra_pcie_rp_irq_handler (pcie); +else if (pcie->mode ==DW_PCIE_EP_TYPE ) +return tegra_pcie_ep_irq_handler (pcie); + +return IRQ_NONE ; }
We already know at probe time whether the controller is in root complex or endpoint mode, right? Couldn't we just install the correct handler rather than multiplex here? It's not a very big deal, but given that these are interrupts, avoiding the additional indirection might be a good idea.
[...]
Quoted 5 lines
drivers/pci/controller/dwc/pcie-tegra194.c +1
-0@@ -986,6 +1115,42 @@ static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie) pcie->enable_cdm_check =of_property_read_bool (np,"snps,enable-cdm-check" ); +if (pcie->mode ==DW_PCIE_RC_TYPE )
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie) · line 1128
Quoted 10 lines
drivers/pci/controller/dwc/pcie-tegra194.c +10
-0+return 0 ; + +/* Endpoint mode specific DT entries */ + name =devm_kasprintf (pcie->dev,GFP_KERNEL , +"tegra_pcie_%u_pex_rst_gpio" , pcie->cid); +if (!name) { +dev_err (pcie->dev,"Failed to create PERST GPIO string\n" ); +return -ENOMEM ; + } + pcie->pex_rst_gpiod = devm_gpiod_get_from_of_node(pcie->dev, np,
If np == pcie->dev.of_node, you can simply use devm_gpiod_get() here, can't you?
[...]
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) · line 1846
Quoted 3 lines
drivers/pci/controller/dwc/pcie-tegra194.c +3
-0+static void pex_ep_event_hot_rst_done (struct tegra_pcie_dw *pcie) +{ +u32 val =0 ;
The initialization here seems unnecessary.
[...]
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) · line 1993
Quoted 8 lines
drivers/pci/controller/dwc/pcie-tegra194.c +8
-0+static int tegra_pcie_ep_raise_legacy_irq (struct tegra_pcie_dw *pcie,u16 irq) +{ +/* Tegra194 supports only INTA */ +if (irq >1 ) +return -EINVAL ; + +appl_writel (pcie,1 ,APPL_LEGACY_INTX ); +mdelay (1 );
Spinning for 1 ms these days is quite a lot. Does this have to be a busy loop or could you use something like usleep_range(1000, 2000) to allow the CPU to do something else in the meantime?
Also, does the legacy INTX pulse have to be a whole millisecond wide? Or could this be shorter? A one millisecond pulse implies a maximum of 1000 interrupts per second, which seems a bit low.
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_dw_probe(struct platform_device *pdev) · line 2185
Quoted 9 lines
drivers/pci/controller/dwc/pcie-tegra194.c +5
-0@@ -1440,6 +2178,12 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)int ret;u32 i; + match =of_match_device (of_match_ptr (tegra_pcie_dw_of_match), dev); +if (!match) +return -EINVAL ; + + data = (struct tegra_pcie_dw_of_data *)match->data;
of_device_get_match_data()?
Quoted 62 lines
drivers/pci/controller/dwc/pcie-tegra194.c +25
-5+ pcie =devm_kzalloc (dev,sizeof (*pcie),GFP_KERNEL );if (!pcie)return -ENOMEM ;@@ -1449,6 +2193,7 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev) pci->ops = &tegra_dw_pcie_ops; pp = &pci->pp; pcie->dev = &pdev->dev; + pcie->mode = (enum dw_pcie_device_mode )data->mode; ret =tegra_pcie_dw_parse_dt (pcie);if (ret <0 ) {@@ -1462,6 +2207,9 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)return ret; } +if (pcie->pex_refclk_sel_gpiod) +gpiod_set_value (pcie->pex_refclk_sel_gpiod,1 ); + pcie->pex_ctl_supply =devm_regulator_get (dev,"vddio-pex-ctl" );if (IS_ERR (pcie->pex_ctl_supply)) { ret =PTR_ERR (pcie->pex_ctl_supply);@@ -1570,11 +2318,24 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)platform_set_drvdata (pdev, pcie); - ret =tegra_pcie_config_rp (pcie); -if (ret && ret != -ENOMEDIUM ) - goto fail; -else -return 0 ; +switch (pcie->mode) { +case DW_PCIE_RC_TYPE : + ret =tegra_pcie_config_rp (pcie); +if (ret && ret != -ENOMEDIUM ) + goto fail; +else +return 0 ; +break ; + +case DW_PCIE_EP_TYPE : + ret =tegra_pcie_config_ep (pcie, pdev); +if (ret <0 ) + goto fail; +break ; + +default : +dev_err (dev,"Invalid PCIe device type %d\n" , pcie->mode); + } fail:tegra_bpmp_put (pcie->bpmp);@@ -1593,6 +2354,8 @@ static int tegra_pcie_dw_remove(struct platform_device *pdev)pm_runtime_put_sync (pcie->dev);pm_runtime_disable (pcie->dev);tegra_bpmp_put (pcie->bpmp); +if (pcie->pex_refclk_sel_gpiod) +gpiod_set_value (pcie->pex_refclk_sel_gpiod,0 );return 0 ; }
drivers/pci/controller/dwc/pcie-tegra194.c static void tegra_pcie_dw_shutdown(struct platform_device *pdev) · line 1706
Quoted 10 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-7@@ -1697,13 +2460,6 @@ static void tegra_pcie_dw_shutdown(struct platform_device *pdev)__deinit_controller (pcie); } -static const struct of_device_id tegra_pcie_dw_of_match[] = { - { - .compatible ="nvidia,tegra194-pcie" , - }, - {}, -}; -
No need to move this around if you use of_device_get_match_data().
Thierry
Quoted 6 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0static const struct dev_pm_ops tegra_pcie_dw_pm_ops = { .suspend_late = tegra_pcie_dw_suspend_late, .suspend_noirq = tegra_pcie_dw_suspend_noirq,Signature · 1 line
2.17.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: Re: [PATCH V2 3/5] PCI: tegra: Add support for PCIe endpoint mode in Tegra194
Quoted 34 lines · Thierry Reding
Quoted 14 lines · Vidya Sagar
Add support for the endpoint mode of Synopsys DesignWare core based dual mode PCIe controllers present in Tegra194 SoC.
Signed-off-by Vidya Sagar <[email protected]>---
V2:
* Addressed Bjorn's review comments
* Made changes as part of addressing review comments for other patchesdrivers/pci/controller/dwc/Kconfig | 30 +- drivers/pci/controller/dwc/pcie-tegra194.c | 782 ++++++++++++++++++++- 2 files changed, 796 insertions(+), 16 deletions(-)drivers/pci/controller/dwc/pcie-tegra194.c +0
-0[...]
Quoted 18 lines
drivers/pci/controller/dwc/pcie-tegra194.c +14
-0@@ -411,11 +466,66 @@ static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie)return IRQ_HANDLED ; } +static irqreturn_t tegra_pcie_ep_irq_handler (struct tegra_pcie_dw *pcie) +{ +struct dw_pcie_ep *ep = &pcie->pci.ep; +int spurious =1 ; +u32 val, tmp; + + val =appl_readl (pcie,APPL_INTR_STATUS_L0 ); +if (val &APPL_INTR_STATUS_L0_LINK_STATE_INT ) { + val =appl_readl (pcie,APPL_INTR_STATUS_L1_0_0 ); +appl_writel (pcie, val,APPL_INTR_STATUS_L1_0_0 ); +if (val &APPL_INTR_STATUS_L1_0_0_HOT_RESET_DONE ) { +/* clear any stale PEX_RST interrupt */ +if (!kfifo_put (&pcie->event_fifo,EP_HOT_RST_DONE )) { +dev_err (pcie->dev,"EVENT FIFO is full\n" );
Quoted 8 lines
drivers/pci/controller/dwc/pcie-tegra194.c static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie) · line 486
Quoted 4 lines
drivers/pci/controller/dwc/pcie-tegra194.c +4
-0+return IRQ_HANDLED ; + } +wake_up (&pcie->wq); + }Overall this patch looks a little cluttered. A few blank lines before and after (or between) block statements would help make this more readable, in my opinion.
Done.
Quoted 11 lines
drivers/pci/controller/dwc/pcie-tegra194.c static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie) · line 490
Quoted 5 lines
drivers/pci/controller/dwc/pcie-tegra194.c +4
-0+if (val &APPL_INTR_STATUS_L1_0_0_RDLH_LINK_UP_CHGED ) { + tmp =appl_readl (pcie,APPL_LINK_STATUS ); +if (tmp &APPL_LINK_STATUS_RDLH_LINK_UP ) { +dev_info (pcie->dev,"Link is up with Host\n" );Do we want this to be an info message? Looks to me like this is mostly useful for debug purposes, as a quick way to check if the link is up. For production use, this would perhaps be better to expose as a sysfs attribute so that userspace can query it at runtime rather than search through kernel logs.
I changed it to dev_dbg message.
Quoted 33 lines
Quoted 33 lines
drivers/pci/controller/dwc/pcie-tegra194.c +28
-0+dw_pcie_ep_linkup (ep); + } + } + spurious =0 ; + } + +if (val &APPL_INTR_STATUS_L0_PCI_CMD_EN_INT ) { + val =appl_readl (pcie,APPL_INTR_STATUS_L1_15 ); +appl_writel (pcie, val,APPL_INTR_STATUS_L1_15 ); +if (val &APPL_INTR_STATUS_L1_15_CFG_BME_CHGED ) { +if (!kfifo_put (&pcie->event_fifo,EP_BME_CHANGE )) { +dev_err (pcie->dev,"EVENT FIFO is full\n" ); +return IRQ_HANDLED ; + } +wake_up (&pcie->wq); + } + spurious =0 ; + } + +if (spurious) { +dev_warn (pcie->dev,"Random interrupt (STATUS = 0x%08X)\n" , + val); +appl_writel (pcie, val,APPL_INTR_STATUS_L0 ); + } + +return IRQ_HANDLED ; +} +static irqreturn_t tegra_pcie_irq_handler (int irq,void *arg) {struct tegra_pcie_dw *pcie = arg;
Quoted 14 lines
drivers/pci/controller/dwc/pcie-tegra194.c static irqreturn_t tegra_pcie_rp_irq_handler(struct tegra_pcie_dw *pcie) · line 529
Quoted 8 lines
drivers/pci/controller/dwc/pcie-tegra194.c +6
-1-return tegra_pcie_rp_irq_handler (pcie); +if (pcie->mode ==DW_PCIE_RC_TYPE ) +return tegra_pcie_rp_irq_handler (pcie); +else if (pcie->mode ==DW_PCIE_EP_TYPE ) +return tegra_pcie_ep_irq_handler (pcie); + +return IRQ_NONE ; }We already know at probe time whether the controller is in root complex or endpoint mode, right? Couldn't we just install the correct handler rather than multiplex here? It's not a very big deal, but given that these are interrupts, avoiding the additional indirection might be a good idea.
Done.
Quoted 6 lines
[...]
Quoted 4 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0@@ -986,6 +1115,42 @@ static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie) pcie->enable_cdm_check =of_property_read_bool (np,"snps,enable-cdm-check" );
Quoted 14 lines
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_dw_parse_dt(struct tegra_pcie_dw *pcie) · line 1128
Quoted 11 lines
drivers/pci/controller/dwc/pcie-tegra194.c +11
-0+if (pcie->mode ==DW_PCIE_RC_TYPE ) +return 0 ; + +/* Endpoint mode specific DT entries */ + name =devm_kasprintf (pcie->dev,GFP_KERNEL , +"tegra_pcie_%u_pex_rst_gpio" , pcie->cid); +if (!name) { +dev_err (pcie->dev,"Failed to create PERST GPIO string\n" ); +return -ENOMEM ; + } + pcie->pex_rst_gpiod = devm_gpiod_get_from_of_node(pcie->dev, np,If np ==
pcie->dev.of_node, you can simply usedevm_gpiod_get()here, can't you?
Done.
Quoted 7 lines
[...]
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) · line 1846
Quoted 3 lines
drivers/pci/controller/dwc/pcie-tegra194.c +3
-0+static void pex_ep_event_hot_rst_done (struct tegra_pcie_dw *pcie) +{ +u32 val =0 ;The initialization here seems unnecessary.
Done.
Quoted 15 lines
[...]
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) · line 1993
Quoted 8 lines
drivers/pci/controller/dwc/pcie-tegra194.c +8
-0+static int tegra_pcie_ep_raise_legacy_irq (struct tegra_pcie_dw *pcie,u16 irq) +{ +/* Tegra194 supports only INTA */ +if (irq >1 ) +return -EINVAL ; + +appl_writel (pcie,1 ,APPL_LEGACY_INTX ); +mdelay (1 );Spinning for 1 ms these days is quite a lot. Does this have to be a busy loop or could you use something like
usleep_range(1000, 2000)to allow the CPU to do something else in the meantime?
Quoted 3 lines
Also, does the legacy INTX pulse have to be a whole millisecond wide? Or could this be shorter? A one millisecond pulse implies a maximum of 1000 interrupts per second, which seems a bit low.
1 ms is what all the other implementations also are using and they are using mdelay also :( . But, I think this doesn't have to be a busy loop and I'll change it to usleep_range(1000, 2000).
Quoted 5 lines
Quoted 5 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0@@ -1440,6 +2178,12 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)int ret;u32 i;
Quoted 7 lines
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_dw_probe(struct platform_device *pdev) · line 2185
Quoted 5 lines
drivers/pci/controller/dwc/pcie-tegra194.c +5
-0+ match =of_match_device (of_match_ptr (tegra_pcie_dw_of_match), dev); +if (!match) +return -EINVAL ; + + data = (struct tegra_pcie_dw_of_data *)match->data;
of_device_get_match_data()?
Done.
Quoted 66 lines
Quoted 66 lines
drivers/pci/controller/dwc/pcie-tegra194.c +25
-5+ pcie =devm_kzalloc (dev,sizeof (*pcie),GFP_KERNEL );if (!pcie)return -ENOMEM ;@@ -1449,6 +2193,7 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev) pci->ops = &tegra_dw_pcie_ops; pp = &pci->pp; pcie->dev = &pdev->dev; + pcie->mode = (enum dw_pcie_device_mode )data->mode; ret =tegra_pcie_dw_parse_dt (pcie);if (ret <0 ) {@@ -1462,6 +2207,9 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)return ret; } +if (pcie->pex_refclk_sel_gpiod) +gpiod_set_value (pcie->pex_refclk_sel_gpiod,1 ); + pcie->pex_ctl_supply =devm_regulator_get (dev,"vddio-pex-ctl" );if (IS_ERR (pcie->pex_ctl_supply)) { ret =PTR_ERR (pcie->pex_ctl_supply);@@ -1570,11 +2318,24 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)platform_set_drvdata (pdev, pcie); - ret =tegra_pcie_config_rp (pcie); -if (ret && ret != -ENOMEDIUM ) - goto fail; -else -return 0 ; +switch (pcie->mode) { +case DW_PCIE_RC_TYPE : + ret =tegra_pcie_config_rp (pcie); +if (ret && ret != -ENOMEDIUM ) + goto fail; +else +return 0 ; +break ; + +case DW_PCIE_EP_TYPE : + ret =tegra_pcie_config_ep (pcie, pdev); +if (ret <0 ) + goto fail; +break ; + +default : +dev_err (dev,"Invalid PCIe device type %d\n" , pcie->mode); + } fail:tegra_bpmp_put (pcie->bpmp);@@ -1593,6 +2354,8 @@ static int tegra_pcie_dw_remove(struct platform_device *pdev)pm_runtime_put_sync (pcie->dev);pm_runtime_disable (pcie->dev);tegra_bpmp_put (pcie->bpmp); +if (pcie->pex_refclk_sel_gpiod) +gpiod_set_value (pcie->pex_refclk_sel_gpiod,0 );return 0 ; }@@ -1697,13 +2460,6 @@ static void tegra_pcie_dw_shutdown(struct platform_device *pdev)__deinit_controller (pcie); }
Quoted 9 lines
drivers/pci/controller/dwc/pcie-tegra194.c static void tegra_pcie_dw_shutdown(struct platform_device *pdev) · line 1706
Quoted 7 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-7-static const struct of_device_id tegra_pcie_dw_of_match[] = { - { - .compatible ="nvidia,tegra194-pcie" , - }, - {}, -}; -No need to move this around if you use
of_device_get_match_data().
Yes.
Thanks for the review.
Vidya Sagar
Quoted 9 lines
Thierry
Quoted 6 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0static const struct dev_pm_ops tegra_pcie_dw_pm_ops = { .suspend_late = tegra_pcie_dw_suspend_late, .suspend_noirq = tegra_pcie_dw_suspend_noirq,Signature · 1 line
2.17.1
Re: [PATCH V2 3/5] PCI: tegra: Add support for PCIe endpoint mode in Tegra194
In reply to Vidya SagarQuoted 13 lines · Vidya Sagar
Add support for the endpoint mode of Synopsys DesignWare core based dual mode PCIe controllers present in Tegra194 SoC.
Signed-off-by Vidya Sagar <[email protected]>---
V2:
* Addressed Bjorn's review comments
* Made changes as part of addressing review comments for other patchesdrivers/pci/controller/dwc/Kconfig | 30 +- drivers/pci/controller/dwc/pcie-tegra194.c | 782 ++++++++++++++++++++- 2 files changed, 796 insertions(+), 16 deletions(-)
[...]
Quoted 4 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0
[...]
Quoted 1 line
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0@@ -1427,8 +1620,553 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)
[...]
Quoted 3 lines
drivers/pci/controller/dwc/pcie-tegra194.c +3
-0+static int tegra_pcie_config_ep (struct tegra_pcie_dw *pcie, +struct platform_device *pdev) +{
[...]
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) · line 2112
Quoted 9 lines
drivers/pci/controller/dwc/pcie-tegra194.c +9
-0+ ret =devm_request_irq (dev, pcie->pex_rst_irq, + tegra_pcie_ep_pex_rst_irq, +IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING , + name, (void *)pcie); +if (ret <0 ) { +dev_err (dev,"Failed to request IRQ for PERST: %d\n" , ret); +return ret; + } +disable_irq (pcie->pex_rst_irq);
I just came across this while reviewing another patch: it looks like a better way to handle "disabled by default" interrupts is to do this:
irq_set_status_flags(rtc->irq, IRQ_NOAUTOEN);
before calling devm_request_irq(). See here for an example:
http://patchwork.ozlabs.org/patch/1217944/
Thierry
Re: Re: [PATCH V2 3/5] PCI: tegra: Add support for PCIe endpoint mode in Tegra194
Quoted 39 lines · Thierry Reding
Quoted 13 lines · Vidya Sagar
Add support for the endpoint mode of Synopsys DesignWare core based dual mode PCIe controllers present in Tegra194 SoC.
Signed-off-by Vidya Sagar <[email protected]>---
V2:
* Addressed Bjorn's review comments
* Made changes as part of addressing review comments for other patchesdrivers/pci/controller/dwc/Kconfig | 30 +- drivers/pci/controller/dwc/pcie-tegra194.c | 782 ++++++++++++++++++++- 2 files changed, 796 insertions(+), 16 deletions(-)[...]
Quoted 4 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0[...]
Quoted 1 line
drivers/pci/controller/dwc/pcie-tegra194.c +0
-0@@ -1427,8 +1620,553 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)[...]
Quoted 3 lines
drivers/pci/controller/dwc/pcie-tegra194.c +3
-0+static int tegra_pcie_config_ep (struct tegra_pcie_dw *pcie, +struct platform_device *pdev) +{[...]
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) · line 2112
Quoted 9 lines
drivers/pci/controller/dwc/pcie-tegra194.c +9
-0+ ret =devm_request_irq (dev, pcie->pex_rst_irq, + tegra_pcie_ep_pex_rst_irq, +IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING , + name, (void *)pcie); +if (ret <0 ) { +dev_err (dev,"Failed to request IRQ for PERST: %d\n" , ret); +return ret; + } +disable_irq (pcie->pex_rst_irq);I just came across this while reviewing another patch: it looks like a better way to handle "disabled by default" interrupts is to do this:
Quoted 5 lines
irq_set_status_flags(rtc->irq, IRQ_NOAUTOEN);before calling
devm_request_irq(). See here for an example:http://patchwork.ozlabs.org/patch/1217944/
I'll take care of it.
Thanks for the review.
Vidya Sagar
Quoted 3 lines
Thierry
PATCH v2 4/5 arm64: tegra: Add PCIe endpoint controllers nodes for Tegra194
In reply to Vidya SagarAdd endpoint mode controllers nodes for the dual mode PCIe controllers present in Tegra194 SoC.
---
V2:
* None
arch/arm64/boot/dts/nvidia/tegra194.dtsi | 99 ++++++++++++++++++++++++ 1 file changed, 99 insertions(+)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +99 -0
@@ -1425,6 +1425,105 @@ 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */ }; + pcie_ep@14160000 { + compatible = "nvidia,tegra194-pcie-ep", "snps,dw-pcie-ep"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX4A>; + reg = <0x00 0x14160000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x36040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x36080000 0x0 0x00040000 /* DBI reg space (256K) */ + 0x14 0x00000000 0x4 0x00000000>; /* Address Space (16G) */ + reg-names = "appl", "atu_dma", "dbi", "addr_space"; + + status = "disabled"; + + num-lanes = <4>; + num-ib-windows = <2>; + num-ob-windows = <8>; + + 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 = "apb", "core"; + + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>; /* controller interrupt */ + interrupt-names = "intr"; + + nvidia,bpmp = <&bpmp 4>; + + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + }; + + pcie_ep@14180000 { + compatible = "nvidia,tegra194-pcie-ep", "snps,dw-pcie-ep"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8B>; + reg = <0x00 0x14180000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x38040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x38080000 0x0 0x00040000 /* DBI reg space (256K) */ + 0x18 0x00000000 0x4 0x00000000>; /* Address Space (16G) */ + reg-names = "appl", "atu_dma", "dbi", "addr_space"; + + status = "disabled"; + + num-lanes = <8>; + num-ib-windows = <2>; + num-ob-windows = <8>; + + 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 = "apb", "core"; + + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; /* controller interrupt */ + interrupt-names = "intr"; + + nvidia,bpmp = <&bpmp 0>; + + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + }; + + pcie_ep@141a0000 { + compatible = "nvidia,tegra194-pcie-ep", "snps,dw-pcie-ep"; + power-domains = <&bpmp TEGRA194_POWER_DOMAIN_PCIEX8A>; + reg = <0x00 0x141a0000 0x0 0x00020000 /* appl registers (128K) */ + 0x00 0x3a040000 0x0 0x00040000 /* iATU_DMA reg space (256K) */ + 0x00 0x3a080000 0x0 0x00040000 /* DBI reg space (256K) */ + 0x1c 0x00000000 0x4 0x00000000>; /* Address Space (16G) */ + reg-names = "appl", "atu_dma", "dbi", "addr_space"; + + status = "disabled"; + + num-lanes = <8>; + num-ib-windows = <2>; + num-ob-windows = <8>; + + pinctrl-names = "default"; + pinctrl-0 = <&clkreq_c5_bi_dir_state>; + + clocks = <&bpmp TEGRA194_CLK_PEX1_CORE_5>; + clock-names = "core"; + + resets = <&bpmp TEGRA194_RESET_PEX1_CORE_5_APB>, + <&bpmp TEGRA194_RESET_PEX1_CORE_5>; + reset-names = "apb", "core"; + + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; /* controller interrupt */ + interrupt-names = "intr"; + + nvidia,bpmp = <&bpmp 5>; + + nvidia,aspm-cmrt-us = <60>; + nvidia,aspm-pwr-on-t-us = <20>; + nvidia,aspm-l0s-entrance-latency-us = <3>; + }; + sysram@40000000 { compatible = "nvidia,tegra194-sysram", "mmio-sram"; reg = <0x0 0x40000000 0x0 0x50000>;
Signature · 1 line
2.17.1
PATCH v2 5/5 arm64: tegra: Add support for PCIe endpoint mode in P2972-0000 platform
In reply to Vidya SagarAdd endpoint mode support for PCIe C5 controller in P2972-0000 platform with information about supplies, PHY, PERST GPIO and GPIO that controls PCIe reference clock coming from the host system.
---
V2:
* Addressed Thierry's review comments
* Changed 'nvidia,pex-rst-gpio' to 'reset-gpios'
* Added 'nvidia,refclk-select-gpios'
.../boot/dts/nvidia/tegra194-p2972-0000.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts +18 -0
@@ -136,6 +136,24 @@ "p2u-5", "p2u-6", "p2u-7"; }; + pcie_ep@141a0000 { + status = "disabled"; + + vddio-pex-ctl-supply = <&vdd_1v8ao>; + + reset-gpios = <&gpio TEGRA194_MAIN_GPIO(GG, 1) GPIO_ACTIVE_LOW>; + + nvidia,refclk-select-gpios = <&gpio_aon TEGRA194_AON_GPIO(AA, 5) + GPIO_ACTIVE_HIGH>; + + phys = <&p2u_nvhs_0>, <&p2u_nvhs_1>, <&p2u_nvhs_2>, + <&p2u_nvhs_3>, <&p2u_nvhs_4>, <&p2u_nvhs_5>, + <&p2u_nvhs_6>, <&p2u_nvhs_7>; + + phy-names = "p2u-0", "p2u-1", "p2u-2", "p2u-3", "p2u-4", + "p2u-5", "p2u-6", "p2u-7"; + }; + fan: fan { compatible = "pwm-fan"; pwms = <&pwm4 0 45334>;
Signature · 1 line
2.17.1