Debian Codegraph @

arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts

raw
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3 * Copyright (c) 2017 BayLibre, SAS.
4 * Author: Neil Armstrong <[email protected]>
5 * Author: Jerome Brunet <[email protected]>
6 */
7
8 /dts-v1/;
9
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/sound/meson-aiu.h>
12
13 #include "meson-gxl-s905x.dtsi"
14
15 / {
16 compatible = "libretech,aml-s905x-cc", "amlogic,s905x",
17 "amlogic,meson-gxl";
18 model = "Libre Computer AML-S905X-CC";
19
20 aliases {
21 serial0 = &uart_AO;
22 ethernet0 = &ethmac;
23 };
24
25 dio2133: analog-amplifier {
26 compatible = "simple-audio-amplifier";
27 sound-name-prefix = "AU2";
28 VCC-supply = <&hdmi_5v>;
29 enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
30 };
31
32 chosen {
33 stdout-path = "serial0:115200n8";
34 };
35
36 cvbs-connector {
37 compatible = "composite-video-connector";
38
39 port {
40 cvbs_connector_in: endpoint {
41 remote-endpoint = <&cvbs_vdac_out>;
42 };
43 };
44 };
45
46 emmc_pwrseq: emmc-pwrseq {
47 compatible = "mmc-pwrseq-emmc";
48 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
49 };
50
51 hdmi-connector {
52 compatible = "hdmi-connector";
53 type = "a";
54
55 port {
56 hdmi_connector_in: endpoint {
57 remote-endpoint = <&hdmi_tx_tmds_out>;
58 };
59 };
60 };
61
62 leds {
63 compatible = "gpio-leds";
64
65 led-system {
66 label = "librecomputer:system-status";
67 gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
68 default-state = "on";
69 panic-indicator;
70 };
71
72 led-blue {
73 label = "librecomputer:blue";
74 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
75 linux,default-trigger = "heartbeat";
76 };
77 };
78
79 memory@0 {
80 device_type = "memory";
81 reg = <0x0 0x0 0x0 0x80000000>;
82 };
83
84 hdmi_5v: regulator-hdmi-5v {
85 compatible = "regulator-fixed";
86
87 regulator-name = "HDMI_5V";
88 regulator-min-microvolt = <5000000>;
89 regulator-max-microvolt = <5000000>;
90
91 gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
92 enable-active-high;
93 regulator-always-on;
94 };
95
96 vcc_3v3: regulator-vcc-3v3 {
97 compatible = "regulator-fixed";
98 regulator-name = "VCC_3V3";
99 regulator-min-microvolt = <3300000>;
100 regulator-max-microvolt = <3300000>;
101 };
102
103 vcc_card: regulator-vcc-card {
104 compatible = "regulator-gpio";
105
106 regulator-name = "VCC_CARD";
107 regulator-min-microvolt = <1800000>;
108 regulator-max-microvolt = <3300000>;
109
110 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
111 gpios-states = <0>;
112
113 states = <3300000 0>,
114 <1800000 1>;
115
116 regulator-settling-time-up-us = <200>;
117 regulator-settling-time-down-us = <50000>;
118 };
119
120 vddio_ao18: regulator-vddio-ao18 {
121 compatible = "regulator-fixed";
122 regulator-name = "VDDIO_AO18";
123 regulator-min-microvolt = <1800000>;
124 regulator-max-microvolt = <1800000>;
125 };
126
127 /* This is provided by LDOs on the eMMC daugther card */
128 vddio_boot: regulator-vddio-boot {
129 compatible = "regulator-fixed";
130 regulator-name = "VDDIO_BOOT";
131 regulator-min-microvolt = <1800000>;
132 regulator-max-microvolt = <1800000>;
133 vin-supply = <&vcc_3v3>;
134 };
135
136 sound {
137 compatible = "amlogic,gx-sound-card";
138 model = "LIBRETECH-CC";
139 audio-aux-devs = <&dio2133>;
140 audio-widgets = "Line", "Lineout";
141 audio-routing = "AU2 INL", "ACODEC LOLN",
142 "AU2 INR", "ACODEC LORN",
143 "Lineout", "AU2 OUTL",
144 "Lineout", "AU2 OUTR";
145 clocks = <&clkc CLKID_MPLL0>,
146 <&clkc CLKID_MPLL1>,
147 <&clkc CLKID_MPLL2>;
148
149 assigned-clocks = <&clkc CLKID_MPLL0>,
150 <&clkc CLKID_MPLL1>,
151 <&clkc CLKID_MPLL2>;
152 assigned-clock-rates = <294912000>,
153 <270950400>,
154 <393216000>;
155
156 dai-link-0 {
157 sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
158 };
159
160 dai-link-1 {
161 sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
162 dai-format = "i2s";
163 mclk-fs = <256>;
164
165 codec-0 {
166 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
167 };
168
169 codec-1 {
170 sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
171 };
172 };
173
174 dai-link-2 {
175 sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
176
177 codec-0 {
178 sound-dai = <&hdmi_tx>;
179 };
180 };
181
182 dai-link-3 {
183 sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
184
185 codec-0 {
186 sound-dai = <&acodec>;
187 };
188 };
189 };
190 };
191
192 &acodec {
193 AVDD-supply = <&vddio_ao18>;
194 status = "okay";
195 };
196
197 &aiu {
198 status = "okay";
199 };
200
201 &cec_AO {
202 status = "okay";
203 pinctrl-0 = <&ao_cec_pins>;
204 pinctrl-names = "default";
205 hdmi-phandle = <&hdmi_tx>;
206 };
207
208 &cvbs_vdac_port {
209 cvbs_vdac_out: endpoint {
210 remote-endpoint = <&cvbs_connector_in>;
211 };
212 };
213
214 &ethmac {
215 status = "okay";
216 };
217
218 &internal_phy {
219 pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
220 pinctrl-names = "default";
221 };
222
223 &ir {
224 status = "okay";
225 pinctrl-0 = <&remote_input_ao_pins>;
226 pinctrl-names = "default";
227 };
228
229 &hdmi_tx {
230 status = "okay";
231 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
232 pinctrl-names = "default";
233 hdmi-supply = <&hdmi_5v>;
234 };
235
236 &hdmi_tx_tmds_port {
237 hdmi_tx_tmds_out: endpoint {
238 remote-endpoint = <&hdmi_connector_in>;
239 };
240 };
241
242 &gpio_ao {
243 gpio-line-names = "UART TX",
244 "UART RX",
245 "Blue LED",
246 "SDCard Voltage Switch",
247 "7J1 Header Pin5",
248 "7J1 Header Pin3",
249 "7J1 Header Pin12",
250 "IR In",
251 "9J3 Switch HDMI CEC/7J1 Header Pin11",
252 "7J1 Header Pin13",
253 /* GPIO_TEST_N */
254 "7J1 Header Pin15";
255 };
256
257 &gpio {
258 gpio-line-names = /* Bank GPIOZ */
259 "", "", "", "", "", "", "",
260 "", "", "", "", "", "", "",
261 "Eth Link LED", "Eth Activity LED",
262 /* Bank GPIOH */
263 "HDMI HPD", "HDMI SDA", "HDMI SCL",
264 "HDMI_5V_EN", "9J1 Header Pin2",
265 "Analog Audio Mute",
266 "2J3 Header Pin6",
267 "2J3 Header Pin5",
268 "2J3 Header Pin4",
269 "2J3 Header Pin3",
270 /* Bank BOOT */
271 "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
272 "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
273 "eMMC Clk", "eMMC Reset", "eMMC CMD",
274 "ALT BOOT MODE", "", "", "", "eMMC Data Strobe",
275 /* Bank CARD */
276 "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
277 "SDCard D3", "SDCard D2", "SDCard Det",
278 /* Bank GPIODV */
279 "", "", "", "", "", "", "", "", "", "", "", "",
280 "", "", "", "", "", "", "", "", "", "", "", "",
281 "Green LED", "VCCK Enable",
282 "7J1 Header Pin27", "7J1 Header Pin28",
283 "VCCK Regulator", "VDDEE Regulator",
284 /* Bank GPIOX */
285 "7J1 Header Pin22", "7J1 Header Pin26",
286 "7J1 Header Pin36", "7J1 Header Pin38",
287 "7J1 Header Pin40", "7J1 Header Pin37",
288 "7J1 Header Pin33", "7J1 Header Pin35",
289 "7J1 Header Pin19", "7J1 Header Pin21",
290 "7J1 Header Pin24", "7J1 Header Pin23",
291 "7J1 Header Pin8", "7J1 Header Pin10",
292 "7J1 Header Pin16", "7J1 Header Pin18",
293 "7J1 Header Pin32", "7J1 Header Pin29",
294 "7J1 Header Pin31",
295 /* Bank GPIOCLK */
296 "7J1 Header Pin7", "";
297 };
298
299 &saradc {
300 status = "okay";
301 vref-supply = <&vddio_ao18>;
302 };
303
304 /* SD card */
305 &sd_emmc_b {
306 status = "okay";
307 pinctrl-0 = <&sdcard_pins>;
308 pinctrl-1 = <&sdcard_clk_gate_pins>;
309 pinctrl-names = "default", "clk-gate";
310
311 bus-width = <4>;
312 cap-sd-highspeed;
313 max-frequency = <50000000>;
314 disable-wp;
315
316 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
317
318 vmmc-supply = <&vcc_3v3>;
319 vqmmc-supply = <&vcc_card>;
320 };
321
322 /* eMMC */
323 &sd_emmc_c {
324 status = "okay";
325 pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
326 pinctrl-1 = <&emmc_clk_gate_pins>;
327 pinctrl-names = "default", "clk-gate";
328
329 bus-width = <8>;
330 cap-mmc-highspeed;
331 mmc-ddr-1_8v;
332 mmc-hs200-1_8v;
333 max-frequency = <200000000>;
334 disable-wp;
335
336 mmc-pwrseq = <&emmc_pwrseq>;
337 vmmc-supply = <&vcc_3v3>;
338 vqmmc-supply = <&vddio_boot>;
339 };
340
341 &uart_AO {
342 status = "okay";
343 pinctrl-0 = <&uart_ao_a_pins>;
344 pinctrl-names = "default";
345 };
346
347 &usb {
348 status = "okay";
349 dr_mode = "host";
350 };
351
352 &usb2_phy0 {
353 /*
354 * even though the schematics don't show it:
355 * HDMI_5V is also used as supply for the USB VBUS.
356 */
357 phy-supply = <&hdmi_5v>;
358 };