From: Marek Szyprowski Date: Thu, 29 Aug 2024 14:30:50 +0000 (+0200) Subject: riscv: dts: thead: Add devicetree nodes for DWC3 (host USB) controller X-Git-Tag: accepted/tizen/unified/x/20240830.151547~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4308eeb3ef9b95472f86f8753cef2ee40a069baa;p=platform%2Fkernel%2Flinux-thead.git riscv: dts: thead: Add devicetree nodes for DWC3 (host USB) controller Add DWC3 device controller and the needed glue nodes. Ported from vendor kernel [1]. [1] https://gitee.com/thead-yocto/kernel.git Signed-off-by: Marek Szyprowski Change-Id: I3e023ec8d778c44204fa2e67b107431fff36f035 --- diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts index 7eb123bdc2b9..059edc623924 100644 --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts @@ -32,6 +32,26 @@ chosen { stdout-path = "serial0:115200n8"; }; + + reg_usb_hub_vdd1v2: regulator-hub-vdd12-en { + compatible = "regulator-fixed"; + regulator-name = "regulator-hub-vdd12-en"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + gpio = <&pcal6408ahk_d 2 1>; + enable-active-high; + + }; + + reg_usb_hub_vcc5v: regulator-hub-vcc5v-en { + compatible = "regulator-fixed"; + regulator-name = "regulator-hub-vcc5v-en"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&pcal6408ahk_d 3 1>; + enable-active-high; + + }; }; &uart0 { @@ -204,3 +224,10 @@ pinctrl-0 = <&pinctrl_gmac1>; }; + +&usb_1 { + hubswitch-gpio = <&porte 4 0>; + vbus-supply = <&soc_vbus_en_reg>; + hub1v2-supply = <®_usb_hub_vdd1v2>; + hub5v-supply = <®_usb_hub_vcc5v>; +}; diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index 6a03e059f169..f8b217eb9e23 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -729,6 +729,12 @@ status = "okay"; }; + usb3_drd: usb3_drd@ffec03f000 { + compatible = "thead,light-usb3-drd", "syscon"; + reg = <0xff 0xec03f000 0x0 0x1000>; + status = "okay"; + }; + clk: clock-controller@ffef010000 { compatible = "thead,light-fm-ree-clk"; reg = <0xff 0xef010000 0x0 0x1000>; @@ -1129,5 +1135,34 @@ nvmem-cells = <&gmac1_mac_address>; nvmem-cell-names = "mac-address"; }; + + usb_1: usb@ffec03f000 { + compatible = "thead,dwc3"; + usb3-misc-regmap = <&miscsys_reg>; + usb3-drd-regmap = <&usb3_drd>; + clocks = <&miscsys_clk_gate CLKGEN_MISCSYS_USB3_DRD_CLK>, + <&miscsys_clk_gate CLKGEN_MISCSYS_USB3_DRD_CTRL_REF_CLK>, + <&miscsys_clk_gate CLKGEN_MISCSYS_USB3_DRD_PHY_REF_CLK>, + <&miscsys_clk_gate CLKGEN_MISCSYS_USB3_DRD_SUSPEND_CLK>; + clock-names = "drd", "ctrl", "phy", "suspend"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + usb: dwc3@ffe7040000 { + compatible = "snps,dwc3"; + reg = <0xff 0xe7040000 0x0 0x10000>; + interrupt-parent = <&plic>; + interrupts = <68 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + maximum-speed = "super-speed"; + dr_mode = "host"; + dma-mask = <0xf 0xffffffff>; + snps,usb3_lpm_capable; + snps,usb_sofitpsync; + status = "okay"; + }; + }; }; };