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