blob: 5ae7bb6209cbef94ae32d80b3050df96b1b32591 [file] [log] [blame]
Tom Rini4549e782018-05-06 18:27:01 -04001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
Neil Armstrong96e7b5a2017-11-27 10:16:19 +01002/*
3 * Copyright (c) 2017 BayLibre, SAS.
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 * Author: Jerome Brunet <jbrunet@baylibre.com>
Neil Armstrong96e7b5a2017-11-27 10:16:19 +01006 */
7
8/dts-v1/;
9
10#include <dt-bindings/input/input.h>
Neil Armstrong4e7b0a32020-09-10 10:48:12 +020011#include <dt-bindings/sound/meson-aiu.h>
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010012
13#include "meson-gxl-s905x.dtsi"
14
15/ {
Jerome Brunetdd5f2352020-03-05 12:12:38 +010016 compatible = "libretech,aml-s905x-cc", "amlogic,s905x",
17 "amlogic,meson-gxl";
18 model = "Libre Computer AML-S905X-CC";
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010019
20 aliases {
21 serial0 = &uart_AO;
Neil Armstrong5b3da7f2018-06-05 10:10:44 +020022 ethernet0 = &ethmac;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010023 };
24
Neil Armstrong4e7b0a32020-09-10 10:48:12 +020025 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
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010032 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
Neil Armstrong4e7b0a32020-09-10 10:48:12 +020065 led-system {
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010066 label = "librecomputer:system-status";
67 gpios = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
68 default-state = "on";
69 panic-indicator;
70 };
71
Neil Armstrong4e7b0a32020-09-10 10:48:12 +020072 led-blue {
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010073 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
Neil Armstrong7d750c32018-04-11 17:40:40 +020084 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
Neil Armstrong96e7b5a2017-11-27 10:16:19 +010096 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>;
Neil Armstrong7d750c32018-04-11 17:40:40 +0200115
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>;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100125 };
126
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100127 /* This is provided by LDOs on the eMMC daugther card */
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100128 vddio_boot: regulator-vddio_boot {
129 compatible = "regulator-fixed";
130 regulator-name = "VDDIO_BOOT";
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100131 regulator-min-microvolt = <1800000>;
132 regulator-max-microvolt = <1800000>;
133 vin-supply = <&vcc_3v3>;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100134 };
Neil Armstrong4e7b0a32020-09-10 10:48:12 +0200135
136 sound {
137 compatible = "amlogic,gx-sound-card";
138 model = "GXL-LIBRETECH-S905X-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 assigned-clocks = <&clkc CLKID_MPLL0>,
146 <&clkc CLKID_MPLL1>,
147 <&clkc CLKID_MPLL2>;
148 assigned-clock-parents = <0>, <0>, <0>;
149 assigned-clock-rates = <294912000>,
150 <270950400>,
151 <393216000>;
152 status = "okay";
153
154 dai-link-0 {
155 sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
156 };
157
158 dai-link-1 {
159 sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
160 dai-format = "i2s";
161 mclk-fs = <256>;
162
163 codec-0 {
164 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
165 };
166
167 codec-1 {
168 sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
169 };
170 };
171
172 dai-link-2 {
173 sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
174
175 codec-0 {
176 sound-dai = <&hdmi_tx>;
177 };
178 };
179
180 dai-link-3 {
181 sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
182
183 codec-0 {
184 sound-dai = <&acodec>;
185 };
186 };
187 };
188};
189
190&acodec {
191 AVDD-supply = <&vddio_ao18>;
192 status = "okay";
193};
194
195&aiu {
196 status = "okay";
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100197};
198
Neil Armstrong7d750c32018-04-11 17:40:40 +0200199&cec_AO {
200 status = "okay";
201 pinctrl-0 = <&ao_cec_pins>;
202 pinctrl-names = "default";
203 hdmi-phandle = <&hdmi_tx>;
204};
205
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100206&cvbs_vdac_port {
207 cvbs_vdac_out: endpoint {
208 remote-endpoint = <&cvbs_connector_in>;
209 };
210};
211
212&ethmac {
213 status = "okay";
214};
215
Neil Armstrong7d750c32018-04-11 17:40:40 +0200216&internal_phy {
217 pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
218 pinctrl-names = "default";
219};
220
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100221&ir {
222 status = "okay";
223 pinctrl-0 = <&remote_input_ao_pins>;
224 pinctrl-names = "default";
225};
226
227&hdmi_tx {
228 status = "okay";
229 pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
230 pinctrl-names = "default";
Neil Armstrongbce59f92018-11-06 09:30:14 +0100231 hdmi-supply = <&hdmi_5v>;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100232};
233
234&hdmi_tx_tmds_port {
235 hdmi_tx_tmds_out: endpoint {
236 remote-endpoint = <&hdmi_connector_in>;
237 };
238};
239
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100240&gpio_ao {
Neil Armstrong7d750c32018-04-11 17:40:40 +0200241 gpio-line-names = "UART TX",
242 "UART RX",
243 "Blue LED",
244 "SDCard Voltage Switch",
245 "7J1 Header Pin5",
246 "7J1 Header Pin3",
247 "7J1 Header Pin12",
248 "IR In",
249 "9J3 Switch HDMI CEC/7J1 Header Pin11",
250 "7J1 Header Pin13",
251 /* GPIO_TEST_N */
252 "7J1 Header Pin15";
253};
254
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100255&gpio {
Neil Armstrong7d750c32018-04-11 17:40:40 +0200256 gpio-line-names = /* Bank GPIOZ */
257 "", "", "", "", "", "", "",
258 "", "", "", "", "", "", "",
259 "Eth Link LED", "Eth Activity LED",
260 /* Bank GPIOH */
261 "HDMI HPD", "HDMI SDA", "HDMI SCL",
262 "HDMI_5V_EN", "9J1 Header Pin2",
263 "Analog Audio Mute",
264 "2J3 Header Pin6",
265 "2J3 Header Pin5",
266 "2J3 Header Pin4",
267 "2J3 Header Pin3",
268 /* Bank BOOT */
269 "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
270 "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
271 "eMMC Clk", "eMMC Reset", "eMMC CMD",
272 "ALT BOOT MODE", "", "", "", "eMMC Data Strobe",
273 /* Bank CARD */
274 "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD",
275 "SDCard D3", "SDCard D2", "SDCard Det",
276 /* Bank GPIODV */
277 "", "", "", "", "", "", "", "", "", "", "", "",
278 "", "", "", "", "", "", "", "", "", "", "", "",
279 "Green LED", "VCCK Enable",
280 "7J1 Header Pin27", "7J1 Header Pin28",
281 "VCCK Regulator", "VDDEE Regulator",
282 /* Bank GPIOX */
283 "7J1 Header Pin22", "7J1 Header Pin26",
284 "7J1 Header Pin36", "7J1 Header Pin38",
285 "7J1 Header Pin40", "7J1 Header Pin37",
286 "7J1 Header Pin33", "7J1 Header Pin35",
287 "7J1 Header Pin19", "7J1 Header Pin21",
288 "7J1 Header Pin24", "7J1 Header Pin23",
289 "7J1 Header Pin8", "7J1 Header Pin10",
290 "7J1 Header Pin16", "7J1 Header Pin18",
291 "7J1 Header Pin32", "7J1 Header Pin29",
292 "7J1 Header Pin31",
293 /* Bank GPIOCLK */
294 "7J1 Header Pin7", "";
295};
296
297&saradc {
298 status = "okay";
299 vref-supply = <&vddio_ao18>;
300};
301
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100302/* SD card */
303&sd_emmc_b {
304 status = "okay";
305 pinctrl-0 = <&sdcard_pins>;
Neil Armstrong7d750c32018-04-11 17:40:40 +0200306 pinctrl-1 = <&sdcard_clk_gate_pins>;
307 pinctrl-names = "default", "clk-gate";
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100308
309 bus-width = <4>;
310 cap-sd-highspeed;
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100311 max-frequency = <50000000>;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100312 disable-wp;
313
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100314 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100315
316 vmmc-supply = <&vcc_3v3>;
317 vqmmc-supply = <&vcc_card>;
318};
319
320/* eMMC */
321&sd_emmc_c {
322 status = "okay";
Neil Armstrong7d750c32018-04-11 17:40:40 +0200323 pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
324 pinctrl-1 = <&emmc_clk_gate_pins>;
325 pinctrl-names = "default", "clk-gate";
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100326
327 bus-width = <8>;
328 cap-mmc-highspeed;
Jerome Brunetdd5f2352020-03-05 12:12:38 +0100329 mmc-ddr-1_8v;
330 mmc-hs200-1_8v;
331 max-frequency = <200000000>;
Neil Armstrong96e7b5a2017-11-27 10:16:19 +0100332 disable-wp;
333
334 mmc-pwrseq = <&emmc_pwrseq>;
335 vmmc-supply = <&vcc_3v3>;
336 vqmmc-supply = <&vddio_boot>;
337};
338
339&uart_AO {
340 status = "okay";
341 pinctrl-0 = <&uart_ao_a_pins>;
342 pinctrl-names = "default";
343};
Neil Armstrong5b3da7f2018-06-05 10:10:44 +0200344
Neil Armstrong4e7b0a32020-09-10 10:48:12 +0200345&usb {
Neil Armstrong5b3da7f2018-06-05 10:10:44 +0200346 status = "okay";
Neil Armstrong4e7b0a32020-09-10 10:48:12 +0200347 dr_mode = "host";
Neil Armstrong5b3da7f2018-06-05 10:10:44 +0200348};
349
350&usb2_phy0 {
351 /*
352 * even though the schematics don't show it:
353 * HDMI_5V is also used as supply for the USB VBUS.
354 */
355 phy-supply = <&hdmi_5v>;
356};