mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger
@ 2024-04-22 16:39 Heiko Stuebner
  2024-04-22 16:39 ` [PATCH v2 1/3] arm64: dts: rockchip: fix comment for upper usb3 port Heiko Stuebner
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Heiko Stuebner @ 2024-04-22 16:39 UTC (permalink / raw)
  To: heiko; +Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel

A comment fix and then the addition of the nodes for the dwc3 controllers
using the newly merged usbdp phys.

changes in v2:
- split out extcon addition into separate patch
- fix comments in patch1 to cover all affected controllers

Heiko Stuebner (3):
  arm64: dts: rockchip: fix comment for upper usb3 port
  arm64: dts: rockchip: add usb-id extcon on rk3588 tiger
  arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou

 .../boot/dts/rockchip/rk3588-tiger-haikou.dts | 64 ++++++++++++++++++-
 .../arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 15 +++++
 2 files changed, 76 insertions(+), 3 deletions(-)

-- 
2.39.2


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

* [PATCH v2 1/3] arm64: dts: rockchip: fix comment for upper usb3 port
  2024-04-22 16:39 [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Heiko Stuebner
@ 2024-04-22 16:39 ` Heiko Stuebner
  2024-04-22 16:39 ` [PATCH v2 2/3] arm64: dts: rockchip: add usb-id extcon on rk3588 tiger Heiko Stuebner
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2024-04-22 16:39 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

The comment for the host2_xhci points to the wrong port on the board.
The upper usb3 port is the correct one, so fix the comment to prevent
confusion.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
index 9bdd14799eff..2aa43e7430e5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
@@ -239,12 +239,12 @@ &uart5 {
 	status = "okay";
 };
 
-/* host0 on Q7_USB_P2, lower usb3 port */
+/* host0 on Q7_USB_P2, upper usb3 port */
 &usb_host0_ehci {
 	status = "okay";
 };
 
-/* host0 on Q7_USB_P2, lower usb3 port */
+/* host0 on Q7_USB_P2, upper usb3 port */
 &usb_host0_ohci {
 	status = "okay";
 };
@@ -259,7 +259,7 @@ &usb_host1_ohci {
 	status = "okay";
 };
 
-/* host2 on Q7_USB_P2, lower usb3 port */
+/* host2 on Q7_USB_P2, upper usb3 port */
 &usb_host2_xhci {
 	status = "okay";
 };
-- 
2.39.2


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

* [PATCH v2 2/3] arm64: dts: rockchip: add usb-id extcon on rk3588 tiger
  2024-04-22 16:39 [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Heiko Stuebner
  2024-04-22 16:39 ` [PATCH v2 1/3] arm64: dts: rockchip: fix comment for upper usb3 port Heiko Stuebner
