arm64: dts: allwinner: pinebook: Sort device tree nodes
[linux-2.6-microblaze.git] / arch / arm64 / boot / dts / allwinner / sun50i-a64-pinebook.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 // Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
3 // Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
4
5 /dts-v1/;
6
7 #include "sun50i-a64.dtsi"
8 #include "sun50i-a64-cpu-opp.dtsi"
9
10 #include <dt-bindings/gpio/gpio.h>
11 #include <dt-bindings/input/gpio-keys.h>
12 #include <dt-bindings/input/input.h>
13 #include <dt-bindings/pwm/pwm.h>
14
15 / {
16         model = "Pinebook";
17         compatible = "pine64,pinebook", "allwinner,sun50i-a64";
18
19         aliases {
20                 serial0 = &uart0;
21                 ethernet0 = &rtl8723cs;
22         };
23
24         vdd_bl: regulator@0 {
25                 compatible = "regulator-fixed";
26                 regulator-name = "bl-3v3";
27                 regulator-min-microvolt = <3300000>;
28                 regulator-max-microvolt = <3300000>;
29                 gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
30                 enable-active-high;
31         };
32
33         backlight: backlight {
34                 compatible = "pwm-backlight";
35                 pwms = <&pwm 0 50000 0>;
36                 brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
37                 default-brightness-level = <2>;
38                 enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
39                 power-supply = <&vdd_bl>;
40         };
41
42         chosen {
43                 stdout-path = "serial0:115200n8";
44
45                 framebuffer-lcd {
46                         panel-supply = <&reg_dc1sw>;
47                         dvdd25-supply = <&reg_dldo2>;
48                         dvdd12-supply = <&reg_fldo1>;
49                 };
50         };
51
52         gpio_keys {
53                 compatible = "gpio-keys";
54
55                 lid_switch {
56                         label = "Lid Switch";
57                         gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
58                         linux,input-type = <EV_SW>;
59                         linux,code = <SW_LID>;
60                         linux,can-disable;
61                         wakeup-source;
62                         wakeup-event-action = <EV_ACT_DEASSERTED>;
63                 };
64         };
65
66         wifi_pwrseq: wifi_pwrseq {
67                 compatible = "mmc-pwrseq-simple";
68                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
69         };
70
71         speaker_amp: audio-amplifier {
72                 compatible = "simple-audio-amplifier";
73                 /*
74                  * TODO This is actually a fixed regulator controlled by
75                  * the GPIO line on the PMIC. This should be corrected
76                  * once GPIO support is added for this PMIC.
77                  */
78                 VCC-supply = <&reg_ldo_io0>;
79                 enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
80                 sound-name-prefix = "Speaker Amp";
81         };
82
83 };
84
85 &codec {
86         status = "okay";
87 };
88
89 &codec_analog {
90         cpvdd-supply = <&reg_eldo1>;
91         status = "okay";
92 };
93
94 &cpu0 {
95         cpu-supply = <&reg_dcdc2>;
96 };
97
98 &cpu1 {
99         cpu-supply = <&reg_dcdc2>;
100 };
101
102 &cpu2 {
103         cpu-supply = <&reg_dcdc2>;
104 };
105
106 &cpu3 {
107         cpu-supply = <&reg_dcdc2>;
108 };
109
110 &dai {
111         status = "okay";
112 };
113
114 &ehci0 {
115         phys = <&usbphy 0>;
116         phy-names = "usb";
117         status = "okay";
118 };
119
120 &ehci1 {
121         status = "okay";
122 };
123
124 &mmc0 {
125         pinctrl-names = "default";
126         pinctrl-0 = <&mmc0_pins>;
127         vmmc-supply = <&reg_dcdc1>;
128         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
129         disable-wp;
130         bus-width = <4>;
131         status = "okay";
132 };
133
134 &mmc1 {
135         pinctrl-names = "default";
136         pinctrl-0 = <&mmc1_pins>;
137         vmmc-supply = <&reg_dldo4>;
138         vqmmc-supply = <&reg_eldo1>;
139         mmc-pwrseq = <&wifi_pwrseq>;
140         bus-width = <4>;
141         non-removable;
142         status = "okay";
143
144         rtl8723cs: wifi@1 {
145                 reg = <1>;
146         };
147 };
148
149 &mmc2 {
150         pinctrl-names = "default";
151         pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
152         vmmc-supply = <&reg_dcdc1>;
153         vqmmc-supply = <&reg_eldo1>;
154         bus-width = <8>;
155         non-removable;
156         cap-mmc-hw-reset;
157         mmc-hs200-1_8v;
158         status = "okay";
159 };
160
161 &ohci0 {
162         phys = <&usbphy 0>;
163         phy-names = "usb";
164         status = "okay";
165 };
166
167 &ohci1 {
168         status = "okay";
169 };
170
171 &pwm {
172         status = "okay";
173 };
174
175 /* The ANX6345 eDP-bridge is on r_i2c */
176 &r_i2c {
177         clock-frequency = <100000>;
178         pinctrl-names = "default";
179         pinctrl-0 = <&r_i2c_pl89_pins>;
180         status = "okay";
181 };
182
183 &r_rsb {
184         status = "okay";
185
186         axp803: pmic@3a3 {
187                 compatible = "x-powers,axp803";
188                 reg = <0x3a3>;
189                 interrupt-parent = <&r_intc>;
190                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
191         };
192 };
193
194 #include "axp803.dtsi"
195
196 &ac_power_supply {
197         status = "okay";
198 };
199
200 &battery_power_supply {
201         status = "okay";
202 };
203
204 &reg_aldo1 {
205         regulator-min-microvolt = <2800000>;
206         regulator-max-microvolt = <2800000>;
207         regulator-name = "vcc-csi";
208 };
209
210 &reg_aldo2 {
211         regulator-always-on;
212         regulator-min-microvolt = <1800000>;
213         regulator-max-microvolt = <3300000>;
214         regulator-name = "vcc-pl";
215 };
216
217 &reg_aldo3 {
218         regulator-always-on;
219         regulator-min-microvolt = <2700000>;
220         regulator-max-microvolt = <3300000>;
221         regulator-name = "vcc-pll-avcc";
222 };
223
224 &reg_dc1sw {
225         regulator-name = "vcc-lcd";
226 };
227
228 &reg_dcdc1 {
229         regulator-always-on;
230         regulator-min-microvolt = <3300000>;
231         regulator-max-microvolt = <3300000>;
232         regulator-name = "vcc-3v3";
233 };
234
235 &reg_dcdc2 {
236         regulator-always-on;
237         regulator-min-microvolt = <1000000>;
238         regulator-max-microvolt = <1300000>;
239         regulator-name = "vdd-cpux";
240 };
241
242 /* DCDC3 is polyphased with DCDC2 */
243
244 &reg_dcdc5 {
245         regulator-always-on;
246         regulator-min-microvolt = <1200000>;
247         regulator-max-microvolt = <1200000>;
248         regulator-name = "vcc-dram";
249 };
250
251 &reg_dcdc6 {
252         regulator-always-on;
253         regulator-min-microvolt = <1100000>;
254         regulator-max-microvolt = <1100000>;
255         regulator-name = "vdd-sys";
256 };
257
258 &reg_dldo1 {
259         regulator-min-microvolt = <3300000>;
260         regulator-max-microvolt = <3300000>;
261         regulator-name = "vcc-hdmi";
262 };
263
264 &reg_dldo2 {
265         regulator-min-microvolt = <2500000>;
266         regulator-max-microvolt = <2500000>;
267         regulator-name = "vcc-edp";
268 };
269
270 &reg_dldo3 {
271         regulator-min-microvolt = <3300000>;
272         regulator-max-microvolt = <3300000>;
273         regulator-name = "avdd-csi";
274 };
275
276 &reg_dldo4 {
277         regulator-min-microvolt = <3300000>;
278         regulator-max-microvolt = <3300000>;
279         regulator-name = "vcc-wifi";
280 };
281
282 &reg_eldo1 {
283         regulator-always-on;
284         regulator-min-microvolt = <1800000>;
285         regulator-max-microvolt = <1800000>;
286         regulator-name = "cpvdd";
287 };
288
289 &reg_eldo3 {
290         regulator-min-microvolt = <1800000>;
291         regulator-max-microvolt = <1800000>;
292         regulator-name = "vdd-1v8-csi";
293 };
294
295 &reg_fldo1 {
296         regulator-min-microvolt = <1200000>;
297         regulator-max-microvolt = <1200000>;
298         regulator-name = "vcc-1v2-hsic";
299 };
300
301 &reg_fldo2 {
302         regulator-always-on;
303         regulator-min-microvolt = <1100000>;
304         regulator-max-microvolt = <1100000>;
305         regulator-name = "vdd-cpus";
306 };
307
308 &reg_ldo_io0 {
309         regulator-min-microvolt = <3300000>;
310         regulator-max-microvolt = <3300000>;
311         regulator-name = "vcc-usb";
312         status = "okay";
313 };
314
315 &reg_rtc_ldo {
316         regulator-name = "vcc-rtc";
317 };
318
319 &simplefb_hdmi {
320         vcc-hdmi-supply = <&reg_dldo1>;
321 };
322
323 &sound {
324         status = "okay";
325         simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
326         simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
327                                     "Microphone", "Internal Microphone Right",
328                                     "Headphone", "Headphone Jack",
329                                     "Speaker", "Internal Speaker";
330         simple-audio-card,routing =
331                         "Left DAC", "AIF1 Slot 0 Left",
332                         "Right DAC", "AIF1 Slot 0 Right",
333                         "Speaker Amp INL", "LINEOUT",
334                         "Speaker Amp INR", "LINEOUT",
335                         "Internal Speaker", "Speaker Amp OUTL",
336                         "Internal Speaker", "Speaker Amp OUTR",
337                         "Headphone Jack", "HP",
338                         "AIF1 Slot 0 Left ADC", "Left ADC",
339                         "AIF1 Slot 0 Right ADC", "Right ADC",
340                         "Internal Microphone Left", "MBIAS",
341                         "MIC1", "Internal Microphone Left",
342                         "Internal Microphone Right", "HBIAS",
343                         "MIC2", "Internal Microphone Right";
344 };
345
346 &uart0 {
347         pinctrl-names = "default";
348         pinctrl-0 = <&uart0_pb_pins>;
349         status = "okay";
350 };
351
352 &usb_otg {
353         dr_mode = "host";
354 };
355
356 &usbphy {
357         usb0_vbus-supply = <&reg_ldo_io0>;
358         usb1_vbus-supply = <&reg_ldo_io0>;
359         status = "okay";
360 };