From 7e7bac722ddbd2fc9ba5c5916929cdd2507b97af Mon Sep 17 00:00:00 2001 From: Lad Prabhakar Date: Thu, 4 Sep 2025 11:04:35 +0100 Subject: [PATCH] arm64: dts: renesas: rzt2h-n2h-evk: Enable USB2.0 support Enable USB2.0 support on RZ/T2H and RZ/N2H EVKs. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://patch.msgid.link/20250904100435.4033858-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven --- .../dts/renesas/r9a09g077m44-rzt2h-evk.dts | 36 ++++++++++++++++ .../dts/renesas/r9a09g087m44-rzn2h-evk.dts | 41 +++++++++++++++++++ .../dts/renesas/rzt2h-n2h-evk-common.dtsi | 22 ++++++++++ 3 files changed, 99 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts index 264f7ddb8cc5d..2bf867273ad0b 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts +++ b/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts @@ -29,6 +29,28 @@ */ #define SD1_MICRO_SD 1 +/* + * USB Pin Configuration: + * + * This board is equipped with three USB connectors: Type-A (CN80), Mini-B + * (CN79), and Micro-AB (CN33). The RZ/T2H SoC has a single USB channel, so + * either the USB host interface or the USB function interface can be used, + * but not both simultaneously when using the CN79 and CN80 connectors. + * + * By default, the Type-A (CN80) and Mini-B (CN79) connectors are enabled. + * Configure the switches as follows: + * - P00_0 - P00_2 (control signals for USB power supply): SW1[5] = ON + * - USB_VBUSIN (used for USB function): SW7[7] = OFF; SW7[8] = ON + * - USB_VBUSEN (used for USB_HF_VBUSEN): SW7[9] = OFF; SW7[10] = ON + * + * To enable the Micro-AB (CN33) USB OTG connector, set the following macro + * to 1 and configure the switches as follows: + * - P00_0 - P00_2 (control signals for USB power supply): SW1[5] = ON + * - USB_VBUSIN (used for USB OTG): SW7[7] = ON; SW7[8] = OFF + * - USB_VBUSEN (used for USB_OTG_VBUSEN): SW7[9] = ON; SW7[10] = OFF + */ +#define USB_OTG 0 + #include "rzt2h-n2h-evk-common.dtsi" / { @@ -145,4 +167,18 @@ pinmux = , /* SDA */ ; /* SCL */ }; + +#if USB_OTG + usb-exicen-hog { + gpio-hog; + gpios = ; + output-high; + line-name = "usb_exicen_a"; + }; +#endif + + usb_pins: usb-pins { + pinmux = , /* VBUSEN */ + ; /* OVRCUR */ + }; }; diff --git a/arch/arm64/boot/dts/renesas/r9a09g087m44-rzn2h-evk.dts b/arch/arm64/boot/dts/renesas/r9a09g087m44-rzn2h-evk.dts index 80f358fb2d742..084b3a0c80524 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g087m44-rzn2h-evk.dts +++ b/arch/arm64/boot/dts/renesas/r9a09g087m44-rzn2h-evk.dts @@ -33,6 +33,33 @@ */ #define SD1_MICRO_SD 1 +/* + * USB Pin Configuration: + * + * This board is equipped with three USB connectors: Type-A (CN7), Mini-B + * (CN8), and Micro-AB (CN9). The RZ/N2H SoC has a single USB channel, so + * either the USB host interface or the USB function interface can be used, + * but not both simultaneously when using the CN7 and CN8 connectors. + * + * By default, the Type-A (CN7) and Mini-B (CN8) connectors are enabled. + * Configure the switches as follows: + * - P02_2 - P02_3 (control signals for USB power supply): DSW2[6] = OFF; + * - P02_2 (used for VBUSEN): DSW14[5] = OFF; DSW14[6] = ON + * - P02_3 (used for USB_OVRCUR): DSW14[1] = OFF; DSW14[2] = ON + * - USB_VBUSIN (used for VBUS of CN8): DSW16[1] = OFF; DSW16[2] = ON + * - USB_VBUSEN (used for USB_HF_VBUSEN): DSW16[3] = OFF; DSW16[4] = ON + * + * To enable the Micro-AB (CN9) USB OTG connector, set the following macro + * to 1 and configure the switches as follows: + * - P02_2 - P02_3 (control signals for USB power supply): DSW2[6] = OFF; + * - P02_2 (used for VBUSEN): DSW14[5] = OFF; DSW14[6] = ON + * - P02_3 (used for USB_OVRCUR): DSW14[1] = OFF; DSW14[2] = ON + * - USB_VBUSIN (used for VBUS for OTG): DSW16[1] = ON; DSW16[2] = OFF + * - USB_VBUSEN (used for USB_OTG_VBUSEN): DSW16[3] = ON; DSW16[4] = OFF + * - USB_EXICEN (used for USB OTG EXICEN): DSW14[3] = OFF; DSW14[4] = ON + */ +#define USB_OTG 0 + #include "rzt2h-n2h-evk-common.dtsi" /* @@ -185,4 +212,18 @@ pinmux = , ; }; + +#if USB_OTG + usb-exicen-hog { + gpio-hog; + gpios = ; + output-high; + line-name = "usb_exicen_a"; + }; +#endif + + usb_pins: usb-pins { + pinmux = , /* VBUSEN */ + ; /* OVRCUR */ + }; }; diff --git a/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi b/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi index 91068042bec05..5c91002c99c48 100644 --- a/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi +++ b/arch/arm64/boot/dts/renesas/rzt2h-n2h-evk-common.dtsi @@ -65,10 +65,20 @@ #endif }; +&ehci { + dr_mode = "otg"; + status = "okay"; +}; + &extal_clk { clock-frequency = <25000000>; }; +&hsusb { + dr_mode = "otg"; + status = "okay"; +}; + &i2c0 { eeprom: eeprom@50 { compatible = "renesas,r1ex24016", "atmel,24c16"; @@ -77,6 +87,11 @@ }; }; +&ohci { + dr_mode = "otg"; + status = "okay"; +}; + &pinctrl { /* * SCI0 Pin Configuration: @@ -218,6 +233,13 @@ }; #endif +&usb2_phy { + pinctrl-0 = <&usb_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + &wdt2 { status = "okay"; timeout-sec = <60>; -- 2.47.3