2024-04-18 21:04:01

by Heiko Stuebner

[permalink] [raw]
Subject: [PATCH 0/2] Add support for the dual-role dwc3 controllers on rk3588-tiger

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

Heiko Stuebner (2):
arm64: dts: rockchip: fix comment for upper usb3 port
arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou

.../boot/dts/rockchip/rk3588-tiger-haikou.dts | 60 ++++++++++++++++++-
.../arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 15 +++++
2 files changed, 74 insertions(+), 1 deletion(-)

--
2.39.2



2024-04-18 21:04:10

by Heiko Stuebner

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: rockchip: fix comment for upper usb3 port

From: Heiko Stuebner <[email protected]>

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 <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
index d672198c6b64..214f8258af68 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
@@ -260,7 +260,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


2024-04-18 21:13:02

by Heiko Stuebner

[permalink] [raw]
Subject: [PATCH 2/2] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou

From: Heiko Stuebner <[email protected]>

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 and usb-id extcon to the Tiger-Haikou
board. The Q7 standard defines the pin as usb-id, but it will only ever
get used if the baseboard actually provides an OTG port. So the extcon
stays disabled in the dtsi and only gets enabled in the haikou dts.

Signed-off-by: Heiko Stuebner <[email protected]>
---
.../boot/dts/rockchip/rk3588-tiger-haikou.dts | 58 +++++++++++++++++++
.../arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 15 +++++
2 files changed, 73 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
index 214f8258af68..d6e30d5697bd 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";
};
@@ -237,6 +275,13 @@ &uart2 {

&uart5 {
rts-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
+};
+
+&usbdp_phy0 {
+ status = "okay";
+};
+
+&usbdp_phy1 {
status = "okay";
};

@@ -250,6 +295,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";
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
index 72fe696b0034..95b7d7784a37 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


2024-04-19 22:24:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 0/2] Add support for the dual-role dwc3 controllers on rk3588-tiger


On Thu, 18 Apr 2024 23:03:30 +0200, Heiko Stuebner wrote:
> A comment fix and then the addition of the nodes for the dwc3 controllers
> using the newly merged usbdp phys.
>
> Heiko Stuebner (2):
> arm64: dts: rockchip: fix comment for upper usb3 port
> arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou
>
> .../boot/dts/rockchip/rk3588-tiger-haikou.dts | 60 ++++++++++++++++++-
> .../arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 15 +++++
> 2 files changed, 74 insertions(+), 1 deletion(-)
>
> --
> 2.39.2
>
>
>


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y rockchip/rk3588-tiger-haikou.dtb' for [email protected]:

arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dtb: /extcon-usb3: failed to match any schema with compatible: ['linux,extcon-usb-gpio']






2024-04-22 08:30:54

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 0/2] Add support for the dual-role dwc3 controllers on rk3588-tiger

Hi Rob,

Am Samstag, 20. April 2024, 00:24:23 CEST schrieb Rob Herring:
> On Thu, 18 Apr 2024 23:03:30 +0200, Heiko Stuebner wrote:
> > A comment fix and then the addition of the nodes for the dwc3 controllers
> > using the newly merged usbdp phys.
> >
> > Heiko Stuebner (2):
> > arm64: dts: rockchip: fix comment for upper usb3 port
> > arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou
> >
> > .../boot/dts/rockchip/rk3588-tiger-haikou.dts | 60 ++++++++++++++++++-
> > .../arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 15 +++++
> > 2 files changed, 74 insertions(+), 1 deletion(-)
> >
> > --
> > 2.39.2
> >
> >
> >
>
>
> My bot found new DTB warnings on the .dts files added or changed in this
> series.
>
> Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
> are fixed by another series. Ultimately, it is up to the platform
> maintainer whether these warnings are acceptable or not. No need to reply
> unless the platform maintainer has comments.
>
> If you already ran DT checks and didn't see these error(s), then
> make sure dt-schema is up to date:
>
> pip3 install dtschema --upgrade
>
>
> New warnings running 'make CHECK_DTBS=y rockchip/rk3588-tiger-haikou.dtb' for [email protected]:
>
> arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dtb: /extcon-usb3: failed to match any schema with compatible: ['linux,extcon-usb-gpio']

This follows the txt-binding from
https://www.kernel.org/doc/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt
so in mainline there is no yaml binding yet for the usb-id-extcon.

Though I did find a still pending yaml conversion for it in
https://lore.kernel.org/linux-arm-kernel/[email protected]/T/

Though not sure what the holdup is there as it got a Review from you?
Can you just pick this for the main dt-tree?


Heiko



2024-04-22 08:56:59

by Quentin Schulz

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: rockchip: fix comment for upper usb3 port

Hi Heiko,

On 4/18/24 23:03, Heiko Stuebner wrote:
> From: Heiko Stuebner <[email protected]>
>
> 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 <[email protected]>
> ---
> arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> index d672198c6b64..214f8258af68 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger-haikou.dts
> @@ -260,7 +260,7 @@ &usb_host1_ohci {
> status = "okay";
> };
>
> -/* host2 on Q7_USB_P2, lower usb3 port */
> +/* host2 on Q7_USB_P2, upper usb3 port */

Missing the same update to the comments above &usb_host0_ohci and
&usb_host0_ehci.

Cheers,
Quentin

2024-04-22 09:16:50

by Quentin Schulz

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou

Hi Heiko,

On 4/18/24 23:03, Heiko Stuebner wrote:
> From: Heiko Stuebner <[email protected]>
>
> 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 and usb-id extcon to the Tiger-Haikou
> board. The Q7 standard defines the pin as usb-id, but it will only ever
> get used if the baseboard actually provides an OTG port. So the extcon
> stays disabled in the dtsi and only gets enabled in the haikou dts.
>
> Signed-off-by: Heiko Stuebner <[email protected]>

Would have preferred two separate commits but the content is fine and
it's not that difficult to review, so

Reviewed-by: Quentin Schulz <[email protected]>

Thanks,
Quentin