blob: 02f81839d4e3920d22bfe9994077bd5084afdb00 [file] [log] [blame]
Tom Rini8b0c8a12018-05-06 18:27:01 -04001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
Neil Armstrong83256d82017-11-27 10:16:20 +01002/*
3 * Copyright (c) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
Neil Armstrong83256d82017-11-27 10:16:20 +01004 */
5
6/dts-v1/;
7
Neil Armstrong83256d82017-11-27 10:16:20 +01008#include "meson-gxl-s905x-p212.dtsi"
Neil Armstrong425d9d52021-09-17 09:37:00 +02009#include <dt-bindings/input/input.h>
10#include <dt-bindings/sound/meson-aiu.h>
Neil Armstrong83256d82017-11-27 10:16:20 +010011
12/ {
13 compatible = "khadas,vim", "amlogic,s905x", "amlogic,meson-gxl";
14 model = "Khadas VIM";
15
16 adc-keys {
17 compatible = "adc-keys";
18 io-channels = <&saradc 0>;
19 io-channel-names = "buttons";
20 keyup-threshold-microvolt = <1710000>;
21
22 button-function {
23 label = "Function";
24 linux,code = <KEY_FN>;
25 press-threshold-microvolt = <10000>;
26 };
27 };
28
29 aliases {
30 serial2 = &uart_AO_B;
Neil Armstrong8e8aec22018-06-05 10:10:44 +020031 ethernet0 = &ethmac;
Neil Armstrong83256d82017-11-27 10:16:20 +010032 };
33
34 gpio-keys-polled {
35 compatible = "gpio-keys-polled";
Neil Armstrong83256d82017-11-27 10:16:20 +010036 poll-interval = <100>;
37
Jerome Brunetd34d5ef2020-03-05 12:12:38 +010038 power-button {
Neil Armstrong83256d82017-11-27 10:16:20 +010039 label = "power";
40 linux,code = <KEY_POWER>;
41 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
42 };
43 };
44
Neil Armstrong425d9d52021-09-17 09:37:00 +020045 led-controller {
Neil Armstrong83256d82017-11-27 10:16:20 +010046 compatible = "pwm-leds";
47
Neil Armstrong425d9d52021-09-17 09:37:00 +020048 led-1 {
Neil Armstrong83256d82017-11-27 10:16:20 +010049 label = "vim:red:power";
50 pwms = <&pwm_AO_ab 1 7812500 0>;
51 max-brightness = <255>;
52 linux,default-trigger = "default-on";
53 };
54 };
55
56 hdmi-connector {
57 compatible = "hdmi-connector";
58 type = "a";
59
60 port {
61 hdmi_connector_in: endpoint {
62 remote-endpoint = <&hdmi_tx_tmds_out>;
63 };
64 };
Neil Armstrong425d9d52021-09-17 09:37:00 +020065 };
66
67 sound {
68 compatible = "amlogic,gx-sound-card";
69 model = "KHADAS-VIM";
70 assigned-clocks = <&clkc CLKID_MPLL0>,
71 <&clkc CLKID_MPLL1>,
72 <&clkc CLKID_MPLL2>;
73 assigned-clock-parents = <0>, <0>, <0>;
74 assigned-clock-rates = <294912000>,
75 <270950400>,
76 <393216000>;
77 status = "okay";
78
79 dai-link-0 {
80 sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
81 };
82
83 dai-link-1 {
84 sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
85 dai-format = "i2s";
86 mclk-fs = <256>;
87
88 codec-0 {
89 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
90 };
91 };
92
93 dai-link-2 {
94 sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
95
96 codec-0 {
97 sound-dai = <&hdmi_tx>;
98 };
99 };
Neil Armstrong83256d82017-11-27 10:16:20 +0100100 };
101};
102
Neil Armstrong425d9d52021-09-17 09:37:00 +0200103&aiu {
104 status = "okay";
105};
106
Neil Armstrong5d54d1b2018-04-11 17:40:40 +0200107&cec_AO {
108 status = "okay";
109 pinctrl-0 = <&ao_cec_pins>;
110 pinctrl-names = "default";
111 hdmi-phandle = <&hdmi_tx>;
112};
113
Neil Armstrong83256d82017-11-27 10:16:20 +0100114&hdmi_tx {
115 status = "okay";
116 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
117 pinctrl-names = "default";
Neil Armstrong7ae6f6e2018-11-06 09:30:14 +0100118 hdmi-supply = <&hdmi_5v>;
Neil Armstrong83256d82017-11-27 10:16:20 +0100119};
120
121&hdmi_tx_tmds_port {
122 hdmi_tx_tmds_out: endpoint {
123 remote-endpoint = <&hdmi_connector_in>;
124 };
125};
126
127&i2c_A {
128 status = "okay";
129 pinctrl-0 = <&i2c_a_pins>;
130 pinctrl-names = "default";
131};
132
133&i2c_B {
134 status = "okay";
135 pinctrl-0 = <&i2c_b_pins>;
136 pinctrl-names = "default";
137
138 rtc: rtc@51 {
Neil Armstrong425d9d52021-09-17 09:37:00 +0200139 status = "okay";
Neil Armstrong83256d82017-11-27 10:16:20 +0100140 compatible = "haoyu,hym8563";
141 reg = <0x51>;
142 #clock-cells = <0>;
Neil Armstrong83256d82017-11-27 10:16:20 +0100143 clock-output-names = "xin32k";
144 };
145};
146
147&ir {
Jerome Brunetd34d5ef2020-03-05 12:12:38 +0100148 linux,rc-map-name = "rc-khadas";
Neil Armstrong83256d82017-11-27 10:16:20 +0100149};
150
Jerome Brunetd34d5ef2020-03-05 12:12:38 +0100151&gpio_ao {
Neil Armstrong5d54d1b2018-04-11 17:40:40 +0200152 gpio-line-names = "UART TX",
153 "UART RX",
154 "Power Key In",
155 "J9 Header Pin35",
156 "J9 Header Pin16",
157 "J9 Header Pin15",
158 "J9 Header Pin33",
159 "IR In",
160 "HDMI CEC",
161 "SYS LED",
162 /* GPIO_TEST_N */
163 "";
164};
165
Jerome Brunetd34d5ef2020-03-05 12:12:38 +0100166&gpio {
Neil Armstrong5d54d1b2018-04-11 17:40:40 +0200167 gpio-line-names = /* Bank GPIOZ */
168 "", "", "", "", "", "", "",
169 "", "", "", "", "", "", "",
170 "Power OFF",
171 "VCCK Enable",
172 /* Bank GPIOH */
173 "HDMI HPD", "HDMI SDA", "HDMI SCL",
174 "HDMI_5V_EN", "SPDIF",
175 "J9 Header Pin37",
176 "J9 Header Pin30",
177 "J9 Header Pin29",
178 "J9 Header Pin32",
179 "J9 Header Pin31",
180 /* Bank BOOT */
181 "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
182 "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
183 "eMMC Clk", "eMMC Reset", "eMMC CMD",
184 "", "BOOT_MODE", "", "", "eMMC Data Strobe",
185 /* Bank CARD */
186 "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
187 "SDCard D3", "SDCard D2", "SDCard Det",
188 /* Bank GPIODV */
189 "", "", "", "", "", "", "", "", "", "", "", "",
190 "", "", "", "", "", "", "", "", "", "", "", "",
191 "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK",
192 "VCCK Regulator", "VDDEE Regulator",
193 /* Bank GPIOX */
194 "WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2",
195 "WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD",
196 "WIFI Power Enable", "WIFI WAKE HOST",
197 "Bluetooth PCM DOUT", "Bluetooth PCM DIN",
198 "Bluetooth PCM SYNC", "Bluetooth PCM CLK",
199 "Bluetooth UART TX", "Bluetooth UART RX",
200 "Bluetooth UART CTS", "Bluetooth UART RTS",
201 "WIFI 32K", "Bluetooth Enable",
202 "Bluetooth WAKE HOST",
203 /* Bank GPIOCLK */
204 "", "J9 Header Pin39";
205};
206
Neil Armstrong83256d82017-11-27 10:16:20 +0100207&pwm_AO_ab {
208 status = "okay";
209 pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>;
210 pinctrl-names = "default";
211 clocks = <&xtal> , <&xtal>;
212 clock-names = "clkin0", "clkin1" ;
213};
214
215&pwm_ef {
216 pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
217};
218
219&sd_emmc_a {
Neil Armstrong5eb9e672023-12-13 10:30:13 +0100220 max-frequency = <100000000>;
Jerome Brunetd34d5ef2020-03-05 12:12:38 +0100221};
222
Neil Armstrong83256d82017-11-27 10:16:20 +0100223/* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
224&uart_AO {
225 status = "okay";
226};
227
228/* This is brought out on the UART_RX_AO_B (15) and UART_TX_AO_B (16) pins: */
229&uart_AO_B {
230 status = "okay";
231 pinctrl-0 = <&uart_ao_b_pins>;
232 pinctrl-names = "default";
233};
Neil Armstrong14708b12020-09-10 10:48:12 +0200234
235&usb {
236 dr_mode = "peripheral";
237};