arm64: dts: ti: k3-am62p: add the USB sub-system
authorRoger Quadros <rogerq@kernel.org>
Fri, 12 Apr 2024 12:01:59 +0000 (15:01 +0300)
committerNishanth Menon <nm@ti.com>
Mon, 29 Apr 2024 19:35:28 +0000 (14:35 -0500)
There are two USB instances available on the am62p5 starter kit. Include
and enable them for use on the board.

USB LPM feature is kept disabled as it is not supported.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240412-for-v6-10-am62-usb-typec-dt-v7-2-93b827adf97e@kernel.org
Signed-off-by: Nishanth Menon <nm@ti.com>
arch/arm64/boot/dts/ti/k3-am62p-main.dtsi
arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi
arch/arm64/boot/dts/ti/k3-am62p5-sk.dts

index 88bc64111234b907ef2dd25fa661e1639aef0f23..900d1f9530a2a118cb3d40005e115050d0182d11 100644 (file)
                status = "disabled";
        };
 
+       usbss0: usb@f900000 {
+               compatible = "ti,am62-usb";
+               reg = <0x00 0x0f900000 0x00 0x800>,
+                     <0x00 0x0f908000 0x00 0x400>;
+               clocks = <&k3_clks 161 3>;
+               clock-names = "ref";
+               ti,syscon-phy-pll-refclk = <&usb0_phy_ctrl 0x0>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               power-domains = <&k3_pds 178 TI_SCI_PD_EXCLUSIVE>;
+               ranges;
+               status = "disabled";
+
+               usb0: usb@31000000 {
+                       compatible = "snps,dwc3";
+                       reg = <0x00 0x31000000 0x00 0x50000>;
+                       interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>, /* irq.0 */
+                       <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>; /* irq.0 */
+                       interrupt-names = "host", "peripheral";
+                       maximum-speed = "high-speed";
+                       dr_mode = "otg";
+                       snps,usb2-gadget-lpm-disable;
+                       snps,usb2-lpm-disable;
+               };
+       };
+
+       usbss1: usb@f910000 {
+               compatible = "ti,am62-usb";
+               reg = <0x00 0x0f910000 0x00 0x800>,
+                     <0x00 0x0f918000 0x00 0x400>;
+               clocks = <&k3_clks 162 3>;
+               clock-names = "ref";
+               ti,syscon-phy-pll-refclk = <&usb1_phy_ctrl 0x0>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               power-domains = <&k3_pds 179 TI_SCI_PD_EXCLUSIVE>;
+               ranges;
+               status = "disabled";
+
+               usb1: usb@31100000 {
+                       compatible = "snps,dwc3";
+                       reg = <0x00 0x31100000 0x00 0x50000>;
+                       interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>, /* irq.0 */
+                       <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>; /* irq.0 */
+                       interrupt-names = "host", "peripheral";
+                       maximum-speed = "high-speed";
+                       dr_mode = "otg";
+                       snps,usb2-gadget-lpm-disable;
+                       snps,usb2-lpm-disable;
+               };
+       };
+
        fss: bus@fc00000 {
                compatible = "simple-bus";
                reg = <0x00 0x0fc00000 0x00 0x70000>;
index a84756c336d0569081d2f382984ff95141ac7319..c71d9624ea27712c6034679d0ea8fe31395bdc20 100644 (file)
                        reg = <0x14 0x4>;
                        bootph-all;
                };
+
+               usb0_phy_ctrl: syscon@4008 {
+                       compatible = "ti,am62-usb-phy-ctrl", "syscon";
+                       reg = <0x4008 0x4>;
+               };
+
+               usb1_phy_ctrl: syscon@4018 {
+                       compatible = "ti,am62-usb-phy-ctrl", "syscon";
+                       reg = <0x4018 0x4>;
+               };
        };
 
        wkup_uart0: serial@2b300000 {
index 6a9c99c5fb2a22d82d33d12639ca64fa03de78d0..6e72346591113d8677f0a6e462bd53f05eca604c 100644 (file)
@@ -27,6 +27,8 @@
                spi0 = &ospi0;
                ethernet0 = &cpsw_port1;
                ethernet1 = &cpsw_port2;
+               usb0 = &usb0;
+               usb1 = &usb1;
        };
 
        chosen {
                bootph-all;
        };
 
+       main_usb1_pins_default: main-usb1-default-pins {
+               pinctrl-single,pins = <
+                       AM62PX_IOPAD(0x0258, PIN_INPUT, 0) /* (G21) USB1_DRVVBUS */
+               >;
+       };
+
        main_wlirq_pins_default: main-wlirq-default-pins {
                pinctrl-single,pins = <
                        AM62PX_IOPAD(0x0128, PIN_INPUT, 7) /* (K25) MMC2_SDWP.GPIO0_72 */
        };
 };
 
+&main_i2c0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&main_i2c0_pins_default>;
+       clock-frequency = <400000>;
+
+       typec_pd0: usb-power-controller@3f {
+               compatible = "ti,tps6598x";
+               reg = <0x3f>;
+
+               connector {
+                       compatible = "usb-c-connector";
+                       label = "USB-C";
+                       self-powered;
+                       data-role = "dual";
+                       power-role = "sink";
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               port@0 {
+                                       reg = <0>;
+                                       usb_con_hs: endpoint {
+                                               remote-endpoint = <&usb0_hs_ep>;
+                                       };
+                               };
+                       };
+               };
+       };
+};
+
 &main_i2c1 {
        status = "okay";
        pinctrl-names = "default";
        };
 };
 
+&usbss0 {
+       status = "okay";
+       ti,vbus-divider;
+};
+
+&usbss1 {
+       status = "okay";
+       ti,vbus-divider;
+};
+
+&usb0 {
+       usb-role-switch;
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       port@0 {
+               reg = <0>;
+               usb0_hs_ep: endpoint {
+                       remote-endpoint = <&usb_con_hs>;
+               };
+       };
+};
+
+&usb1 {
+       dr_mode = "host";
+       pinctrl-names = "default";
+       pinctrl-0 = <&main_usb1_pins_default>;
+};
+
 &mcasp1 {
        status = "okay";
        #sound-dai-cells = <0>;