PCI: tegra: Fix CLKREQ dependency programming
Subsystems (4)
PATCH 1/2 PCI: tegra: Fix CLKREQ dependency programming
Corrects the programming to provide REFCLK to the downstream device when there is no CLKREQ sideband signal routing present from root port to the endpont.
--- drivers/pci/controller/dwc/pcie-tegra194.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pci/controller/dwc/pcie-tegra194.c +2 -4
@@ -40,8 +40,6 @@#define APPL_PINMUX_CLKREQ_OVERRIDE BIT(3)#define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE_EN BIT(4)#define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE BIT(5) -#define APPL_PINMUX_CLKREQ_OUT_OVRD_EN BIT(9) -#define APPL_PINMUX_CLKREQ_OUT_OVRD BIT(10)#define APPL_CTRL 0x4#define APPL_CTRL_SYS_PRE_DET_STATE BIT(6)
@@ -1193,8 +1191,8 @@ static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie,if (!pcie->supports_clkreq) { val =appl_readl (pcie,APPL_PINMUX ); - val |=APPL_PINMUX_CLKREQ_OUT_OVRD_EN ; - val |=APPL_PINMUX_CLKREQ_OUT_OVRD ; + val |=APPL_PINMUX_CLKREQ_OVERRIDE_EN ; + val &= ~APPL_PINMUX_CLKREQ_OVERRIDE ;appl_writel (pcie, val,APPL_PINMUX ); }
Signature · 1 line
2.17.1
PATCH 2/2 arm64: tegra: Assume no CLKREQ presence by default
Although Tegra194 has support for CLKREQ sideband signal and P2972 has routing of the same till the slot, it is the case most of the time that the connected device doesn't have CLKREQ support. Hence, it makes sense to assume that there is no CLKREQ support by default and it can be enabled on need basis when a card with CLKREQ support is connected.
--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 6 ------ 1 file changed, 6 deletions(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +0 -6
@@ -1186,7 +1186,6 @@ nvidia,bpmp = <&bpmp 1>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;
@@ -1232,7 +1231,6 @@ nvidia,bpmp = <&bpmp 2>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;
@@ -1278,7 +1276,6 @@ nvidia,bpmp = <&bpmp 3>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;
@@ -1324,7 +1321,6 @@ nvidia,bpmp = <&bpmp 4>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;
@@ -1370,7 +1366,6 @@ nvidia,bpmp = <&bpmp 0>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;
@@ -1420,7 +1415,6 @@ interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;
Signature · 1 line
2.17.1
Thierry Reding
AppliedRe: [PATCH 2/2] arm64: tegra: Assume no CLKREQ presence by default
Quoted 10 lines · Vidya Sagar
Although Tegra194 has support for CLKREQ sideband signal and P2972 has routing of the same till the slot, it is the case most of the time that the connected device doesn't have CLKREQ support. Hence, it makes sense to assume that there is no CLKREQ support by default and it can be enabled on need basis when a card with CLKREQ support is connected.
Signed-off-by Vidya Sagar <[email protected]>--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 6 ------ 1 file changed, 6 deletions(-)
Applied to for-5.5/arm64/dt, thanks.
Thierry
Quoted 55 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +0
-6@@ -1186,7 +1186,6 @@ nvidia,bpmp = <&bpmp 1>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;@@ -1232,7 +1231,6 @@ nvidia,bpmp = <&bpmp 2>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;@@ -1278,7 +1276,6 @@ nvidia,bpmp = <&bpmp 3>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;@@ -1324,7 +1321,6 @@ nvidia,bpmp = <&bpmp 4>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;@@ -1370,7 +1366,6 @@ nvidia,bpmp = <&bpmp 0>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;@@ -1420,7 +1415,6 @@ interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; - supports-clkreq; nvidia,aspm-cmrt-us = <60>; nvidia,aspm-pwr-on-t-us = <20>; nvidia,aspm-l0s-entrance-latency-us = <3>;Signature · 1 line
2.17.1
Quoted 23 lines · Vidya Sagar
Corrects the programming to provide REFCLK to the downstream device when there is no CLKREQ sideband signal routing present from root port to the endpont.
Signed-off-by Vidya Sagar <[email protected]>--- drivers/pci/controller/dwc/pcie-tegra194.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/pci/controller/dwc/pcie-tegra194.c +0
-2@@ -40,8 +40,6 @@#define APPL_PINMUX_CLKREQ_OVERRIDE BIT(3)#define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE_EN BIT(4)#define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE BIT(5) -#define APPL_PINMUX_CLKREQ_OUT_OVRD_EN BIT(9) -#define APPL_PINMUX_CLKREQ_OUT_OVRD BIT(10)#define APPL_CTRL 0x4#define APPL_CTRL_SYS_PRE_DET_STATE BIT(6)
drivers/pci/controller/dwc/pcie-tegra194.c static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie, · line 1197
Quoted 9 lines
drivers/pci/controller/dwc/pcie-tegra194.c +2
-2@@ -1193,8 +1191,8 @@ static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie,if (!pcie->supports_clkreq) { val =appl_readl (pcie,APPL_PINMUX ); - val |=APPL_PINMUX_CLKREQ_OUT_OVRD_EN ; - val |=APPL_PINMUX_CLKREQ_OUT_OVRD ; + val |=APPL_PINMUX_CLKREQ_OVERRIDE_EN ; + val &= ~APPL_PINMUX_CLKREQ_OVERRIDE ;appl_writel (pcie, val,APPL_PINMUX ); }
If we do support CLKREQ, do we have to explicitly set the OVERRIDE bit? Or clear the OVERRIDE_EN bit? Is it always guaranteed that the defaults (OVERRIDE_EN = 0) is applied at this point?
That's an issue that's orthogonal to this patch, though, so for this one:
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Lorenzo Pieralisi
AppliedQuoted 8 lines · Vidya Sagar
Corrects the programming to provide REFCLK to the downstream device when there is no CLKREQ sideband signal routing present from root port to the endpont.
Signed-off-by Vidya Sagar <[email protected]>--- drivers/pci/controller/dwc/pcie-tegra194.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Applied to pci/tegra, thanks.
Lorenzo
Quoted 27 lines
drivers/pci/controller/dwc/pcie-tegra194.c +2
-4@@ -40,8 +40,6 @@#define APPL_PINMUX_CLKREQ_OVERRIDE BIT(3)#define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE_EN BIT(4)#define APPL_PINMUX_CLK_OUTPUT_IN_OVERRIDE BIT(5) -#define APPL_PINMUX_CLKREQ_OUT_OVRD_EN BIT(9) -#define APPL_PINMUX_CLKREQ_OUT_OVRD BIT(10)#define APPL_CTRL 0x4#define APPL_CTRL_SYS_PRE_DET_STATE BIT(6)@@ -1193,8 +1191,8 @@ static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie,if (!pcie->supports_clkreq) { val =appl_readl (pcie,APPL_PINMUX ); - val |=APPL_PINMUX_CLKREQ_OUT_OVRD_EN ; - val |=APPL_PINMUX_CLKREQ_OUT_OVRD ; + val |=APPL_PINMUX_CLKREQ_OVERRIDE_EN ; + val &= ~APPL_PINMUX_CLKREQ_OVERRIDE ;appl_writel (pcie, val,APPL_PINMUX ); }Signature · 1 line
2.17.1