linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] rockchip: small DTS fixes for RK3399 Puma
@ 2024-03-08 12:52 Quentin Schulz
  2024-03-08 12:52 ` [PATCH 1/3] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID " Quentin Schulz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Quentin Schulz @ 2024-03-08 12:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Klaus Goger, Quentin Schulz, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, Quentin Schulz

There's a pull-up missing on a pin that is used as GPIO input for PCIe
which will make the diode/level-shifter not let voltage pass and thus
not allowing the state of the pin to change.

Also add the missing regulators for the PCIe PHY+connector though this
is purely cosmetic.

There's also a missing PU on the USB ID pin used as a GPIO input, so
let's add it for the same reasons as the one used for PCIe listed above.

Note there's a light dependency on
https://lore.kernel.org/linux-rockchip/43d84aa9-ce0f-406e-82ac-2a691264ee23@theobroma-systems.com/T/#ma0499cbc5e5c20f1a4c6b8452baa2d296abe2d0d
to prevent a git conflict for the maintainer(s).

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
Quentin Schulz (3):
      arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID for RK3399 Puma
      arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma
      arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou

 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts |  2 ++
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 33 +++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)
---
base-commit: 370e52abbf8306f09b0022995ad7ccdff3a834bb
change-id: 20240308-puma-diode-pu-1d2f4551be6d

Best regards,
-- 
Quentin Schulz <quentin.schulz@theobroma-systems.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID for RK3399 Puma
  2024-03-08 12:52 [PATCH 0/3] rockchip: small DTS fixes for RK3399 Puma Quentin Schulz
@ 2024-03-08 12:52 ` Quentin Schulz
  2024-03-08 12:52 ` [PATCH 2/3] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# " Quentin Schulz
  2024-03-08 12:52 ` [PATCH 3/3] arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou Quentin Schulz
  2 siblings, 0 replies; 5+ messages in thread
From: Quentin Schulz @ 2024-03-08 12:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Klaus Goger, Quentin Schulz, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The Q7_USB_ID has a diode used as a level-shifter, and is used as an
input pin. The SoC default for this pin is a pull-up, which is correct
but the pinconf in the introducing commit missed that, so let's fix this
oversight.

