]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
69e3e7ad9fce82c93ca4dc4d7da2a88f820ea579
[mirror_ubuntu-bionic-kernel.git] / arch / arm64 / boot / dts / amlogic / meson-gxm-khadas-vim2.dts
1 /*
2 * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
3 * Copyright (c) 2017 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 *
6 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
7 */
8
9 /dts-v1/;
10
11 #include <dt-bindings/input/input.h>
12 #include <dt-bindings/thermal/thermal.h>
13
14 #include "meson-gxm.dtsi"
15
16 / {
17 compatible = "khadas,vim2", "amlogic,s912", "amlogic,meson-gxm";
18 model = "Khadas VIM2";
19
20 aliases {
21 serial0 = &uart_AO;
22 serial1 = &uart_A;
23 serial2 = &uart_AO_B;
24 };
25
26 chosen {
27 stdout-path = "serial0:115200n8";
28 };
29
30 memory@0 {
31 device_type = "memory";
32 reg = <0x0 0x0 0x0 0x80000000>;
33 };
34
35 adc-keys {
36 compatible = "adc-keys";
37 io-channels = <&saradc 0>;
38 io-channel-names = "buttons";
39 keyup-threshold-microvolt = <1710000>;
40
41 button-function {
42 label = "Function";
43 linux,code = <KEY_FN>;
44 press-threshold-microvolt = <10000>;
45 };
46 };
47
48 emmc_pwrseq: emmc-pwrseq {
49 compatible = "mmc-pwrseq-emmc";
50 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
51 };
52
53 gpio_fan: gpio-fan {
54 compatible = "gpio-fan";
55 gpios = <&gpio GPIODV_14 GPIO_ACTIVE_HIGH
56 &gpio GPIODV_15 GPIO_ACTIVE_HIGH>;
57 /* Dummy RPM values since fan is optional */
58 gpio-fan,speed-map = <0 0
59 1 1
60 2 2
61 3 3>;
62 cooling-min-level = <0>;
63 cooling-max-level = <3>;
64 #cooling-cells = <2>;
65 };
66
67 gpio-keys-polled {
68 compatible = "gpio-keys-polled";
69 poll-interval = <100>;
70
71 power-button {
72 label = "power";
73 linux,code = <KEY_POWER>;
74 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
75 };
76 };
77
78 hdmi-connector {
79 compatible = "hdmi-connector";
80 type = "a";
81
82 port {
83 hdmi_connector_in: endpoint {
84 remote-endpoint = <&hdmi_tx_tmds_out>;
85 };
86 };
87 };
88
89 pwmleds {
90 compatible = "pwm-leds";
91
92 power {
93 label = "vim:red:power";
94 pwms = <&pwm_AO_ab 1 7812500 0>;
95 max-brightness = <255>;
96 linux,default-trigger = "default-on";
97 };
98 };
99
100 sdio_pwrseq: sdio-pwrseq {
101 compatible = "mmc-pwrseq-simple";
102 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
103 clocks = <&wifi32k>;
104 clock-names = "ext_clock";
105 };
106
107 thermal-zones {
108 cpu-thermal {
109 polling-delay-passive = <250>; /* milliseconds */
110 polling-delay = <1000>; /* milliseconds */
111
112 thermal-sensors = <&scpi_sensors 0>;
113
114 trips {
115 cpu_alert0: cpu-alert0 {
116 temperature = <70000>; /* millicelsius */
117 hysteresis = <2000>; /* millicelsius */
118 type = "active";
119 };
120
121 cpu_alert1: cpu-alert1 {
122 temperature = <80000>; /* millicelsius */
123 hysteresis = <2000>; /* millicelsius */
124 type = "passive";
125 };
126 };
127
128 cooling-maps {
129 map0 {
130 trip = <&cpu_alert0>;
131 cooling-device = <&gpio_fan THERMAL_NO_LIMIT 1>;
132 };
133
134 map1 {
135 trip = <&cpu_alert1>;
136 cooling-device = <&gpio_fan 2 THERMAL_NO_LIMIT>;
137 };
138
139 map2 {
140 trip = <&cpu_alert1>;
141 cooling-device =
142 <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
143 };
144
145 map3 {
146 trip = <&cpu_alert1>;
147 cooling-device =
148 <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
149 };
150 };
151 };
152 };
153
154 vcc_3v3: regulator-vcc_3v3 {
155 compatible = "regulator-fixed";
156 regulator-name = "VCC_3V3";
157 regulator-min-microvolt = <3300000>;
158 regulator-max-microvolt = <3300000>;
159 };
160
161 vddio_ao18: regulator-vddio_ao18 {
162 compatible = "regulator-fixed";
163 regulator-name = "VDDIO_AO18";
164 regulator-min-microvolt = <1800000>;
165 regulator-max-microvolt = <1800000>;
166 };
167
168 vddio_boot: regulator-vddio_boot {
169 compatible = "regulator-fixed";
170 regulator-name = "VDDIO_BOOT";
171 regulator-min-microvolt = <1800000>;
172 regulator-max-microvolt = <1800000>;
173 };
174
175 vddao_3v3: regulator-vddao_3v3 {
176 compatible = "regulator-fixed";
177 regulator-name = "VDDAO_3V3";
178 regulator-min-microvolt = <3300000>;
179 regulator-max-microvolt = <3300000>;
180 };
181
182 wifi32k: wifi32k {
183 compatible = "pwm-clock";
184 #clock-cells = <0>;
185 clock-frequency = <32768>;
186 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
187 };
188 };
189
190 &cec_AO {
191 status = "okay";
192 pinctrl-0 = <&ao_cec_pins>;
193 pinctrl-names = "default";
194 hdmi-phandle = <&hdmi_tx>;
195 };
196
197 &cpu0 {
198 cooling-min-level = <0>;
199 cooling-max-level = <6>;
200 #cooling-cells = <2>;
201 };
202
203 &cpu4 {
204 cooling-min-level = <0>;
205 cooling-max-level = <4>;
206 #cooling-cells = <2>;
207 };
208
209 &ethmac {
210 pinctrl-0 = <&eth_pins>;
211 pinctrl-names = "default";
212
213 /* Select external PHY by default */
214 phy-handle = <&external_phy>;
215
216 amlogic,tx-delay-ns = <2>;
217
218 /* External PHY reset is shared with internal PHY Led signals */
219 snps,reset-gpio = <&gpio GPIOZ_14 0>;
220 snps,reset-delays-us = <0 10000 1000000>;
221 snps,reset-active-low;
222
223 /* External PHY is in RGMII */
224 phy-mode = "rgmii";
225
226 status = "okay";
227 };
228
229 &external_mdio {
230 external_phy: ethernet-phy@0 {
231 /* Realtek RTL8211F (0x001cc916) */
232 reg = <0>;
233 };
234 };
235
236 &hdmi_tx {
237 status = "okay";
238 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
239 pinctrl-names = "default";
240 hdmi-supply = <&hdmi_5v>;
241 };
242
243 &hdmi_tx_tmds_port {
244 hdmi_tx_tmds_out: endpoint {
245 remote-endpoint = <&hdmi_connector_in>;
246 };
247 };
248
249 &i2c_A {
250 status = "okay";
251 pinctrl-0 = <&i2c_a_pins>;
252 pinctrl-names = "default";
253 };
254
255 &i2c_B {
256 status = "okay";
257 pinctrl-0 = <&i2c_b_pins>;
258 pinctrl-names = "default";
259
260 rtc: rtc@51 {
261 /* has to be enabled manually when a battery is connected: */
262 status = "disabled";
263 compatible = "haoyu,hym8563";
264 reg = <0x51>;
265 #clock-cells = <0>;
266 clock-frequency = <32768>;
267 clock-output-names = "xin32k";
268 };
269 };
270
271 &ir {
272 status = "okay";
273 pinctrl-0 = <&remote_input_ao_pins>;
274 pinctrl-names = "default";
275 linux,rc-map-name = "rc-geekbox";
276 };
277
278 &pwm_AO_ab {
279 status = "okay";
280 pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
281 pinctrl-names = "default";
282 clocks = <&clkc CLKID_FCLK_DIV4>;
283 clock-names = "clkin0";
284 };
285
286 &pwm_ef {
287 status = "okay";
288 pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
289 pinctrl-names = "default";
290 clocks = <&clkc CLKID_FCLK_DIV4>;
291 clock-names = "clkin0";
292 };
293
294 &sd_emmc_a {
295 status = "okay";
296 pinctrl-0 = <&sdio_pins>;
297 pinctrl-names = "default";
298 #address-cells = <1>;
299 #size-cells = <0>;
300
301 bus-width = <4>;
302 max-frequency = <100000000>;
303
304 non-removable;
305 disable-wp;
306
307 mmc-pwrseq = <&sdio_pwrseq>;
308
309 vmmc-supply = <&vddao_3v3>;
310 vqmmc-supply = <&vddio_boot>;
311
312 brcmf: wifi@1 {
313 reg = <1>;
314 compatible = "brcm,bcm4329-fmac";
315 };
316 };
317
318 /* SD card */
319 &sd_emmc_b {
320 status = "okay";
321 pinctrl-0 = <&sdcard_pins>;
322 pinctrl-names = "default";
323
324 bus-width = <4>;
325 cap-sd-highspeed;
326 max-frequency = <100000000>;
327 disable-wp;
328
329 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
330 cd-inverted;
331
332 vmmc-supply = <&vddao_3v3>;
333 vqmmc-supply = <&vddio_boot>;
334 };
335
336 /* eMMC */
337 &sd_emmc_c {
338 status = "okay";
339 pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
340 pinctrl-names = "default";
341
342 bus-width = <8>;
343 cap-sd-highspeed;
344 cap-mmc-highspeed;
345 max-frequency = <200000000>;
346 non-removable;
347 disable-wp;
348 mmc-ddr-1_8v;
349 mmc-hs200-1_8v;
350 mmc-hs400-1_8v;
351
352 mmc-pwrseq = <&emmc_pwrseq>;
353 vmmc-supply = <&vcc_3v3>;
354 vqmmc-supply = <&vddio_boot>;
355 };
356
357 /*
358 * EMMC_DS pin is shared between SPI NOR CS and eMMC Data Strobe
359 * Remove emmc_ds_pins from sd_emmc_c pinctrl-0 then spifc can be enabled
360 */
361 &spifc {
362 status = "disabled";
363 pinctrl-0 = <&nor_pins>;
364 pinctrl-names = "default";
365
366 w25q32: spi-flash@0 {
367 #address-cells = <1>;
368 #size-cells = <1>;
369 compatible = "winbond,w25q16", "jedec,spi-nor";
370 reg = <0>;
371 spi-max-frequency = <3000000>;
372 };
373 };
374
375 /* This one is connected to the Bluetooth module */
376 &uart_A {
377 status = "okay";
378 pinctrl-0 = <&uart_a_pins>;
379 pinctrl-names = "default";
380 };
381
382 /* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
383 &uart_AO {
384 status = "okay";
385 pinctrl-0 = <&uart_ao_a_pins>;
386 pinctrl-names = "default";
387 };
388
389 /* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
390 &uart_AO_B {
391 status = "okay";
392 pinctrl-0 = <&uart_ao_b_pins>;
393 pinctrl-names = "default";
394 };
395
396 &saradc {
397 status = "okay";
398 vref-supply = <&vddio_ao18>;
399 };
400
401 &usb0 {
402 status = "okay";
403 };