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