xref: /freebsd/sys/contrib/device-tree/src/arm64/allwinner/sun50i-h618-orangepi-zero2w.dts (revision 9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2023 Arm Ltd.
4 */
5
6/dts-v1/;
7
8#include "sun50i-h616.dtsi"
9#include "sun50i-h616-cpu-opp.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	model = "OrangePi Zero 2W";
17	compatible = "xunlong,orangepi-zero2w", "allwinner,sun50i-h618";
18
19	aliases {
20		serial0 = &uart0;
21	};
22
23	chosen {
24		stdout-path = "serial0:115200n8";
25	};
26
27	leds {
28		compatible = "gpio-leds";
29
30		led-0 {
31			function = LED_FUNCTION_STATUS;
32			color = <LED_COLOR_ID_GREEN>;
33			gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
34		};
35	};
36
37	reg_vcc5v: vcc5v {
38		/* board wide 5V supply directly from the USB-C socket */
39		compatible = "regulator-fixed";
40		regulator-name = "vcc-5v";
41		regulator-min-microvolt = <5000000>;
42		regulator-max-microvolt = <5000000>;
43		regulator-always-on;
44	};
45
46	reg_vcc3v3: vcc3v3 {
47		/* SY8089 DC/DC converter */
48		compatible = "regulator-fixed";
49		regulator-name = "vcc-3v3";
50		regulator-min-microvolt = <3300000>;
51		regulator-max-microvolt = <3300000>;
52		vin-supply = <&reg_vcc5v>;
53		regulator-always-on;
54	};
55};
56
57&codec {
58	allwinner,audio-routing = "Line Out", "LINEOUT";
59	status = "okay";
60};
61
62&cpu0 {
63	cpu-supply = <&reg_dcdc2>;
64};
65
66&ehci1 {
67	status = "okay";
68};
69
70/* USB 2 & 3 are on the FPC connector (or the exansion board) */
71
72&gpu {
73	mali-supply = <&reg_dcdc1>;
74	status = "okay";
75};
76
77&mmc0 {
78	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;	/* PF6 */
79	bus-width = <4>;
80	vmmc-supply = <&reg_vcc3v3>;
81	status = "okay";
82};
83
84&ohci1 {
85	status = "okay";
86};
87
88&pio {
89	vcc-pc-supply = <&reg_dldo1>;
90	vcc-pf-supply = <&reg_dldo1>;	/* internally via VCC-IO */
91	vcc-pg-supply = <&reg_aldo1>;
92	vcc-ph-supply = <&reg_dldo1>;	/* internally via VCC-IO */
93	vcc-pi-supply = <&reg_dldo1>;
94};
95
96&r_i2c {
97	status = "okay";
98
99	axp313: pmic@36 {
100		compatible = "x-powers,axp313a";
101		reg = <0x36>;
102		#interrupt-cells = <1>;
103		interrupt-controller;
104		interrupt-parent = <&pio>;
105		interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>;	/* PC9 */
106
107		vin1-supply = <&reg_vcc5v>;
108		vin2-supply = <&reg_vcc5v>;
109		vin3-supply = <&reg_vcc5v>;
110
111		regulators {
112			/* Supplies VCC-PLL and DRAM */
113			reg_aldo1: aldo1 {
114				regulator-always-on;
115				regulator-min-microvolt = <1800000>;
116				regulator-max-microvolt = <1800000>;
117				regulator-name = "vcc1v8";
118			};
119
120			/* Supplies VCC-IO, so needs to be always on. */
121			reg_dldo1: dldo1 {
122				regulator-always-on;
123				regulator-min-microvolt = <3300000>;
124				regulator-max-microvolt = <3300000>;
125				regulator-name = "vcc3v3";
126			};
127
128			reg_dcdc1: dcdc1 {
129				regulator-always-on;
130				regulator-min-microvolt = <810000>;
131				regulator-max-microvolt = <990000>;
132				regulator-name = "vdd-gpu-sys";
133			};
134
135			reg_dcdc2: dcdc2 {
136				regulator-always-on;
137				regulator-min-microvolt = <810000>;
138				regulator-max-microvolt = <1100000>;
139				regulator-name = "vdd-cpu";
140			};
141
142			reg_dcdc3: dcdc3 {
143				regulator-always-on;
144				regulator-min-microvolt = <1100000>;
145				regulator-max-microvolt = <1100000>;
146				regulator-name = "vdd-dram";
147			};
148		};
149	};
150};
151
152&spi0  {
153	status = "okay";
154	pinctrl-names = "default";
155	pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
156
157	flash@0 {
158		#address-cells = <1>;
159		#size-cells = <1>;
160		compatible = "jedec,spi-nor";
161		reg = <0>;
162		spi-max-frequency = <40000000>;
163	};
164};
165
166&uart0 {
167	pinctrl-names = "default";
168	pinctrl-0 = <&uart0_ph_pins>;
169	status = "okay";
170};
171
172&usbotg {
173	/*
174	 * PHY0 pins are connected to a USB-C socket, but a role switch
175	 * is not implemented: both CC pins are pulled to GND.
176	 * The VBUS pins power the device, so a fixed peripheral mode
177	 * is the best choice.
178	 * The board can be powered via GPIOs, in this case port0 *can*
179	 * act as a host (with a cable/adapter ignoring CC), as VBUS is
180	 * then provided by the GPIOs. Any user of this setup would
181	 * need to adjust the DT accordingly: dr_mode set to "host",
182	 * enabling OHCI0 and EHCI0.
183	 */
184	dr_mode = "peripheral";
185	status = "okay";
186};
187
188&usbphy {
189	usb1_vbus-supply = <&reg_vcc5v>;
190	status = "okay";
191};
192