All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
@ 2024-04-18  3:52 ` Jimmy Hon
  0 siblings, 0 replies; 8+ messages in thread
From: Jimmy Hon @ 2024-04-18  3:52 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: linux-rockchip, linux-arm-kernel, Jimmy Hon

Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI
or XHCI mode. Displayport AltMode is not yet supported.

Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
---
v2: change ports section to follow typec convention of hs/ss/sbu

 .../boot/dts/rockchip/rk3588s-orangepi-5.dts  | 94 +++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
index 25de4362af38..c61898355f3e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
@@ -6,6 +6,7 @@
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/usb/pd.h>
 #include "rk3588s.dtsi"
 
 / {
@@ -212,6 +213,56 @@ &i2c6 {
 	pinctrl-0 = <&i2c6m3_xfer>;
 	status = "okay";
 
+	usbc0: usb-typec@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usbc0_int>;
+		vbus-supply = <&vbus_typec>;
+		status = "okay";
+
+		usb_con: connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+			data-role = "dual";
+			op-sink-microwatt = <1000000>;
+			power-role = "dual";
+			sink-pdos =
+				<PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
+			source-pdos =
+				<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			try-power-role = "source";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					usbc0_hs: endpoint {
+						remote-endpoint = <&usb_host0_xhci_drd_sw>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					usbc0_ss: endpoint {
+						remote-endpoint = <&usbdp_phy0_typec_ss>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					usbc0_sbu: endpoint {
+						remote-endpoint = <&usbdp_phy0_typec_sbu>;
+					};
+				};
+			};
+		};
+	};
+
 	hym8563: rtc@51 {
 		compatible = "haoyu,hym8563";
 		reg = <0x51>;
@@ -625,6 +676,14 @@ &tsadc {
 	status = "okay";
 };
 
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy0_otg {
+	status = "okay";
+};
+
 &u2phy2 {
 	status = "okay";
 };
@@ -646,6 +705,29 @@ &uart2 {
 	status = "okay";
 };
 
+&usbdp_phy0 {
+	mode-switch;
+	orientation-switch;
+	sbu1-dc-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
+	sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbdp_phy0_typec_ss: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&usbc0_ss>;
+		};
+
+		usbdp_phy0_typec_sbu: endpoint@1 {
+			reg = <1>;
+			remote-endpoint = <&usbc0_sbu>;
+		};
+	};
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
@@ -654,6 +736,18 @@ &usb_host0_ohci {
 	status = "okay";
 };
 
+&usb_host0_xhci {
+	dr_mode = "otg";
+	usb-role-switch;
+	status = "okay";
+
+	port {
+		usb_host0_xhci_drd_sw: endpoint {
+			remote-endpoint = <&usbc0_hs>;
+		};
+	};
+};
+
 &usb_host1_ehci {
 	status = "okay";
 };
-- 
2.44.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
@ 2024-04-18  3:52 ` Jimmy Hon
  0 siblings, 0 replies; 8+ messages in thread
From: Jimmy Hon @ 2024-04-18  3:52 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: linux-rockchip, linux-arm-kernel, Jimmy Hon

Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI
or XHCI mode. Displayport AltMode is not yet supported.

Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
---
v2: change ports section to follow typec convention of hs/ss/sbu

 .../boot/dts/rockchip/rk3588s-orangepi-5.dts  | 94 +++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
