Skip to contentSkip to conversation

ARM: dts: sun9i: Enable USB support on Cubieboard4

PATCH New Mark Kettenis 3 participants 3 messages Dec 16, 2017 – Jan 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: sun9i: Enable USB support on Cubieboard4

On the Cubieboard4 HCI0 is directly connected to a USB connector, and HCI2 is connected to a USB hub on the board. HCI1 is available with HSIC throug 2 pins on the GPIO expansion header, but left disabled just like on the Optimus board.

This patch also adds the VBUS regulators.

---
 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +36 -0
index 4024639aa005..e38623265695 100644
@@ -74,6 +74,24 @@
 		};
 	};
 
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb2-drvbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
+	};
+
+	reg_usb3_vbus: usb3-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-drvbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		gpio = <&pio 7 14 GPIO_ACTIVE_HIGH>; /* PH14 */
+	};
+
 	wifi_pwrseq: wifi-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&ac100_rtc 1>;
@@ -83,6 +101,14 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ehci2 {
+	status = "okay";
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
@@ -408,3 +434,13 @@
 	pinctrl-0 = <&uart0_ph_pins>;
 	status = "okay";
 };
+
+&usbphy1 {
+	phy-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
+
+&usbphy3 {
+	phy-supply = <&reg_usb3_vbus>;
+	status = "okay";
+};
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/1 ARM: dts: sun9i: Enable USB support on Cubieboard4

Maxime,

Quoted 8 lines · Mark Kettenis

On the Cubieboard4 HCI0 is directly connected to a USB connector, and HCI2 is connected to a USB hub on the board. HCI1 is available with HSIC throug 2 pins on the GPIO expansion header, but left disabled just like on the Optimus board.

This patch also adds the VBUS regulators.

Any thoughts on this patch?

It's similar to what I sent a few years back:

    https://patchwork.kernel.org/patch/6359461/

ChenYu

Quoted 70 lines
---
 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +36 -1
index 4024639aa005..e38623265695 100644
@@ -74,6 +74,24 @@
                };
        };
 
+       reg_usb1_vbus: usb1-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb2-drvbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
+       };
+
+       reg_usb3_vbus: usb3-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb1-drvbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&pio 7 14 GPIO_ACTIVE_HIGH>; /* PH14 */
+       };
+
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
                clocks = <&ac100_rtc 1>;
@@ -83,6 +101,14 @@
        };
 };
 
+&ehci0 {
+       status = "okay";
+};
+
+&ehci2 {
+       status = "okay";
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
@@ -408,3 +434,13 @@
        pinctrl-0 = <&uart0_ph_pins>;
        status = "okay";
 };
+
+&usbphy1 {
+       phy-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
+
+&usbphy3 {
+       phy-supply = <&reg_usb3_vbus>;
+       status = "okay";
+};
--

2.15.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

PATCH 1/1 ARM: dts: sun9i: Enable USB support on Cubieboard4

Quoted 10 lines · Chen-Yu Tsai

Maxime,

Quoted 7 lines · Mark Kettenis

On the Cubieboard4 HCI0 is directly connected to a USB connector, and HCI2 is connected to a USB hub on the board. HCI1 is available with HSIC throug 2 pins on the GPIO expansion header, but left disabled just like on the Optimus board.

This patch also adds the VBUS regulators.

Quoted 7 lines
Quoted 1 line

Any thoughts on this patch?

It's similar to what I sent a few years back:

    https://patchwork.kernel.org/patch/6359461/

Given the previous discussion, I guess we should have much more comments on how it is designed.

There was some effort to have power sequence for USB devices described in the DT here:
https://patchwork.kernel.org/patch/9800887/

I guess pinging Peter to know the current state would be a good way forward.

Quoted 20 lines
Quoted 20 lines
 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +9 -0
index 4024639aa005..e38623265695 100644
@@ -74,6 +74,24 @@
                };
        };
 
+       reg_usb1_vbus: usb1-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb2-drvbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
+       };
+
Quoted 8 lines

arch/arm/boot/dts/sun9i-a80-cubieboard4.dts line 93

Quoted 8 lines
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +8 -0
+       reg_usb3_vbus: usb3-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb1-drvbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&pio 7 14 GPIO_ACTIVE_HIGH>; /* PH14 */
+       };

You should also have a proper parenthood relationship here, and not just leave these two regulators hanging around.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180122/1fd4e432/attachment.sig>