@ 2024-04-22 16:39 ` Heiko Stuebner
  2024-04-22 16:39 ` [PATCH v2 3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou Heiko Stuebner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2024-04-22 16:39 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

The Q7 standard specifies a usb-id pin on the connector to distiuish
between host and device mode. Model this via the usb-id extcon binding.

While the pin is part of the Q7 standard, so part of the module, the
extcon stays disabled in the som dtsi and will only be enabled in a
baseboard using it.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
index 4984e36a8c2d..cafb40283882 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
@@ -23,6 +23,14 @@ emmc_pwrseq: emmc-pwrseq {
 		reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
 	};
 
+	extcon_usb3: extcon-usb3 {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb3_id>;
+		status = "disabled";
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
@@ -327,6 +335,13 @@ module_led_pin: module-led-pin {
 			rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	usb3 {
+		usb3_id: usb3-id {
+			rockchip,pins =
+			  <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &saradc {
-- 
2.39.2


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

* [PATCH v2 3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou
  2024-04-22 16:39 [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Heiko Stuebner
  2024-04-22 16:39 ` [PATCH v2 1/3] arm64: dts: rockchip: fix comment for upper usb3 port Heiko Stuebner
  2024-04-22 16:39 ` [PATCH v2 2/3] arm64: dts: rockchip: add usb-id extcon on rk3588 tiger Heiko Stuebner
@ 2024-04-22 16:39 ` Heiko Stuebner
  2024-04-22 16:45   ` Quentin Schulz
  2024-04-22 16:46 ` [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Quentin Schulz
  2024-04-23 15:39 ` Heiko Stuebner
  4 siblings, 1 reply; 7+ messages in thread
From: Heiko Stuebner @ 2024-04-22 16:39 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

Apart from the host-only usb3 controller (host2) the rk3588 also provides
two dual-role controllers. On the Tiger-Haikou combination these are
connected to the lower usb3-host port in host-only mode and the micro-usb3
port for dual-role operation.

Add the necessary controllers, phys to the Tiger-Haikou board and enable
the usb-id extcon.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 .../boot/dts/rockchip/rk3588-tiger-haikou.dts | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
index 2aa43e7430e5..52695b6c113a 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
@@ -113,6 +113,16 @@ vcc5v0_baseboard: vcc5v0-baseboard-regulator {
 		vin-supply = <&dc_12v>;
 	};
 
+	vcc5v0_otg: vcc5v0-otg-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&otg_vbus_drv>;
+		regulator-name = "vcc5v0_otg";
+		regulator-always-on;
+	};
+
 	vcc5v0_usb: vcc5v0-usb-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc5v0_usb";
@@ -137,6 +147,10 @@ &combphy2_psu {
 	status = "okay";
 };
 
+&extcon_usb3 {
+	status = "okay";
+};
+
 &gmac0 {
 	status = "okay";
 };
@@ -199,6 +213,13 @@ haikou_keys_pin: haikou-keys-pin {
 				<3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
+
+	usb2 {
+		otg_vbus_drv: otg-vbus-drv {
+			rockchip,pins =
+			  <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &sdmmc {
@@ -214,6 +235,23 @@ &sdmmc {
 	status = "okay";
 };
 
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy0_otg {
+	phy-supply = <&vcc5v0_otg>;
+	status = "okay";
+};
+
+&u2phy1 {
+	status = "okay";
+};
+
+&u2phy1_otg {
+	status = "okay";
+};
+
 &u2phy2 {
 	status = "okay";
 };
@@ -236,6 +274,13 @@ &uart2 {
 
 &uart5 {
 	rts-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
+};
+
+&usbdp_phy0 {
+	status = "okay";
+};
+
+&usbdp_phy1 {
 	status = "okay";
 };
 
@@ -249,6 +294,19 @@ &usb_host0_ohci {
 	status = "okay";
 };
 
+/* host0_xhci on Q7_USB_P1, usb3-otg port */
+&usb_host0_xhci {
+	dr_mode = "otg";
+	extcon = <&extcon_usb3>;
+	status = "okay";
+};
+
+/* host1_xhci on Q7_USB_P0, lower usb3 port */
+&usb_host1_xhci {
+	dr_mode = "host";
+	status = "okay";
+};
+
 /* host1 on Q7_USB_P3, usb2 port */
 &usb_host1_ehci {
 	status = "okay";
-- 
2.39.2


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

* Re: [PATCH v2 3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou
  2024-04-22 16:39 ` [PATCH v2 3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou Heiko Stuebner
@ 2024-04-22 16:45   ` Quentin Schulz
  0 siblings, 0 replies; 7+ messages in thread
From: Quentin Schulz @ 2024-04-22 16:45 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-arm-kernel, linux-rockchip, linux-kernel, Heiko Stuebner

Hi Heiko,

On 4/22/24 18:39, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@cherry.de>
> 
> Apart from the host-only usb3 controller (host2) the rk3588 also provides
> two dual-role controllers. On the Tiger-Haikou combination these are
> connected to the lower usb3-host port in host-only mode and the micro-usb3
> port for dual-role operation.
> 
> Add the necessary controllers, phys to the Tiger-Haikou board and enable
> the usb-id extcon.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
> ---
>   .../boot/dts/rockchip/rk3588-tiger-haikou.dts | 58 +++++++++++++++++++
>   1 file changed, 58 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> index 2aa43e7430e5..52695b6c113a 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> @@ -113,6 +113,16 @@ vcc5v0_baseboard: vcc5v0-baseboard-regulator {
>   		vin-supply = <&dc_12v>;
>   	};
>   
> +	vcc5v0_otg: vcc5v0-otg-regulator {
> +		compatible = "regulator-fixed";
> +		enable-active-high;
> +		gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&otg_vbus_drv>;
> +		regulator-name = "vcc5v0_otg";
> +		regulator-always-on;
> +	};
> +
>   	vcc5v0_usb: vcc5v0-usb-regulator {
>   		compatible = "regulator-fixed";
>   		regulator-name = "vcc5v0_usb";
> @@ -137,6 +147,10 @@ &combphy2_psu {
>   	status = "okay";
>   };
>   
> +&extcon_usb3 {
> +	status = "okay";
> +};
> +
>   &gmac0 {
>   	status = "okay";
>   };
> @@ -199,6 +213,13 @@ haikou_keys_pin: haikou-keys-pin {
>   				<3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
>   		};
>   	};
> +
> +	usb2 {
> +		otg_vbus_drv: otg-vbus-drv {
> +			rockchip,pins =
> +			  <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
> +		};
> +	};
>   };
>   
>   &sdmmc {
> @@ -214,6 +235,23 @@ &sdmmc {
>   	status = "okay";
>   };
>   
> +&u2phy0 {
> +	status = "okay";
> +};
> +
> +&u2phy0_otg {
> +	phy-supply = <&vcc5v0_otg>;
> +	status = "okay";
> +};
> +
> +&u2phy1 {
> +	status = "okay";
> +};
> +
> +&u2phy1_otg {
> +	status = "okay";
> +};
> +
>   &u2phy2 {
>   	status = "okay";
>   };
> @@ -236,6 +274,13 @@ &uart2 {
>   
>   &uart5 {
>   	rts-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
> +};
> +
> +&usbdp_phy0 {
> +	status = "okay";
> +};
> +
> +&usbdp_phy1 {
>   	status = "okay";
>   };
>   
> @@ -249,6 +294,19 @@ &usb_host0_ohci {
>   	status = "okay";
>   };
>   
> +/* host0_xhci on Q7_USB_P1, usb3-otg port */
> +&usb_host0_xhci {
> +	dr_mode = "otg";
> +	extcon = <&extcon_usb3>;
> +	status = "okay";
> +};
> +
> +/* host1_xhci on Q7_USB_P0, lower usb3 port */
> +&usb_host1_xhci {
> +	dr_mode = "host";
> +	status = "okay";
> +};
> +

Sorry I didn't catch this earlier but the alphabetical order is not 
respected here, it should be after &usb_host1_ohci.

Cheers,
Quentin

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

* Re: [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger
  2024-04-22 16:39 [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Heiko Stuebner
                   ` (2 preceding siblings ...)
  2024-04-22 16:39 ` [PATCH v2 3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou Heiko Stuebner
@ 2024-04-22 16:46 ` Quentin Schulz
  2024-04-23 15:39 ` Heiko Stuebner
  4 siblings, 0 replies; 7+ messages in thread
From: Quentin Schulz @ 2024-04-22 16:46 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel

Hi Heiko,

On 4/22/24 18:39, Heiko Stuebner wrote:
> A comment fix and then the addition of the nodes for the dwc3 controllers
> using the newly merged usbdp phys.
> 
> changes in v2:
> - split out extcon addition into separate patch
> - fix comments in patch1 to cover all affected controllers
> 
> Heiko Stuebner (3):
>    arm64: dts: rockchip: fix comment for upper usb3 port
>    arm64: dts: rockchip: add usb-id extcon on rk3588 tiger
>    arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou
> 

For the whole series,

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

Thanks!
Quentin

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

* Re: [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger
  2024-04-22 16:39 [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Heiko Stuebner
                   ` (3 preceding siblings ...)
  2024-04-22 16:46 ` [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Quentin Schulz
@ 2024-04-23 15:39 ` Heiko Stuebner
  4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2024-04-23 15:39 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: quentin.schulz, linux-kernel, linux-arm-kernel, linux-rockchip

On Mon, 22 Apr 2024 18:39:48 +0200, Heiko Stuebner wrote:
> A comment fix and then the addition of the nodes for the dwc3 controllers
> using the newly merged usbdp phys.
> 
> changes in v2:
> - split out extcon addition into separate patch
> - fix comments in patch1 to cover all affected controllers
> 
> [...]

Applied, thanks!

[1/3] arm64: dts: rockchip: fix comment for upper usb3 port
      commit: 3482efee1144262dc839792103e6a9e29defecbc
[2/3] arm64: dts: rockchip: add usb-id extcon on rk3588 tiger
      commit: eabb53f5dacfd643b5255f35bad30b8f914decdc
[3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou
      commit: d7b83921d098bd76623381f75f5cd2296f1315cc

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2024-04-23 15:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-22 16:39 [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Heiko Stuebner
2024-04-22 16:39 ` [PATCH v2 1/3] arm64: dts: rockchip: fix comment for upper usb3 port Heiko Stuebner
2024-04-22 16:39 ` [PATCH v2 2/3] arm64: dts: rockchip: add usb-id extcon on rk3588 tiger Heiko Stuebner
2024-04-22 16:39 ` [PATCH v2 3/3] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou Heiko Stuebner
2024-04-22 16:45   ` Quentin Schulz
2024-04-22 16:46 ` [PATCH v2 0/3] Add support for the dual-role dwc3 controllers on rk3588-tiger Quentin Schulz
2024-04-23 15:39 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®