WIP FPC-III support
[linux/fpc-iii.git] / arch / arm64 / boot / dts / amlogic / meson-khadas-vim3.dtsi
blob8f8656262ae7885def678be3252a5f96d5b5546f
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (c) 2019 BayLibre, SAS
4  * Author: Neil Armstrong <narmstrong@baylibre.com>
5  * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
6  */
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/leds/common.h>
10 #include <dt-bindings/gpio/meson-g12a-gpio.h>
11 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
13 / {
14         aliases {
15                 serial0 = &uart_AO;
16                 ethernet0 = &ethmac;
17                 rtc0 = &rtc;
18                 rtc1 = &vrtc;
19         };
21         chosen {
22                 stdout-path = "serial0:115200n8";
23         };
25         memory@0 {
26                 device_type = "memory";
27                 reg = <0x0 0x0 0x0 0x80000000>;
28         };
30         adc-keys {
31                 compatible = "adc-keys";
32                 io-channels = <&saradc 2>;
33                 io-channel-names = "buttons";
34                 keyup-threshold-microvolt = <1710000>;
36                 button-function {
37                         label = "Function";
38                         linux,code = <KEY_FN>;
39                         press-threshold-microvolt = <10000>;
40                 };
41         };
43         leds {
44                 compatible = "gpio-leds";
46                 white {
47                         color = <LED_COLOR_ID_WHITE>;
48                         function = LED_FUNCTION_STATUS;
49                         gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
50                         linux,default-trigger = "heartbeat";
51                 };
53                 red {
54                         color = <LED_COLOR_ID_RED>;
55                         function = LED_FUNCTION_STATUS;
56                         gpios = <&gpio_expander 5 GPIO_ACTIVE_HIGH>;
57                 };
58         };
60         emmc_pwrseq: emmc-pwrseq {
61                 compatible = "mmc-pwrseq-emmc";
62                 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
63         };
65         gpio-keys-polled {
66                 compatible = "gpio-keys-polled";
67                 poll-interval = <100>;
69                 power-button {
70                         label = "power";
71                         linux,code = <KEY_POWER>;
72                         gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>;
73                 };
74         };
76         sdio_pwrseq: sdio-pwrseq {
77                 compatible = "mmc-pwrseq-simple";
78                 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
79                 clocks = <&wifi32k>;
80                 clock-names = "ext_clock";
81         };
83         dc_in: regulator-dc_in {
84                 compatible = "regulator-fixed";
85                 regulator-name = "DC_IN";
86                 regulator-min-microvolt = <5000000>;
87                 regulator-max-microvolt = <5000000>;
88                 regulator-always-on;
89         };
91         vcc_5v: regulator-vcc_5v {
92                 compatible = "regulator-fixed";
93                 regulator-name = "VCC_5V";
94                 regulator-min-microvolt = <5000000>;
95                 regulator-max-microvolt = <5000000>;
96                 vin-supply = <&dc_in>;
98                 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
99                 enable-active-high;
100         };
102         vcc_1v8: regulator-vcc_1v8 {
103                 compatible = "regulator-fixed";
104                 regulator-name = "VCC_1V8";
105                 regulator-min-microvolt = <1800000>;
106                 regulator-max-microvolt = <1800000>;
107                 vin-supply = <&vcc_3v3>;
108                 regulator-always-on;
109         };
111         vcc_3v3: regulator-vcc_3v3 {
112                 compatible = "regulator-fixed";
113                 regulator-name = "VCC_3V3";
114                 regulator-min-microvolt = <3300000>;
115                 regulator-max-microvolt = <3300000>;
116                 vin-supply = <&vsys_3v3>;
117                 regulator-always-on;
118                 /* FIXME: actually controlled by VDDCPU_B_EN */
119         };
121         vddao_1v8: regulator-vddao_1v8 {
122                 compatible = "regulator-fixed";
123                 regulator-name = "VDDIO_AO1V8";
124                 regulator-min-microvolt = <1800000>;
125                 regulator-max-microvolt = <1800000>;
126                 vin-supply = <&vsys_3v3>;
127                 regulator-always-on;
128         };
130         emmc_1v8: regulator-emmc_1v8 {
131                 compatible = "regulator-fixed";
132                 regulator-name = "EMMC_AO1V8";
133                 regulator-min-microvolt = <1800000>;
134                 regulator-max-microvolt = <1800000>;
135                 vin-supply = <&vcc_3v3>;
136                 regulator-always-on;
137         };
139         vsys_3v3: regulator-vsys_3v3 {
140                 compatible = "regulator-fixed";
141                 regulator-name = "VSYS_3V3";
142                 regulator-min-microvolt = <3300000>;
143                 regulator-max-microvolt = <3300000>;
144                 vin-supply = <&dc_in>;
145                 regulator-always-on;
146         };
148         usb_pwr: regulator-usb_pwr {
149                 compatible = "regulator-fixed";
150                 regulator-name = "USB_PWR";
151                 regulator-min-microvolt = <5000000>;
152                 regulator-max-microvolt = <5000000>;
153                 vin-supply = <&vcc_5v>;
155                 gpio = <&gpio GPIOA_6 GPIO_ACTIVE_HIGH>;
156                 enable-active-high;
157         };
159         hdmi-connector {
160                 compatible = "hdmi-connector";
161                 type = "a";
163                 port {
164                         hdmi_connector_in: endpoint {
165                                 remote-endpoint = <&hdmi_tx_tmds_out>;
166                         };
167                 };
168         };
171         sound {
172                 compatible = "amlogic,axg-sound-card";
173                 model = "G12B-KHADAS-VIM3";
174                 audio-aux-devs = <&tdmout_a>;
175                 audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
176                                 "TDMOUT_A IN 1", "FRDDR_B OUT 0",
177                                 "TDMOUT_A IN 2", "FRDDR_C OUT 0",
178                                 "TDM_A Playback", "TDMOUT_A OUT";
180                 assigned-clocks = <&clkc CLKID_MPLL2>,
181                                   <&clkc CLKID_MPLL0>,
182                                   <&clkc CLKID_MPLL1>;
183                 assigned-clock-parents = <0>, <0>, <0>;
184                 assigned-clock-rates = <294912000>,
185                                        <270950400>,
186                                        <393216000>;
187                 status = "okay";
189                 dai-link-0 {
190                         sound-dai = <&frddr_a>;
191                 };
193                 dai-link-1 {
194                         sound-dai = <&frddr_b>;
195                 };
197                 dai-link-2 {
198                         sound-dai = <&frddr_c>;
199                 };
201                 /* 8ch hdmi interface */
202                 dai-link-3 {
203                         sound-dai = <&tdmif_a>;
204                         dai-format = "i2s";
205                         dai-tdm-slot-tx-mask-0 = <1 1>;
206                         dai-tdm-slot-tx-mask-1 = <1 1>;
207                         dai-tdm-slot-tx-mask-2 = <1 1>;
208                         dai-tdm-slot-tx-mask-3 = <1 1>;
209                         mclk-fs = <256>;
211                         codec {
212                                 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
213                         };
214                 };
216                 /* hdmi glue */
217                 dai-link-4 {
218                         sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
220                         codec {
221                                 sound-dai = <&hdmi_tx>;
222                         };
223                 };
224         };
226         wifi32k: wifi32k {
227                 compatible = "pwm-clock";
228                 #clock-cells = <0>;
229                 clock-frequency = <32768>;
230                 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
231         };
234 &arb {
235         status = "okay";
238 &clkc_audio {
239         status = "okay";
242 &cec_AO {
243         pinctrl-0 = <&cec_ao_a_h_pins>;
244         pinctrl-names = "default";
245         status = "disabled";
246         hdmi-phandle = <&hdmi_tx>;
249 &cecb_AO {
250         pinctrl-0 = <&cec_ao_b_h_pins>;
251         pinctrl-names = "default";
252         status = "okay";
253         hdmi-phandle = <&hdmi_tx>;
256 &cpu_thermal {
257         trips {
258                 cpu_active: cpu-active {
259                         temperature = <80000>; /* millicelsius */
260                         hysteresis = <2000>; /* millicelsius */
261                         type = "active";
262                 };
263         };
265         cooling-maps {
266                 map {
267                         trip = <&cpu_active>;
268                         cooling-device = <&khadas_mcu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
269                 };
270         };
273 &ext_mdio {
274         external_phy: ethernet-phy@0 {
275                 /* Realtek RTL8211F (0x001cc916) */
276                 reg = <0>;
277                 max-speed = <1000>;
279                 interrupt-parent = <&gpio_intc>;
280                 /* MAC_INTR on GPIOZ_14 */
281                 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
282         };
285 &ethmac {
286         pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
287         pinctrl-names = "default";
288         status = "okay";
289         phy-mode = "rgmii";
290         phy-handle = <&external_phy>;
291         amlogic,tx-delay-ns = <2>;
294 &frddr_a {
295         status = "okay";
298 &frddr_b {
299         status = "okay";
302 &frddr_c {
303         status = "okay";
306 &hdmi_tx {
307         status = "okay";
308         pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
309         pinctrl-names = "default";
310         hdmi-supply = <&vcc_5v>;
313 &hdmi_tx_tmds_port {
314         hdmi_tx_tmds_out: endpoint {
315                 remote-endpoint = <&hdmi_connector_in>;
316         };
319 &i2c_AO {
320         status = "okay";
321         pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>;
322         pinctrl-names = "default";
324         khadas_mcu: system-controller@18 {
325                 compatible = "khadas,mcu";
326                 reg = <0x18>;
327                 #cooling-cells = <2>;
328         };
330         gpio_expander: gpio-controller@20 {
331                 compatible = "ti,tca6408";
332                 reg = <0x20>;
333                 vcc-supply = <&vcc_3v3>;
334                 gpio-controller;
335                 #gpio-cells = <2>;
336         };
338         rtc: rtc@51 {
339                 compatible = "haoyu,hym8563";
340                 reg = <0x51>;
341                 #clock-cells = <0>;
342         };
345 &ir {
346         status = "okay";
347         pinctrl-0 = <&remote_input_ao_pins>;
348         pinctrl-names = "default";
349         linux,rc-map-name = "rc-khadas";
352 &pcie {
353         reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
356 &pwm_ef {
357         status = "okay";
358         pinctrl-0 = <&pwm_e_pins>;
359         pinctrl-names = "default";
362 &saradc {
363         status = "okay";
364         vref-supply = <&vddao_1v8>;
367 /* SDIO */
368 &sd_emmc_a {
369         status = "okay";
370         pinctrl-0 = <&sdio_pins>;
371         pinctrl-1 = <&sdio_clk_gate_pins>;
372         pinctrl-names = "default", "clk-gate";
373         #address-cells = <1>;
374         #size-cells = <0>;
376         bus-width = <4>;
377         cap-sd-highspeed;
378         max-frequency = <100000000>;
380         non-removable;
381         disable-wp;
383         /* WiFi firmware requires power to be kept while in suspend */
384         keep-power-in-suspend;
386         mmc-pwrseq = <&sdio_pwrseq>;
388         vmmc-supply = <&vsys_3v3>;
389         vqmmc-supply = <&vddao_1v8>;
391         brcmf: wifi@1 {
392                 reg = <1>;
393                 compatible = "brcm,bcm4329-fmac";
394         };
397 /* SD card */
398 &sd_emmc_b {
399         status = "okay";
400         pinctrl-0 = <&sdcard_c_pins>;
401         pinctrl-1 = <&sdcard_clk_gate_c_pins>;
402         pinctrl-names = "default", "clk-gate";
404         bus-width = <4>;
405         cap-sd-highspeed;
406         max-frequency = <50000000>;
407         disable-wp;
409         cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
410         vmmc-supply = <&vsys_3v3>;
411         vqmmc-supply = <&vsys_3v3>;
414 /* eMMC */
415 &sd_emmc_c {
416         status = "okay";
417         pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
418         pinctrl-1 = <&emmc_clk_gate_pins>;
419         pinctrl-names = "default", "clk-gate";
421         bus-width = <8>;
422         cap-mmc-highspeed;
423         mmc-ddr-1_8v;
424         mmc-hs200-1_8v;
425         max-frequency = <200000000>;
426         disable-wp;
428         mmc-pwrseq = <&emmc_pwrseq>;
429         vmmc-supply = <&vcc_3v3>;
430         vqmmc-supply = <&emmc_1v8>;
434  * EMMC_D4, EMMC_D5, EMMC_D6 and EMMC_D7 pins are shared between SPI NOR CS
435  * and eMMC Data 4 to 7 pins.
436  * Replace emmc_data_8b_pins to emmc_data_4b_pins from sd_emmc_c pinctrl-0,
437  * and change bus-width to 4 then spifc can be enabled.
438  */
439 &spifc {
440         status = "disabled";
441         pinctrl-0 = <&nor_pins>;
442         pinctrl-names = "default";
444         w25q128: spi-flash@0 {
445                 #address-cells = <1>;
446                 #size-cells = <1>;
447                 compatible = "winbond,w25q128fw", "jedec,spi-nor";
448                 reg = <0>;
449                 spi-max-frequency = <104000000>;
450         };
454 &tdmif_a {
455         status = "okay";
458 &tdmout_a {
459         status = "okay";
462 &tohdmitx {
463         status = "okay";
466 &uart_A {
467         status = "okay";
468         pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
469         pinctrl-names = "default";
470         uart-has-rtscts;
472         bluetooth {
473                 compatible = "brcm,bcm43438-bt";
474                 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
475                 max-speed = <2000000>;
476                 clocks = <&wifi32k>;
477                 clock-names = "lpo";
478         };
481 &uart_AO {
482         status = "okay";
483         pinctrl-0 = <&uart_ao_a_pins>;
484         pinctrl-names = "default";
487 &usb2_phy0 {
488         phy-supply = <&dc_in>;
491 &usb2_phy1 {
492         phy-supply = <&usb_pwr>;
495 &usb3_pcie_phy {
496         phy-supply = <&usb_pwr>;
499 &usb {
500         status = "okay";
501         dr_mode = "peripheral";