arm64: dts: meson: libretech-pc: add initial audio playback support
[linux-2.6-microblaze.git] / arch / arm64 / boot / dts / amlogic / meson-gx-libretech-pc.dtsi
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2019 BayLibre SAS.
4  * Author: Jerome Brunet <jbrunet@baylibre.com>
5  */
6
7 /* Libretech Amlogic GX PC form factor - AKA: Tartiflette */
8
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/leds/common.h>
11 #include <dt-bindings/sound/meson-aiu.h>
12
13 / {
14         adc-keys {
15                 compatible = "adc-keys";
16                 io-channels = <&saradc 0>;
17                 io-channel-names = "buttons";
18                 keyup-threshold-microvolt = <1800000>;
19
20                 update-button {
21                         label = "update";
22                         linux,code = <KEY_VENDOR>;
23                         press-threshold-microvolt = <1300000>;
24                 };
25         };
26
27         aliases {
28                 serial0 = &uart_AO;
29                 ethernet0 = &ethmac;
30                 spi0 = &spifc;
31         };
32
33         chosen {
34                 stdout-path = "serial0:115200n8";
35         };
36
37         cvbs-connector {
38                 compatible = "composite-video-connector";
39                 status = "disabled";
40
41                 port {
42                         cvbs_connector_in: endpoint {
43                                 remote-endpoint = <&cvbs_vdac_out>;
44                         };
45                 };
46         };
47
48         emmc_pwrseq: emmc-pwrseq {
49                 compatible = "mmc-pwrseq-emmc";
50                 reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
51         };
52
53         hdmi-connector {
54                 compatible = "hdmi-connector";
55                 type = "a";
56
57                 port {
58                         hdmi_connector_in: endpoint {
59                                 remote-endpoint = <&hdmi_tx_tmds_out>;
60                         };
61                 };
62         };
63
64         gpio-keys-polled {
65                 compatible = "gpio-keys-polled";
66                 poll-interval = <100>;
67
68                 power-button {
69                         label = "power";
70                         linux,code = <KEY_POWER>;
71                         gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
72                 };
73         };
74
75         memory@0 {
76                 device_type = "memory";
77                 reg = <0x0 0x0 0x0 0x80000000>;
78         };
79
80         ao_5v: regulator-ao_5v {
81                 compatible = "regulator-fixed";
82                 regulator-name = "AO_5V";
83                 regulator-min-microvolt = <5000000>;
84                 regulator-max-microvolt = <5000000>;
85                 vin-supply = <&dc_in>;
86                 regulator-always-on;
87         };
88
89         dc_in: regulator-dc_in {
90                 compatible = "regulator-fixed";
91                 regulator-name = "DC_IN";
92                 regulator-min-microvolt = <5000000>;
93                 regulator-max-microvolt = <5000000>;
94                 regulator-always-on;
95         };
96
97         leds {
98                 compatible = "gpio-leds";
99
100                 led-green {
101                         color = <LED_COLOR_ID_GREEN>;
102                         function = LED_FUNCTION_DISK_ACTIVITY;
103                         gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
104                         linux,default-trigger = "disk-activity";
105                 };
106
107                 led-blue {
108                         color = <LED_COLOR_ID_BLUE>;
109                         function = LED_FUNCTION_STATUS;
110                         gpios = <&gpio GPIODV_28 GPIO_ACTIVE_HIGH>;
111                         linux,default-trigger = "heartbeat";
112                         panic-indicator;
113                 };
114         };
115
116         vcc_card: regulator-vcc_card {
117                 compatible = "regulator-fixed";
118                 regulator-name = "VCC_CARD";
119                 regulator-min-microvolt = <3300000>;
120                 regulator-max-microvolt = <3300000>;
121                 vin-supply = <&vddio_ao3v3>;
122
123                 gpio = <&gpio GPIODV_4 GPIO_ACTIVE_HIGH>;
124                 enable-active-high;
125         };
126
127         vcc5v: regulator-vcc5v {
128                 compatible = "regulator-fixed";
129                 regulator-name = "VCC5V";
130                 regulator-min-microvolt = <5000000>;
131                 regulator-max-microvolt = <5000000>;
132                 vin-supply = <&ao_5v>;
133
134                 gpio = <&gpio GPIOH_3 GPIO_OPEN_DRAIN>;
135         };
136
137         vddio_ao18: regulator-vddio_ao18 {
138                 compatible = "regulator-fixed";
139                 regulator-name = "VDDIO_AO18";
140                 regulator-min-microvolt = <1800000>;
141                 regulator-max-microvolt = <1800000>;
142                 vin-supply = <&ao_5v>;
143                 regulator-always-on;
144         };
145
146         vddio_ao3v3: regulator-vddio_ao3v3 {
147                 compatible = "regulator-fixed";
148                 regulator-name = "VDDIO_AO3V3";
149                 regulator-min-microvolt = <3300000>;
150                 regulator-max-microvolt = <3300000>;
151                 vin-supply = <&ao_5v>;
152                 regulator-always-on;
153         };
154
155         vddio_boot: regulator-vddio_boot {
156                 compatible = "regulator-fixed";
157                 regulator-name = "VDDIO_BOOT";
158                 regulator-min-microvolt = <1800000>;
159                 regulator-max-microvolt = <1800000>;
160                 vin-supply = <&vddio_ao3v3>;
161                 regulator-always-on;
162         };
163
164         vddio_card: regulator-vddio-card {
165                 compatible = "regulator-gpio";
166                 regulator-name = "VDDIO_CARD";
167                 regulator-min-microvolt = <1800000>;
168                 regulator-max-microvolt = <3300000>;
169
170                 gpios = <&gpio GPIODV_5 GPIO_ACTIVE_HIGH>;
171                 gpios-states = <0>;
172
173                 states = <3300000 0>,
174                          <1800000 1>;
175
176                 regulator-settling-time-up-us = <200>;
177                 regulator-settling-time-down-us = <50000>;
178         };
179
180         sound {
181                 compatible = "amlogic,gx-sound-card";
182                 model = "GXL-LIBRETECH-S9XX-PC";
183                 assigned-clocks = <&clkc CLKID_MPLL0>,
184                                   <&clkc CLKID_MPLL1>,
185                                   <&clkc CLKID_MPLL2>;
186                 assigned-clock-parents = <0>, <0>, <0>;
187                 assigned-clock-rates = <294912000>,
188                                        <270950400>,
189                                        <393216000>;
190                 status = "okay";
191
192                 dai-link-0 {
193                         sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
194                 };
195
196                 dai-link-1 {
197                         sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
198                         dai-format = "i2s";
199                         mclk-fs = <256>;
200
201                         codec-0 {
202                                 sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
203                         };
204                 };
205
206                 dai-link-2 {
207                         sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
208
209                         codec-0 {
210                                 sound-dai = <&hdmi_tx>;
211                         };
212                 };
213         };
214 };
215
216 &aiu {
217         status = "okay";
218 };
219
220 &cec_AO {
221         pinctrl-0 = <&ao_cec_pins>;
222         pinctrl-names = "default";
223         hdmi-phandle = <&hdmi_tx>;
224         status = "okay";
225 };
226
227 &cvbs_vdac_port {
228         cvbs_vdac_out: endpoint {
229                 remote-endpoint = <&cvbs_connector_in>;
230         };
231 };
232
233 &ethmac {
234         pinctrl-0 = <&eth_pins>, <&eth_phy_irq_pins>;
235         pinctrl-names = "default";
236         phy-handle = <&external_phy>;
237         amlogic,tx-delay-ns = <2>;
238         phy-mode = "rgmii";
239         status = "okay";
240 };
241
242 &external_mdio {
243         external_phy: ethernet-phy@0 {
244                 reg = <0>;
245                 max-speed = <1000>;
246                 reset-assert-us = <10000>;
247                 reset-deassert-us = <30000>;
248                 reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
249                 interrupt-parent = <&gpio_intc>;
250                 interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
251         };
252 };
253
254 &pinctrl_periphs {
255         /*
256          * Make sure the reset pin of the usb HUB is driven high to take
257          * it out of reset.
258          */
259         usb1_rst_pins: usb1_rst_irq {
260                 mux {
261                         groups = "GPIODV_3";
262                         function = "gpio_periphs";
263                         bias-disable;
264                         output-high;
265                 };
266         };
267
268         /* Make sure the phy irq pin is properly configured as input */
269         eth_phy_irq_pins: eth_phy_irq {
270                 mux {
271                         groups = "GPIOZ_15";
272                         function = "gpio_periphs";
273                         bias-disable;
274                         output-disable;
275                 };
276         };
277 };
278
279 &hdmi_tx {
280         pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
281         pinctrl-names = "default";
282         hdmi-supply = <&vcc5v>;
283         status = "okay";
284 };
285
286 &hdmi_tx_tmds_port {
287         hdmi_tx_tmds_out: endpoint {
288                 remote-endpoint = <&hdmi_connector_in>;
289         };
290 };
291
292 &ir {
293         pinctrl-0 = <&remote_input_ao_pins>;
294         pinctrl-names = "default";
295         status = "okay";
296 };
297
298 &i2c_C {
299         pinctrl-0 = <&i2c_c_dv18_pins>;
300         pinctrl-names = "default";
301         status = "okay";
302
303         rtc: rtc@51 {
304                 reg = <0x51>;
305                 compatible = "nxp,pcf8563";
306                 #clock-cells = <0>;
307                 clock-output-names = "rtc_clkout";
308         };
309 };
310
311 &pwm_AO_ab {
312         pinctrl-0 = <&pwm_ao_a_3_pins>;
313         pinctrl-names = "default";
314         clocks = <&clkc CLKID_FCLK_DIV4>;
315         clock-names = "clkin0";
316         status = "okay";
317 };
318
319 &pwm_ab {
320         pinctrl-0 = <&pwm_b_pins>;
321         pinctrl-names = "default";
322         clocks = <&clkc CLKID_FCLK_DIV4>;
323         clock-names = "clkin0";
324         status = "okay";
325 };
326
327 &pwm_ef {
328         pinctrl-0 = <&pwm_e_pins>, <&pwm_f_clk_pins>;
329         pinctrl-names = "default";
330         clocks = <&clkc CLKID_FCLK_DIV4>;
331         clock-names = "clkin0";
332         status = "okay";
333 };
334
335 &saradc {
336         vref-supply = <&vddio_ao18>;
337         status = "okay";
338 };
339
340 /* SD card */
341 &sd_emmc_b {
342         pinctrl-0 = <&sdcard_pins>;
343         pinctrl-1 = <&sdcard_clk_gate_pins>;
344         pinctrl-names = "default", "clk-gate";
345
346         bus-width = <4>;
347         cap-sd-highspeed;
348         sd-uhs-sdr12;
349         sd-uhs-sdr25;
350         sd-uhs-sdr50;
351         sd-uhs-ddr50;
352         max-frequency = <200000000>;
353         disable-wp;
354
355         cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
356
357         vmmc-supply = <&vcc_card>;
358         vqmmc-supply = <&vddio_card>;
359
360         status = "okay";
361 };
362
363 /* eMMC */
364 &sd_emmc_c {
365         pinctrl-0 = <&emmc_pins>;
366         pinctrl-1 = <&emmc_clk_gate_pins>;
367         pinctrl-names = "default", "clk-gate";
368
369         bus-width = <8>;
370         cap-mmc-highspeed;
371         mmc-ddr-1_8v;
372         mmc-hs200-1_8v;
373         max-frequency = <200000000>;
374         disable-wp;
375
376         mmc-pwrseq = <&emmc_pwrseq>;
377         vmmc-supply = <&vddio_ao3v3>;
378         vqmmc-supply = <&vddio_boot>;
379
380         status = "okay";
381 };
382
383 &spifc {
384         pinctrl-0 = <&nor_pins>;
385         pinctrl-names = "default";
386         status = "okay";
387
388         gd25lq128: spi-flash@0 {
389                 compatible = "jedec,spi-nor";
390                 #address-cells = <1>;
391                 #size-cells = <1>;
392                 reg = <0>;
393                 spi-max-frequency = <12000000>;
394         };
395 };
396
397 &uart_AO {
398         pinctrl-0 = <&uart_ao_a_pins>;
399         pinctrl-names = "default";
400         status = "okay";
401 };
402
403 &usb {
404         status = "okay";
405         dr_mode = "host";
406 };
407
408 &usb2_phy0 {
409         pinctrl-0 = <&usb1_rst_pins>;
410         pinctrl-names = "default";
411         phy-supply = <&vcc5v>;
412 };
413
414 &usb2_phy1 {
415         phy-supply = <&vcc5v>;
416 };