GNU Linux-libre 4.19.245-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         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 */
31         };
32
33         chosen {
34                 stdout-path = "serial0:115200n8";
35
36                 framebuffer-lcd {
37                         panel-supply = <&reg_dc1sw>;
38                         dvdd25-supply = <&reg_dldo2>;
39                         dvdd12-supply = <&reg_fldo1>;
40                 };
41         };
42
43         gpio_keys {
44                 compatible = "gpio-keys";
45
46                 lid_switch {
47                         label = "Lid Switch";
48                         gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
49                         linux,input-type = <EV_SW>;
50                         linux,code = <SW_LID>;
51                         linux,can-disable;
52                         wakeup-source;
53                 };
54         };
55
56         reg_vcc3v3: vcc3v3 {
57                 compatible = "regulator-fixed";
58                 regulator-name = "vcc3v3";
59                 regulator-min-microvolt = <3300000>;
60                 regulator-max-microvolt = <3300000>;
61         };
62
63         wifi_pwrseq: wifi_pwrseq {
64                 compatible = "mmc-pwrseq-simple";
65                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
66         };
67 };
68
69 &ehci0 {
70         status = "okay";
71 };
72
73 &ehci1 {
74         status = "okay";
75 };
76
77 &mmc0 {
78         pinctrl-names = "default";
79         pinctrl-0 = <&mmc0_pins>;
80         vmmc-supply = <&reg_dcdc1>;
81         cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
82         cd-inverted;
83         disable-wp;
84         bus-width = <4>;
85         status = "okay";
86 };
87
88 &mmc1 {
89         pinctrl-names = "default";
90         pinctrl-0 = <&mmc1_pins>;
91         vmmc-supply = <&reg_dldo4>;
92         vqmmc-supply = <&reg_eldo1>;
93         mmc-pwrseq = <&wifi_pwrseq>;
94         bus-width = <4>;
95         non-removable;
96         status = "okay";
97
98         rtl8723cs: wifi@1 {
99                 reg = <1>;
100         };
101 };
102
103 &mmc2 {
104         pinctrl-names = "default";
105         pinctrl-0 = <&mmc2_pins>;
106         vmmc-supply = <&reg_dcdc1>;
107         vqmmc-supply = <&reg_eldo1>;
108         max-frequency = <200000000>;
109         bus-width = <8>;
110         non-removable;
111         cap-mmc-hw-reset;
112         mmc-hs200-1_8v;
113         status = "okay";
114 };
115
116 &ohci0 {
117         status = "okay";
118 };
119
120 &ohci1 {
121         status = "okay";
122 };
123
124 &pwm {
125         status = "okay";
126 };
127
128 &r_rsb {
129         status = "okay";
130
131         axp803: pmic@3a3 {
132                 compatible = "x-powers,axp803";
133                 reg = <0x3a3>;
134                 interrupt-parent = <&r_intc>;
135                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
136         };
137 };
138
139 /* The ANX6345 eDP-bridge is on r_i2c */
140 &r_i2c {
141         clock-frequency = <100000>;
142         pinctrl-names = "default";
143         pinctrl-0 = <&r_i2c_pins_a>;
144         status = "okay";
145 };
146
147 #include "axp803.dtsi"
148
149 &reg_aldo1 {
150         regulator-min-microvolt = <2800000>;
151         regulator-max-microvolt = <2800000>;
152         regulator-name = "vcc-csi";
153 };
154
155 &reg_aldo2 {
156         regulator-always-on;
157         regulator-min-microvolt = <1800000>;
158         regulator-max-microvolt = <3300000>;
159         regulator-name = "vcc-pl";
160 };
161
162 &reg_aldo3 {
163         regulator-always-on;
164         regulator-min-microvolt = <2700000>;
165         regulator-max-microvolt = <3300000>;
166         regulator-name = "vcc-pll-avcc";
167 };
168
169 &reg_dc1sw {
170         regulator-name = "vcc-lcd";
171 };
172
173 &reg_dcdc1 {
174         regulator-always-on;
175         regulator-min-microvolt = <3300000>;
176         regulator-max-microvolt = <3300000>;
177         regulator-name = "vcc-3v3";
178 };
179
180 &reg_dcdc2 {
181         regulator-always-on;
182         regulator-min-microvolt = <1000000>;
183         regulator-max-microvolt = <1300000>;
184         regulator-name = "vdd-cpux";
185 };
186
187 /* DCDC3 is polyphased with DCDC2 */
188
189 &reg_dcdc5 {
190         regulator-always-on;
191         regulator-min-microvolt = <1200000>;
192         regulator-max-microvolt = <1200000>;
193         regulator-name = "vcc-dram";
194 };
195
196 &reg_dcdc6 {
197         regulator-always-on;
198         regulator-min-microvolt = <1100000>;
199         regulator-max-microvolt = <1100000>;
200         regulator-name = "vdd-sys";
201 };
202
203 &reg_dldo1 {
204         regulator-min-microvolt = <3300000>;
205         regulator-max-microvolt = <3300000>;
206         regulator-name = "vcc-hdmi";
207 };
208
209 &reg_dldo2 {
210         regulator-min-microvolt = <2500000>;
211         regulator-max-microvolt = <2500000>;
212         regulator-name = "vcc-edp";
213 };
214
215 &reg_dldo3 {
216         regulator-min-microvolt = <3300000>;
217         regulator-max-microvolt = <3300000>;
218         regulator-name = "avdd-csi";
219 };
220
221 &reg_dldo4 {
222         regulator-min-microvolt = <3300000>;
223         regulator-max-microvolt = <3300000>;
224         regulator-name = "vcc-wifi";
225 };
226
227 &reg_eldo1 {
228         regulator-always-on;
229         regulator-min-microvolt = <1800000>;
230         regulator-max-microvolt = <1800000>;
231         regulator-name = "cpvdd";
232 };
233
234 &reg_eldo3 {
235         regulator-min-microvolt = <1800000>;
236         regulator-max-microvolt = <1800000>;
237         regulator-name = "vdd-1v8-csi";
238 };
239
240 &reg_fldo1 {
241         regulator-min-microvolt = <1200000>;
242         regulator-max-microvolt = <1200000>;
243         regulator-name = "vcc-1v2-hsic";
244 };
245
246 &reg_fldo2 {
247         regulator-always-on;
248         regulator-min-microvolt = <1100000>;
249         regulator-max-microvolt = <1100000>;
250         regulator-name = "vdd-cpus";
251 };
252
253 &reg_ldo_io0 {
254         regulator-min-microvolt = <3300000>;
255         regulator-max-microvolt = <3300000>;
256         regulator-name = "vcc-usb";
257         status = "okay";
258 };
259
260 &reg_rtc_ldo {
261         regulator-name = "vcc-rtc";
262 };
263
264 &simplefb_hdmi {
265         vcc-hdmi-supply = <&reg_dldo1>;
266 };
267
268 &uart0 {
269         pinctrl-names = "default";
270         pinctrl-0 = <&uart0_pins_a>;
271         status = "okay";
272 };
273
274 &usb_otg {
275         dr_mode = "host";
276 };
277
278 &usbphy {
279         usb0_vbus-supply = <&reg_ldo_io0>;
280         usb1_vbus-supply = <&reg_ldo_io0>;
281         status = "okay";
282 };