index 25de4362af38..c61898355f3e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
@@ -6,6 +6,7 @@
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/usb/pd.h>
 #include "rk3588s.dtsi"
 
 / {
@@ -212,6 +213,56 @@ &i2c6 {
 	pinctrl-0 = <&i2c6m3_xfer>;
 	status = "okay";
 
+	usbc0: usb-typec@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usbc0_int>;
+		vbus-supply = <&vbus_typec>;
+		status = "okay";
+
+		usb_con: connector {
+			compatible = "usb-c-connector";
+			label = "USB-C";
+			data-role = "dual";
+			op-sink-microwatt = <1000000>;
+			power-role = "dual";
+			sink-pdos =
+				<PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>;
+			source-pdos =
+				<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+			try-power-role = "source";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					usbc0_hs: endpoint {
+						remote-endpoint = <&usb_host0_xhci_drd_sw>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					usbc0_ss: endpoint {
+						remote-endpoint = <&usbdp_phy0_typec_ss>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					usbc0_sbu: endpoint {
+						remote-endpoint = <&usbdp_phy0_typec_sbu>;
+					};
+				};
+			};
+		};
+	};
+
 	hym8563: rtc@51 {
 		compatible = "haoyu,hym8563";
 		reg = <0x51>;
@@ -625,6 +676,14 @@ &tsadc {
 	status = "okay";
 };
 
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy0_otg {
+	status = "okay";
+};
+
 &u2phy2 {
 	status = "okay";
 };
@@ -646,6 +705,29 @@ &uart2 {
 	status = "okay";
 };
 
+&usbdp_phy0 {
+	mode-switch;
+	orientation-switch;
+	sbu1-dc-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
+	sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usbdp_phy0_typec_ss: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&usbc0_ss>;
+		};
+
+		usbdp_phy0_typec_sbu: endpoint@1 {
+			reg = <1>;
+			remote-endpoint = <&usbc0_sbu>;
+		};
+	};
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
@@ -654,6 +736,18 @@ &usb_host0_ohci {
 	status = "okay";
 };
 
+&usb_host0_xhci {
+	dr_mode = "otg";
+	usb-role-switch;
+	status = "okay";
+
+	port {
+		usb_host0_xhci_drd_sw: endpoint {
+			remote-endpoint = <&usbc0_hs>;
+		};
+	};
+};
+
 &usb_host1_ehci {
 	status = "okay";
 };
-- 
2.44.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
  2024-04-18  3:52 ` Jimmy Hon
@ 2024-04-18 18:29   ` Rob Herring
  -1 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2024-04-18 18:29 UTC (permalink / raw)
  To: Jimmy Hon; +Cc: linux-arm-kernel, Heiko Stuebner, linux-rockchip


On Wed, 17 Apr 2024 22:52:33 -0500, Jimmy Hon wrote:
> Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI
> or XHCI mode. Displayport AltMode is not yet supported.
> 
> Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
> ---
> v2: change ports section to follow typec convention of hs/ss/sbu
> 
>  .../boot/dts/rockchip/rk3588s-orangepi-5.dts  | 94 +++++++++++++++++++
>  1 file changed, 94 insertions(+)
> 


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/rk3588s-orangepi-5.dtb' for 20240418035232.35344-2-honyuenkwun@gmail.com:

arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: gpio-func: leds-gpio: {'rockchip,pins': [[0, 2, 0, 231]], 'phandle': [[239]]} is not of type 'array'
	from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml#






_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
@ 2024-04-18 18:29   ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2024-04-18 18:29 UTC (permalink / raw)
  To: Jimmy Hon; +Cc: linux-arm-kernel, Heiko Stuebner, linux-rockchip


On Wed, 17 Apr 2024 22:52:33 -0500, Jimmy Hon wrote:
> Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI
> or XHCI mode. Displayport AltMode is not yet supported.
> 
> Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
> ---
> v2: change ports section to follow typec convention of hs/ss/sbu
> 
>  .../boot/dts/rockchip/rk3588s-orangepi-5.dts  | 94 +++++++++++++++++++
>  1 file changed, 94 insertions(+)
> 


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/rk3588s-orangepi-5.dtb' for 20240418035232.35344-2-honyuenkwun@gmail.com:

arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: gpio-func: leds-gpio: {'rockchip,pins': [[0, 2, 0, 231]], 'phandle': [[239]]} is not of type 'array'
	from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml#






_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
  2024-04-18 18:29   ` Rob Herring
@ 2024-04-26 22:49     ` Jimmy Hon
  -1 siblings, 0 replies; 8+ messages in thread
From: Jimmy Hon @ 2024-04-26 22:49 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-arm-kernel, Heiko Stuebner, linux-rockchip

Resend as plain-text

On Thu, Apr 18, 2024 at 1:29 PM Rob Herring <robh@kernel.org> wrote:
>
> New warnings running 'make CHECK_DTBS=y rockchip/rk3588s-orangepi-5.dtb' for 20240418035232.35344-2-honyuenkwun@gmail.com:
>
> arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: gpio-func: leds-gpio: {'rockchip,pins': [[0, 2, 0, 231]], 'phandle': [[239]]} is not of type 'array'
>         from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml#
>

That doesn't look like a "new" warning.

When I run the check on tag v6.10-rockchip-dts64-1, there is an
existing error for leds-gpio.

  DTC_CHK arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: /gpu@fb000000:
failed to match any schema with compatible: ['rockchip,rk3588-mali',
'arm,mali-valhall-csf']
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: /gpu@fb000000:
failed to match any schema with compatible: ['rockchip,rk3588-mali',
'arm,mali-valhall-csf']
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: /phy@fed80000:
failed to match any schema with compatible:
['rockchip,rk3588-usbdp-phy']
/home/jimmy/linux-rk3588/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb:
gpio-func: leds-gpio: {'rockchip,pins': [[0, 2, 0, 222]], 'phandle':
[[230]]} is not of type 'array'
from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml#
/home/jimmy/linux-rk3588/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb:
vcc-3v3-sd-s0-regulator: Unevaluated properties are not allowed
('enable-active-low' was unexpected)
from schema $id: http://devicetree.org/schemas/regulator/fixed-regulator.yaml#

Jimmy

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
@ 2024-04-26 22:49     ` Jimmy Hon
  0 siblings, 0 replies; 8+ messages in thread
From: Jimmy Hon @ 2024-04-26 22:49 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-arm-kernel, Heiko Stuebner, linux-rockchip

Resend as plain-text

On Thu, Apr 18, 2024 at 1:29 PM Rob Herring <robh@kernel.org> wrote:
>
> New warnings running 'make CHECK_DTBS=y rockchip/rk3588s-orangepi-5.dtb' for 20240418035232.35344-2-honyuenkwun@gmail.com:
>
> arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: gpio-func: leds-gpio: {'rockchip,pins': [[0, 2, 0, 231]], 'phandle': [[239]]} is not of type 'array'
>         from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml#
>

That doesn't look like a "new" warning.

When I run the check on tag v6.10-rockchip-dts64-1, there is an
existing error for leds-gpio.

  DTC_CHK arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: /gpu@fb000000:
failed to match any schema with compatible: ['rockchip,rk3588-mali',
'arm,mali-valhall-csf']
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: /gpu@fb000000:
failed to match any schema with compatible: ['rockchip,rk3588-mali',
'arm,mali-valhall-csf']
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb: /phy@fed80000:
failed to match any schema with compatible:
['rockchip,rk3588-usbdp-phy']
/home/jimmy/linux-rk3588/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb:
gpio-func: leds-gpio: {'rockchip,pins': [[0, 2, 0, 222]], 'phandle':
[[230]]} is not of type 'array'
from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml#
/home/jimmy/linux-rk3588/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dtb:
vcc-3v3-sd-s0-regulator: Unevaluated properties are not allowed
('enable-active-low' was unexpected)
from schema $id: http://devicetree.org/schemas/regulator/fixed-regulator.yaml#

Jimmy

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
  2024-04-18  3:52 ` Jimmy Hon
@ 2024-05-03 11:38   ` Heiko Stuebner
  -1 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2024-05-03 11:38 UTC (permalink / raw)
  To: Jimmy Hon; +Cc: Heiko Stuebner, linux-rockchip, linux-arm-kernel

On Wed, 17 Apr 2024 22:52:33 -0500, Jimmy Hon wrote:
> Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI
> or XHCI mode. Displayport AltMode is not yet supported.
> 
> 

Applied, thanks!

[1/1] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
      commit: c57d1a970275aabfbfab4c56001394ada3456d8e

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
@ 2024-05-03 11:38   ` Heiko Stuebner
  0 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2024-05-03 11:38 UTC (permalink / raw)
  To: Jimmy Hon; +Cc: Heiko Stuebner, linux-rockchip, linux-arm-kernel

On Wed, 17 Apr 2024 22:52:33 -0500, Jimmy Hon wrote:
> Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI
> or XHCI mode. Displayport AltMode is not yet supported.
> 
> 

Applied, thanks!

[1/1] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support
      commit: c57d1a970275aabfbfab4c56001394ada3456d8e

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-05-03 11:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  3:52 [PATCH v2] arm64: dts: rockchip: rk3588s-orangepi-5: add USB-C support Jimmy Hon
2024-04-18  3:52 ` Jimmy Hon
2024-04-18 18:29 ` Rob Herring
2024-04-18 18:29   ` Rob Herring
2024-04-26 22:49   ` Jimmy Hon
2024-04-26 22:49     ` Jimmy Hon
2024-05-03 11:38 ` Heiko Stuebner
2024-05-03 11:38   ` Heiko Stuebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.