riscv: dts: spacemit: add DWC3/USB3 and related PHY nodes 68/317068/1
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 3 Sep 2024 09:15:50 +0000 (11:15 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 3 Sep 2024 10:51:32 +0000 (12:51 +0200)
Add device tree nodes needed for the DWC3/USB3 host ports related
drivers. Ported from the vendor kernel [1].

[1] - https://github.com/BPI-SINOVOIP/pi-linux.git

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I0fe6fede371aaa7e4d8c2de79ac6d4d18bbc2721

arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
arch/riscv/boot/dts/spacemit/k1.dtsi

index 47409cb1e6d5e9dd9a7df4100dddc0abb46d9f50..4fb66ecefbac891c9db5aaa8709aa7ca11ed3ed2 100644 (file)
 &imggpu {
        status = "okay";
 };
+
+&usb2phy {
+       status = "okay";
+};
+
+&combphy {
+       status = "okay";
+};
+
+&usb3hub {
+       hub-gpios = <
+               &gpio 123 0     /* usb3 hub en */
+               &gpio 124 0>;   /* usb3 hub rst*/
+       vbus-gpios = <&gpio 97 0>;      /* gpio_97 for usb3 hub output vbus */
+       status = "okay";
+};
+
+&usbdrd3 {
+       status = "okay";
+       dwc3@c0a00000 {
+               dr_mode = "host";
+               phy_type = "utmi";
+               snps,hsphy_interface = "utmi";
+               snps,dis_enblslpm_quirk;
+               snps,dis-u1u2-quirk;
+               snps,dis-u2-freeclk-exists-quirk;
+               snps,dis-del-phy-power-chg-quirk;
+               snps,dis_u2_susphy_quirk;
+               snps,dis_u3_susphy_quirk;
+               snps,dis_rxdet_inp3_quirk;
+               snps,xhci-trb-ent-quirk;
+       };
+};
index 17bc7f6fca1c446de26f2fb3119018ae4fd51926..11471aa3b6d8a9801e1e4cc55ac5bb5c13265079 100644 (file)
@@ -9,6 +9,7 @@
 #include <dt-bindings/dma/k1x-dmac.h>
 #include <dt-bindings/pmu/k1x_pmu.h>
 #include <dt-bindings/display/spacemit-dpu.h>
+#include <dt-bindings/phy/phy.h>
 
 /dts-v1/;
 / {
                        interconnect-names = "dma-mem";
                        status = "ok";
                };
+
+               combphy: phy@c0b10000{
+                       compatible = "spacemit,k1x-combphy";
+                       reg = <0x0 0xc0b10000 0x0 0x800>,
+                                 <0x0 0xd4282910 0x0 0x400>;
+                       reg-names = "puphy", "phy_sel";
+                       resets = <&reset RESET_PCIE0>;
+                       reset-names = "phy_rst";
+                       #phy-cells = <1>;
+                       status = "disabled";
+               };
+
+               usb2phy: usb2phy@0xc0a30000 {
+                       compatible = "spacemit,usb2-phy";
+                       reg = <0x0 0xc0a30000  0x0 0x200>;
+                       spacemit,handle_connect_change;
+                       clocks = <&ccu CLK_USB30>;
+                       status = "disabled";
+               };
+
+               usb3hub: usb3hub@0 {
+                       compatible = "spacemit,usb3-hub";
+                       status = "disabled";
+               };
+
+               usbdrd3: usb3@0 {
+                       compatible = "spacemit,k1-x-dwc3";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       resets = <&reset RESET_USB3_0>;
+                       reset-names = "ctl_rst";
+                       clocks = <&ccu CLK_USB30>;
+                       clock-names = "usbdrd30";
+                       interrupt-parent = <&plic>;
+                       interrupts = <149>;
+                       ranges;
+                       interconnects = <&dram_range0>;
+                       interconnect-names = "dma-mem";
+                       status = "disabled";
+
+                       dwc3@c0a00000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x0 0xc0a00000 0x0 0x10000>;
+                               interrupt-parent = <&plic>;
+                               interrupts = <125>;
+                               phys = <&combphy PHY_TYPE_USB3>;
+                               phy-names = "usb3-phy";
+                               usb-phy = <&usb2phy>;
+                       };
+               };
+
        };
 };