xref: /linux/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2020 Arm Ltd.
4 *
5 * DT nodes common between Orange Pi Zero 2 and Orange Pi Zero 3.
6 * Excludes PMIC nodes and properties, since they are different between the two.
7 */
8
9#include "sun50i-h616.dtsi"
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/interrupt-controller/arm-gic.h>
13#include <dt-bindings/leds/common.h>
14
15/ {
16	aliases {
17		ethernet0 = &emac0;
18		serial0 = &uart0;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24
25	leds {
26		compatible = "gpio-leds";
27
28		led-0 {
29			function = LED_FUNCTION_POWER;
30			color = <LED_COLOR_ID_RED>;
31			gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
32			default-state = "on";
33		};
34
35		led-1 {
36			function = LED_FUNCTION_STATUS;
37			color = <LED_COLOR_ID_GREEN>;
38			gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
39		};
40	};
41
42	reg_vcc5v: vcc5v {
43		/* board wide 5V supply directly from the USB-C socket */
44		compatible = "regulator-fixed";
45		regulator-name = "vcc-5v";
46		regulator-min-microvolt = <5000000>;
47		regulator-max-microvolt = <5000000>;
48		regulator-always-on;
49	};
50
51	reg_usb1_vbus: regulator-usb1-vbus {
52		compatible = "regulator-fixed";
53		regulator-name = "usb1-vbus";
54		regulator-min-microvolt = <5000000>;
55		regulator-max-microvolt = <5000000>;
56		vin-supply = <&reg_vcc5v>;
57		enable-active-high;
58		gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
59	};
60};
61
62&codec {
63	allwinner,audio-routing = "Line Out", "LINEOUT";
64	status = "okay";
65};
66
67&ehci1 {
68	status = "okay";
69};
70
71/* USB 2 & 3 are on headers only. */
72
73&emac0 {
74	pinctrl-names = "default";
75	pinctrl-0 = <&ext_rgmii_pins>;
76	phy-handle = <&ext_rgmii_phy>;
77	status = "okay";
78};
79
80&mdio0 {
81	ext_rgmii_phy: ethernet-phy@1 {
82		compatible = "ethernet-phy-ieee802.3-c22";
83		reg = <1>;
84	};
85};
86
87&mmc0 {
88	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;	/* PF6 */
89	disable-wp;
90	bus-width = <4>;
91	status = "okay";
92};
93
94&ohci1 {
95	status = "okay";
96};
97
98&spi0  {
99	status = "okay";
100	pinctrl-names = "default";
101	pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
102
103	flash@0 {
104		#address-cells = <1>;
105		#size-cells = <1>;
106		compatible = "jedec,spi-nor";
107		reg = <0>;
108		spi-max-frequency = <40000000>;
109	};
110};
111
112&uart0 {
113	pinctrl-names = "default";
114	pinctrl-0 = <&uart0_ph_pins>;
115	status = "okay";
116};
117
118&usbotg {
119	/*
120	 * PHY0 pins are connected to a USB-C socket, but a role switch
121	 * is not implemented: both CC pins are pulled to GND.
122	 * The VBUS pins power the device, so a fixed peripheral mode
123	 * is the best choice.
124	 * The board can be powered via GPIOs, in this case port0 *can*
125	 * act as a host (with a cable/adapter ignoring CC), as VBUS is
126	 * then provided by the GPIOs. Any user of this setup would
127	 * need to adjust the DT accordingly: dr_mode set to "host",
128	 * enabling OHCI0 and EHCI0.
129	 */
130	dr_mode = "peripheral";
131	status = "okay";
132};
133
134&usbphy {
135	usb1_vbus-supply = <&reg_usb1_vbus>;
136	status = "okay";
137};
138