Fixes: ed2c66a95c0c ("arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 214ea62b24a5b..a51ebb8f8b80f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -459,7 +459,7 @@ vcc5v0_host_en: vcc5v0-host-en {
 	usb3 {
 		usb3_id: usb3-id {
 			rockchip,pins =
-			  <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
+			  <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 };

-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma
  2024-03-08 12:52 [PATCH 0/3] rockchip: small DTS fixes for RK3399 Puma Quentin Schulz
  2024-03-08 12:52 ` [PATCH 1/3] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID " Quentin Schulz
@ 2024-03-08 12:52 ` Quentin Schulz
  2024-03-08 12:52 ` [PATCH 3/3] arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou Quentin Schulz
  2 siblings, 0 replies; 5+ messages in thread
From: Quentin Schulz @ 2024-03-08 12:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Klaus Goger, Quentin Schulz, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The PCIE_WAKE# has a diode used as a level-shifter, and is used as an
input pin. The SoC default for this pin is a pull-up, which is correct
but the pinconf in the introducing commit missed that, so let's fix this
oversight.

Fixes: 60fd9f72ce8a ("arm64: dts: rockchip: add Haikou baseboard with RK3399-Q7 SoM")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index a51ebb8f8b80f..2484ad2bd86fc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -416,6 +416,11 @@ &io_domains {
 	gpio1830-supply = <&vcc_1v8>;
 };
 
+&pcie_clkreqn_cpm {
+	rockchip,pins =
+		<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
+};
+
 &pinctrl {
 	pinctrl-names = "default";
 	pinctrl-0 = <&q7_thermal_pin>;

-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou
  2024-03-08 12:52 [PATCH 0/3] rockchip: small DTS fixes for RK3399 Puma Quentin Schulz
  2024-03-08 12:52 ` [PATCH 1/3] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID " Quentin Schulz
  2024-03-08 12:52 ` [PATCH 2/3] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# " Quentin Schulz
@ 2024-03-08 12:52 ` Quentin Schulz
  2024-03-08 15:30   ` Dragan Simic
  2 siblings, 1 reply; 5+ messages in thread
From: Quentin Schulz @ 2024-03-08 12:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner
  Cc: Klaus Goger, Quentin Schulz, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The PCIe PHY requires two regulators and are present on the SoM
directly, while the PCIe connector also exposes 3V3 and 12V power rails
which are available on the baseboard.

Considering that 3/4 regulators are always-on on HW level and that the
last one depends on a regulator from the PMIC that is specified as
always on, this commit should be purely cosmetic and no change in
behavior is expected.

Let's add all regulators for PCIe on RK3399 Puma Haikou.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts |  2 ++
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 26 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 18a98c4648eae..66ebb148bbc9a 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -194,6 +194,8 @@ &pcie0 {
 	num-lanes = <4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie_clkreqn_cpm>;
+	vpcie3v3-supply = <&vcc3v3_baseboard>;
+	vpcie12v-supply = <&dc_12v>;
 	status = "okay";
 };
 
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 2484ad2bd86fc..1113f57b09313 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -79,6 +79,26 @@ vcc5v0_sys: vcc5v0-sys {
 		regulator-max-microvolt = <5000000>;
 	};
 
+	vcca0v9: vcca0v9-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcca0v9";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <900000>;
+		regulator-max-microvolt = <900000>;
+		vin-supply = <&vcc_1v8>;
+	};
+
+	vcca1v8: vcca1v8-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vcca1v8";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc3v3_sys>;
+	};
+
 	vdd_log: vdd-log {
 		compatible = "pwm-regulator";
 		pwms = <&pwm2 0 25000 1>;
@@ -416,6 +436,12 @@ &io_domains {
 	gpio1830-supply = <&vcc_1v8>;
 };
 
+&pcie0 {
+	/* PCIe PHY supplies */
+	vpcie0v9-supply = <&vcca0v9>;
+	vpcie1v8-supply = <&vcca1v8>;
+};
+
 &pcie_clkreqn_cpm {
 	rockchip,pins =
 		<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;

-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou
  2024-03-08 12:52 ` [PATCH 3/3] arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou Quentin Schulz
@ 2024-03-08 15:30   ` Dragan Simic
  0 siblings, 0 replies; 5+ messages in thread
From: Dragan Simic @ 2024-03-08 15:30 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	Klaus Goger, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Quentin Schulz

On 2024-03-08 13:52, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> The PCIe PHY requires two regulators and are present on the SoM
> directly, while the PCIe connector also exposes 3V3 and 12V power rails
> which are available on the baseboard.
> 
> Considering that 3/4 regulators are always-on on HW level and that the
> last one depends on a regulator from the PMIC that is specified as
> always on, this commit should be purely cosmetic and no change in
> behavior is expected.
> 
> Let's add all regulators for PCIe on RK3399 Puma Haikou.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Looking good to me, assuming that the regulator naming follows the
labels used in the schematics.

Reviewed-by: Dragan Simic <dsimic@manjaro.org>

> ---
>  .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts |  2 ++
>  arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 26 
> ++++++++++++++++++++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> index 18a98c4648eae..66ebb148bbc9a 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> @@ -194,6 +194,8 @@ &pcie0 {
>  	num-lanes = <4>;
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pcie_clkreqn_cpm>;
> +	vpcie3v3-supply = <&vcc3v3_baseboard>;
> +	vpcie12v-supply = <&dc_12v>;
>  	status = "okay";
>  };
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> index 2484ad2bd86fc..1113f57b09313 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> @@ -79,6 +79,26 @@ vcc5v0_sys: vcc5v0-sys {
>  		regulator-max-microvolt = <5000000>;
>  	};
> 
> +	vcca0v9: vcca0v9-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcca0v9";
> +		regulator-always-on;
> +		regulator-boot-on;
> +		regulator-min-microvolt = <900000>;
> +		regulator-max-microvolt = <900000>;
> +		vin-supply = <&vcc_1v8>;
> +	};
> +
> +	vcca1v8: vcca1v8-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vcca1v8";
> +		regulator-always-on;
> +		regulator-boot-on;
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		vin-supply = <&vcc3v3_sys>;
> +	};
> +
>  	vdd_log: vdd-log {
>  		compatible = "pwm-regulator";
>  		pwms = <&pwm2 0 25000 1>;
> @@ -416,6 +436,12 @@ &io_domains {
>  	gpio1830-supply = <&vcc_1v8>;
>  };
> 
> +&pcie0 {
> +	/* PCIe PHY supplies */
> +	vpcie0v9-supply = <&vcca0v9>;
> +	vpcie1v8-supply = <&vcca1v8>;
> +};
> +
>  &pcie_clkreqn_cpm {
>  	rockchip,pins =
>  		<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-08 15:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 12:52 [PATCH 0/3] rockchip: small DTS fixes for RK3399 Puma Quentin Schulz
2024-03-08 12:52 ` [PATCH 1/3] arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID " Quentin Schulz
2024-03-08 12:52 ` [PATCH 2/3] arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# " Quentin Schulz
2024-03-08 12:52 ` [PATCH 3/3] arm64: dts: rockchip: add regulators for PCIe on RK3399 Puma Haikou Quentin Schulz
2024-03-08 15:30   ` Dragan Simic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).