1 From 1bc12a9ae690a22a525f9b71778022bb4533fec1 Mon Sep 17 00:00:00 2001
2 From: Andre Przywara <andre.przywara@arm.com>
3 Date: Wed, 16 Jun 2021 18:32:36 +0100
4 Subject: [PATCH 5005/5006] arm64: dts: allwinner: h616: OrangePi Zero 2: Add
7 The OrangePi Zero 2 has one USB-A host port, VBUS is provided by
8 a GPIO controlled regulator.
9 The USB-C port is meant to power the board, but is also connected to
10 the USB 0 port, which we configure as an MUSB peripheral.
12 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
14 .../allwinner/sun50i-h616-orangepi-zero2.dts | 41 +++++++++++++++++++
15 1 file changed, 41 insertions(+)
17 diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
18 index 02893f3ac99d..cb8600d0ea1e 100644
19 --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
20 +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
22 regulator-max-microvolt = <5000000>;
26 + reg_usb1_vbus: regulator-usb1-vbus {
27 + compatible = "regulator-fixed";
28 + regulator-name = "usb1-vbus";
29 + regulator-min-microvolt = <5000000>;
30 + regulator-max-microvolt = <5000000>;
31 + vin-supply = <®_vcc5v>;
33 + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
41 +/* USB 2 & 3 are on headers only. */
44 pinctrl-names = "default";
45 pinctrl-0 = <&ext_rgmii_pins>;
58 pinctrl-0 = <&uart0_ph_pins>;
64 + * PHY0 pins are connected to a USB-C socket, but a role switch
65 + * is not implemented: both CC pins are pulled to GND.
66 + * The VBUS pins power the device, so a fixed peripheral mode
67 + * is the best choice.
68 + * The board can be powered via GPIOs, in this case port0 *can*
69 + * act as a host (with a cable/adapter ignoring CC), as VBUS is
70 + * then provided by the GPIOs. Any user of this setup would
71 + * need to adjust the DT accordingly: dr_mode set to "host",
72 + * enabling OHCI0 and EHCI0.
74 + dr_mode = "peripheral";
79 + usb1_vbus-supply = <®_usb1_vbus>;