Commit | Line | Data |
---|---|---|
df35fbcf IZ |
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 = <®_dc1sw>; | |
38 | dvdd25-supply = <®_dldo2>; | |
39 | dvdd12-supply = <®_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; | |
48f3e7bf | 52 | wakeup-source; |
df35fbcf IZ |
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 | phys = <&usbphy 0>; | |
71 | phy-names = "usb"; | |
72 | status = "okay"; | |
73 | }; | |
74 | ||
75 | &ehci1 { | |
76 | status = "okay"; | |
77 | }; | |
78 | ||
79 | &mmc0 { | |
80 | pinctrl-names = "default"; | |
81 | pinctrl-0 = <&mmc0_pins>; | |
82 | vmmc-supply = <®_dcdc1>; | |
fcddd1f6 | 83 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; |
df35fbcf IZ |
84 | disable-wp; |
85 | bus-width = <4>; | |
86 | status = "okay"; | |
87 | }; | |
88 | ||
89 | &mmc1 { | |
90 | pinctrl-names = "default"; | |
91 | pinctrl-0 = <&mmc1_pins>; | |
92 | vmmc-supply = <®_dldo4>; | |
93 | vqmmc-supply = <®_eldo1>; | |
94 | mmc-pwrseq = <&wifi_pwrseq>; | |
95 | bus-width = <4>; | |
96 | non-removable; | |
97 | status = "okay"; | |
98 | ||
99 | rtl8723cs: wifi@1 { | |
100 | reg = <1>; | |
101 | }; | |
102 | }; | |
103 | ||
104 | &mmc2 { | |
105 | pinctrl-names = "default"; | |
fa59dd2e | 106 | pinctrl-0 = <&mmc2_pins>, <&mmc2_ds_pin>; |
df35fbcf IZ |
107 | vmmc-supply = <®_dcdc1>; |
108 | vqmmc-supply = <®_eldo1>; | |
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 | phys = <&usbphy 0>; | |
118 | phy-names = "usb"; | |
119 | status = "okay"; | |
120 | }; | |
121 | ||
122 | &ohci1 { | |
123 | status = "okay"; | |
124 | }; | |
125 | ||
126 | &pwm { | |
127 | status = "okay"; | |
128 | }; | |
129 | ||
130 | &r_rsb { | |
131 | status = "okay"; | |
132 | ||
133 | axp803: pmic@3a3 { | |
134 | compatible = "x-powers,axp803"; | |
135 | reg = <0x3a3>; | |
136 | interrupt-parent = <&r_intc>; | |
137 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; | |
138 | }; | |
139 | }; | |
140 | ||
141 | /* The ANX6345 eDP-bridge is on r_i2c */ | |
142 | &r_i2c { | |
143 | clock-frequency = <100000>; | |
144 | pinctrl-names = "default"; | |
1b6ff1cb | 145 | pinctrl-0 = <&r_i2c_pl89_pins>; |
df35fbcf IZ |
146 | status = "okay"; |
147 | }; | |
148 | ||
149 | #include "axp803.dtsi" | |
150 | ||
151 | ®_aldo1 { | |
152 | regulator-min-microvolt = <2800000>; | |
153 | regulator-max-microvolt = <2800000>; | |
154 | regulator-name = "vcc-csi"; | |
155 | }; | |
156 | ||
157 | ®_aldo2 { | |
158 | regulator-always-on; | |
159 | regulator-min-microvolt = <1800000>; | |
160 | regulator-max-microvolt = <3300000>; | |
161 | regulator-name = "vcc-pl"; | |
162 | }; | |
163 | ||
164 | ®_aldo3 { | |
165 | regulator-always-on; | |
166 | regulator-min-microvolt = <2700000>; | |
167 | regulator-max-microvolt = <3300000>; | |
168 | regulator-name = "vcc-pll-avcc"; | |
169 | }; | |
170 | ||
171 | ®_dc1sw { | |
172 | regulator-name = "vcc-lcd"; | |
173 | }; | |
174 | ||
175 | ®_dcdc1 { | |
176 | regulator-always-on; | |
177 | regulator-min-microvolt = <3300000>; | |
178 | regulator-max-microvolt = <3300000>; | |
179 | regulator-name = "vcc-3v3"; | |
180 | }; | |
181 | ||
182 | ®_dcdc2 { | |
183 | regulator-always-on; | |
184 | regulator-min-microvolt = <1000000>; | |
185 | regulator-max-microvolt = <1300000>; | |
186 | regulator-name = "vdd-cpux"; | |
187 | }; | |
188 | ||
189 | /* DCDC3 is polyphased with DCDC2 */ | |
190 | ||
191 | ®_dcdc5 { | |
192 | regulator-always-on; | |
193 | regulator-min-microvolt = <1200000>; | |
194 | regulator-max-microvolt = <1200000>; | |
195 | regulator-name = "vcc-dram"; | |
196 | }; | |
197 | ||
198 | ®_dcdc6 { | |
199 | regulator-always-on; | |
200 | regulator-min-microvolt = <1100000>; | |
201 | regulator-max-microvolt = <1100000>; | |
202 | regulator-name = "vdd-sys"; | |
203 | }; | |
204 | ||
205 | ®_dldo1 { | |
206 | regulator-min-microvolt = <3300000>; | |
207 | regulator-max-microvolt = <3300000>; | |
208 | regulator-name = "vcc-hdmi"; | |
209 | }; | |
210 | ||
211 | ®_dldo2 { | |
212 | regulator-min-microvolt = <2500000>; | |
213 | regulator-max-microvolt = <2500000>; | |
214 | regulator-name = "vcc-edp"; | |
215 | }; | |
216 | ||
217 | ®_dldo3 { | |
218 | regulator-min-microvolt = <3300000>; | |
219 | regulator-max-microvolt = <3300000>; | |
220 | regulator-name = "avdd-csi"; | |
221 | }; | |
222 | ||
223 | ®_dldo4 { | |
224 | regulator-min-microvolt = <3300000>; | |
225 | regulator-max-microvolt = <3300000>; | |
226 | regulator-name = "vcc-wifi"; | |
227 | }; | |
228 | ||
229 | ®_eldo1 { | |
230 | regulator-always-on; | |
231 | regulator-min-microvolt = <1800000>; | |
232 | regulator-max-microvolt = <1800000>; | |
233 | regulator-name = "cpvdd"; | |
234 | }; | |
235 | ||
236 | ®_eldo3 { | |
237 | regulator-min-microvolt = <1800000>; | |
238 | regulator-max-microvolt = <1800000>; | |
239 | regulator-name = "vdd-1v8-csi"; | |
240 | }; | |
241 | ||
242 | ®_fldo1 { | |
243 | regulator-min-microvolt = <1200000>; | |
244 | regulator-max-microvolt = <1200000>; | |
245 | regulator-name = "vcc-1v2-hsic"; | |
246 | }; | |
247 | ||
248 | ®_fldo2 { | |
249 | regulator-always-on; | |
250 | regulator-min-microvolt = <1100000>; | |
251 | regulator-max-microvolt = <1100000>; | |
252 | regulator-name = "vdd-cpus"; | |
253 | }; | |
254 | ||
255 | ®_ldo_io0 { | |
256 | regulator-min-microvolt = <3300000>; | |
257 | regulator-max-microvolt = <3300000>; | |
258 | regulator-name = "vcc-usb"; | |
259 | status = "okay"; | |
260 | }; | |
261 | ||
262 | ®_rtc_ldo { | |
263 | regulator-name = "vcc-rtc"; | |
264 | }; | |
265 | ||
5cbef9f9 IZ |
266 | &simplefb_hdmi { |
267 | vcc-hdmi-supply = <®_dldo1>; | |
268 | }; | |
269 | ||
df35fbcf IZ |
270 | &uart0 { |
271 | pinctrl-names = "default"; | |
d91ebb95 | 272 | pinctrl-0 = <&uart0_pb_pins>; |
df35fbcf IZ |
273 | status = "okay"; |
274 | }; | |
275 | ||
276 | &usb_otg { | |
277 | dr_mode = "host"; | |
278 | }; | |
279 | ||
280 | &usbphy { | |
281 | usb0_vbus-supply = <®_ldo_io0>; | |
282 | usb1_vbus-supply = <®_ldo_io0>; | |
283 | status = "okay"; | |
284 | }; |