Skip to content

Commit

Permalink
ARM: dts: sun8i: r40: add usb0 dual role support
Browse files Browse the repository at this point in the history
R40 SoC has 2 host controllers (EHCI and OHCI) and one peripheral
controller (USB OTG) for USB0 port.

Add ehci0, ohci0 and usbotg nodes. Also properly link the
controllers with each other and with usb0 phy.
  • Loading branch information
evgeny-boger committed Jan 29, 2022
1 parent 796285b commit 359abbb
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions arch/arm/boot/dts/sun8i-r40.dtsi
Expand Up @@ -358,6 +358,21 @@
#size-cells = <0>;
};

usb_otg: usb@1c13000 {
compatible = "allwinner,sun8i-r40-musb";
reg = <0x01c13000 0x0400>;
clocks = <&ccu CLK_BUS_OTG>;
resets = <&ccu RST_BUS_OTG>;
interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "mc";
host-controllers = <&ehci0>, <&ohci0>;
phys = <&usbphy 0>;
phy-names = "usb";
extcon = <&usbphy 0>;
status = "disabled";
};


usbphy: phy@1c13400 {
compatible = "allwinner,sun8i-r40-usb-phy";
reg = <0x01c13400 0x14>,
Expand All @@ -380,6 +395,8 @@
reset-names = "usb0_reset",
"usb1_reset",
"usb2_reset";
port0-host-controllers = <&ehci0>, <&ohci0>;
port0-peripheral-controllers = <&usb_otg>;
status = "disabled";
#phy-cells = <1>;
};
Expand Down Expand Up @@ -416,12 +433,37 @@
status = "disabled";
};

ehci0: usb@1c14000 {
compatible = "allwinner,sun8i-r40-ehci", "generic-ehci";
reg = <0x01c14000 0x100>;
interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_EHCI0>;
resets = <&ccu RST_BUS_EHCI0>;
companion = <&ohci0>;
phys = <&usbphy 0>;
phy-names = "usb";
status = "disabled";
};

ohci0: usb@1c14400 {
compatible = "allwinner,sun8i-r40-ohci", "generic-ohci";
reg = <0x01c14400 0x100>;
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_OHCI0>,
<&ccu CLK_USB_OHCI0>;
resets = <&ccu RST_BUS_OHCI0>;
phys = <&usbphy 0>;
phy-names = "usb";
status = "disabled";
};

ehci1: usb@1c19000 {
compatible = "allwinner,sun8i-r40-ehci", "generic-ehci";
reg = <0x01c19000 0x100>;
interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_EHCI1>;
resets = <&ccu RST_BUS_EHCI1>;
companion = <&ohci1>;
phys = <&usbphy 1>;
phy-names = "usb";
status = "disabled";
Expand All @@ -445,6 +487,7 @@
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_BUS_EHCI2>;
resets = <&ccu RST_BUS_EHCI2>;
companion = <&ohci2>;
phys = <&usbphy 2>;
phy-names = "usb";
status = "disabled";
Expand Down

0 comments on commit 359abbb

Please sign in to comment.