blob: 1a85d5f60c36164b2b879a49f33ef013ec975e1c [file] [log] [blame]
Vasily Khoruzhick55687df2018-11-05 20:24:31 -08001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
Samuel Holland26bc4e72020-10-24 10:21:55 -05002// Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
3// Copyright (C) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
Vasily Khoruzhick55687df2018-11-05 20:24:31 -08004
5/dts-v1/;
6
7#include "sun50i-a64.dtsi"
Samuel Holland26bc4e72020-10-24 10:21:55 -05008#include "sun50i-a64-cpu-opp.dtsi"
Vasily Khoruzhick55687df2018-11-05 20:24:31 -08009
10#include <dt-bindings/gpio/gpio.h>
Samuel Holland26bc4e72020-10-24 10:21:55 -050011#include <dt-bindings/input/gpio-keys.h>
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080012#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";
Samuel Holland43729b72022-04-27 15:31:30 -050018 chassis-type = "laptop";
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080019
20 aliases {
21 serial0 = &uart0;
22 ethernet0 = &rtl8723cs;
23 };
24
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080025 backlight: backlight {
26 compatible = "pwm-backlight";
27 pwms = <&pwm 0 50000 0>;
28 brightness-levels = <0 5 10 15 20 30 40 55 70 85 100>;
29 default-brightness-level = <2>;
30 enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
Samuel Holland26bc4e72020-10-24 10:21:55 -050031 power-supply = <&reg_vbklt>;
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080032 };
33
34 chosen {
35 stdout-path = "serial0:115200n8";
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080036 };
37
Andre Przywara5eb4bbe2022-09-11 00:04:41 +010038 gpio-keys {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080039 compatible = "gpio-keys";
40
Andre Przywara5eb4bbe2022-09-11 00:04:41 +010041 lid-switch {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080042 label = "Lid Switch";
43 gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
44 linux,input-type = <EV_SW>;
45 linux,code = <SW_LID>;
46 linux,can-disable;
47 wakeup-source;
Samuel Holland26bc4e72020-10-24 10:21:55 -050048 wakeup-event-action = <EV_ACT_DEASSERTED>;
49 };
50 };
51
52 panel_edp: panel-edp {
53 compatible = "neweast,wjfh116008a";
54 backlight = <&backlight>;
55 power-supply = <&reg_dc1sw>;
56
57 port {
58 panel_edp_in: endpoint {
59 remote-endpoint = <&anx6345_out_edp>;
60 };
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080061 };
62 };
63
Samuel Holland26bc4e72020-10-24 10:21:55 -050064 reg_vbklt: vbklt {
65 compatible = "regulator-fixed";
66 regulator-name = "vbklt";
67 regulator-min-microvolt = <18000000>;
68 regulator-max-microvolt = <18000000>;
69 gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
70 enable-active-high;
71 };
72
73 reg_vcc5v0: vcc5v0 {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080074 compatible = "regulator-fixed";
Samuel Holland26bc4e72020-10-24 10:21:55 -050075 regulator-name = "vcc5v0";
76 regulator-min-microvolt = <5000000>;
77 regulator-max-microvolt = <5000000>;
78 gpio = <&axp_gpio 0 GPIO_ACTIVE_HIGH>;
79 enable-active-high;
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080080 };
81
Andre Przywara3b798212024-04-19 17:59:52 +010082 wifi_pwrseq: pwrseq {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -080083 compatible = "mmc-pwrseq-simple";
84 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
85 };
Samuel Holland26bc4e72020-10-24 10:21:55 -050086
87 speaker_amp: audio-amplifier {
88 compatible = "simple-audio-amplifier";
89 VCC-supply = <&reg_vcc5v0>;
90 enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
91 sound-name-prefix = "Speaker Amp";
92 };
93
94};
95
96&codec {
97 status = "okay";
98};
99
100&codec_analog {
101 cpvdd-supply = <&reg_eldo1>;
102 status = "okay";
103};
104
105&cpu0 {
106 cpu-supply = <&reg_dcdc2>;
107};
108
109&cpu1 {
110 cpu-supply = <&reg_dcdc2>;
111};
112
113&cpu2 {
114 cpu-supply = <&reg_dcdc2>;
115};
116
117&cpu3 {
118 cpu-supply = <&reg_dcdc2>;
119};
120
121&dai {
122 status = "okay";
123};
124
125&de {
126 status = "okay";
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800127};
128
129&ehci0 {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800130 status = "okay";
131};
132
133&ehci1 {
134 status = "okay";
135};
136
Samuel Holland26bc4e72020-10-24 10:21:55 -0500137&mixer0 {
138 status = "okay";
139};
140
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800141&mmc0 {
142 pinctrl-names = "default";
143 pinctrl-0 = <&mmc0_pins>;
144 vmmc-supply = <&reg_dcdc1>;
Samuel Holland26bc4e72020-10-24 10:21:55 -0500145 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800146 disable-wp;
147 bus-width = <4>;
148 status = "okay";
149};
150
151&mmc1 {
152 pinctrl-names = "default";
153 pinctrl-0 = <&mmc1_pins>;
154 vmmc-supply = <&reg_dldo4>;
155 vqmmc-supply = <&reg_eldo1>;
156 mmc-pwrseq = <&wifi_pwrseq>;
157 bus-width = <4>;
158 non-removable;
159 status = "okay";
160
161 rtl8723cs: wifi@1 {
162 reg = <1>;
163 };
164};
165
166&mmc2 {
167 pinctrl-names = "default";
168 pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>;
169 vmmc-supply = <&reg_dcdc1>;
170 vqmmc-supply = <&reg_eldo1>;
Andre Przywarafb675472021-04-17 22:55:19 +0100171 max-frequency = <200000000>;
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800172 bus-width = <8>;
173 non-removable;
174 cap-mmc-hw-reset;
175 mmc-hs200-1_8v;
176 status = "okay";
177};
178
179&ohci0 {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800180 status = "okay";
181};
182
183&ohci1 {
184 status = "okay";
185};
186
Samuel Holland26bc4e72020-10-24 10:21:55 -0500187&pio {
188 vcc-pc-supply = <&reg_eldo1>;
189 vcc-pd-supply = <&reg_dcdc1>;
190 vcc-pe-supply = <&reg_aldo1>;
191 vcc-pg-supply = <&reg_eldo1>;
192};
193
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800194&pwm {
195 status = "okay";
196};
197
Samuel Holland26bc4e72020-10-24 10:21:55 -0500198&r_i2c {
199 clock-frequency = <100000>;
200 pinctrl-names = "default";
201 pinctrl-0 = <&r_i2c_pl89_pins>;
202 status = "okay";
203
204 anx6345: anx6345@38 {
205 compatible = "analogix,anx6345";
206 reg = <0x38>;
207 reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
208 dvdd25-supply = <&reg_dldo2>;
209 dvdd12-supply = <&reg_fldo1>;
210
211 ports {
212 #address-cells = <1>;
213 #size-cells = <0>;
214
215 anx6345_in: port@0 {
216 reg = <0>;
217 anx6345_in_tcon0: endpoint {
218 remote-endpoint = <&tcon0_out_anx6345>;
219 };
220 };
221
222 anx6345_out: port@1 {
223 reg = <1>;
224 anx6345_out_edp: endpoint {
225 remote-endpoint = <&panel_edp_in>;
226 };
227 };
228 };
229 };
230};
231
232&r_pio {
233 /*
234 * FIXME: We can't add that supply for now since it would
235 * create a circular dependency between pinctrl, the regulator
236 * and the RSB Bus.
237 *
238 * vcc-pl-supply = <&reg_aldo2>;
239 */
240};
241
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800242&r_rsb {
243 status = "okay";
244
245 axp803: pmic@3a3 {
246 compatible = "x-powers,axp803";
247 reg = <0x3a3>;
248 interrupt-parent = <&r_intc>;
249 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
250 };
251};
252
Samuel Holland26bc4e72020-10-24 10:21:55 -0500253#include "axp803.dtsi"
254
255&ac_power_supply {
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800256 status = "okay";
257};
258
Samuel Holland26bc4e72020-10-24 10:21:55 -0500259&battery_power_supply {
260 status = "okay";
261};
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800262
263&reg_aldo1 {
Samuel Holland26bc4e72020-10-24 10:21:55 -0500264 regulator-name = "vcc-pe";
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800265};
266
267&reg_aldo2 {
268 regulator-always-on;
269 regulator-min-microvolt = <1800000>;
270 regulator-max-microvolt = <3300000>;
271 regulator-name = "vcc-pl";
272};
273
274&reg_aldo3 {
275 regulator-always-on;
276 regulator-min-microvolt = <2700000>;
277 regulator-max-microvolt = <3300000>;
278 regulator-name = "vcc-pll-avcc";
279};
280
281&reg_dc1sw {
282 regulator-name = "vcc-lcd";
283};
284
285&reg_dcdc1 {
286 regulator-always-on;
287 regulator-min-microvolt = <3300000>;
288 regulator-max-microvolt = <3300000>;
289 regulator-name = "vcc-3v3";
290};
291
292&reg_dcdc2 {
293 regulator-always-on;
294 regulator-min-microvolt = <1000000>;
295 regulator-max-microvolt = <1300000>;
296 regulator-name = "vdd-cpux";
297};
298
299/* DCDC3 is polyphased with DCDC2 */
300
301&reg_dcdc5 {
302 regulator-always-on;
303 regulator-min-microvolt = <1200000>;
304 regulator-max-microvolt = <1200000>;
305 regulator-name = "vcc-dram";
306};
307
308&reg_dcdc6 {
309 regulator-always-on;
310 regulator-min-microvolt = <1100000>;
311 regulator-max-microvolt = <1100000>;
312 regulator-name = "vdd-sys";
313};
314
315&reg_dldo1 {
316 regulator-min-microvolt = <3300000>;
317 regulator-max-microvolt = <3300000>;
318 regulator-name = "vcc-hdmi";
319};
320
321&reg_dldo2 {
322 regulator-min-microvolt = <2500000>;
323 regulator-max-microvolt = <2500000>;
324 regulator-name = "vcc-edp";
325};
326
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800327&reg_dldo4 {
328 regulator-min-microvolt = <3300000>;
329 regulator-max-microvolt = <3300000>;
330 regulator-name = "vcc-wifi";
331};
332
333&reg_eldo1 {
334 regulator-always-on;
335 regulator-min-microvolt = <1800000>;
336 regulator-max-microvolt = <1800000>;
337 regulator-name = "cpvdd";
338};
339
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800340&reg_fldo1 {
341 regulator-min-microvolt = <1200000>;
342 regulator-max-microvolt = <1200000>;
343 regulator-name = "vcc-1v2-hsic";
344};
345
346&reg_fldo2 {
347 regulator-always-on;
348 regulator-min-microvolt = <1100000>;
349 regulator-max-microvolt = <1100000>;
350 regulator-name = "vdd-cpus";
351};
352
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800353&reg_rtc_ldo {
354 regulator-name = "vcc-rtc";
355};
356
Samuel Holland26bc4e72020-10-24 10:21:55 -0500357&simplefb_lcd {
358 panel-supply = <&reg_dc1sw>;
359 dvdd25-supply = <&reg_dldo2>;
360 dvdd12-supply = <&reg_fldo1>;
361};
362
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800363&simplefb_hdmi {
364 vcc-hdmi-supply = <&reg_dldo1>;
365};
366
Samuel Holland26bc4e72020-10-24 10:21:55 -0500367&sound {
368 status = "okay";
369 simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
370 simple-audio-card,widgets = "Microphone", "Internal Microphone Left",
371 "Microphone", "Internal Microphone Right",
372 "Headphone", "Headphone Jack",
373 "Speaker", "Internal Speaker";
374 simple-audio-card,routing =
Andre Przywarafb675472021-04-17 22:55:19 +0100375 "Left DAC", "DACL",
376 "Right DAC", "DACR",
Samuel Holland26bc4e72020-10-24 10:21:55 -0500377 "Speaker Amp INL", "LINEOUT",
378 "Speaker Amp INR", "LINEOUT",
379 "Internal Speaker", "Speaker Amp OUTL",
380 "Internal Speaker", "Speaker Amp OUTR",
381 "Headphone Jack", "HP",
Andre Przywarafb675472021-04-17 22:55:19 +0100382 "ADCL", "Left ADC",
383 "ADCR", "Right ADC",
Samuel Holland26bc4e72020-10-24 10:21:55 -0500384 "Internal Microphone Left", "MBIAS",
385 "MIC1", "Internal Microphone Left",
386 "Internal Microphone Right", "HBIAS",
387 "MIC2", "Internal Microphone Right";
388};
389
390&tcon0 {
391 pinctrl-names = "default";
392 pinctrl-0 = <&lcd_rgb666_pins>;
393
394 status = "okay";
395};
396
397&tcon0_out {
398 tcon0_out_anx6345: endpoint {
399 remote-endpoint = <&anx6345_in_tcon0>;
400 };
401};
402
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800403&uart0 {
404 pinctrl-names = "default";
405 pinctrl-0 = <&uart0_pb_pins>;
406 status = "okay";
407};
408
Andre Przywaraed2724b2023-01-12 11:22:20 +0000409&uart1 {
410 pinctrl-names = "default";
411 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
412 uart-has-rtscts;
413 status = "okay";
414
415 bluetooth {
416 compatible = "realtek,rtl8723cs-bt";
417 device-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
418 enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
419 host-wake-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
420 };
421};
422
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800423&usb_otg {
424 dr_mode = "host";
425};
426
427&usbphy {
Samuel Holland26bc4e72020-10-24 10:21:55 -0500428 usb0_vbus-supply = <&reg_vcc5v0>;
429 usb1_vbus-supply = <&reg_vcc5v0>;
Vasily Khoruzhick55687df2018-11-05 20:24:31 -0800430 status = "okay";
431};