treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / arm64 / boot / dts / amlogic / meson-g12a-x96-max.dts
blob4f2596d829890f12ecafde8789d499e80739d85e
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (c) 2018 BayLibre SAS. All rights reserved.
4  */
6 /dts-v1/;
8 #include "meson-g12a.dtsi"
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/gpio/meson-g12a-gpio.h>
11 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
13 / {
14         compatible = "amediatech,x96-max", "amlogic,g12a";
15         model = "Shenzhen Amediatech Technology Co., Ltd X96 Max";
17         aliases {
18                 serial0 = &uart_AO;
19                 ethernet0 = &ethmac;
20         };
22         spdif_dit: audio-codec-1 {
23                 #sound-dai-cells = <0>;
24                 compatible = "linux,spdif-dit";
25                 status = "okay";
26                 sound-name-prefix = "DIT";
27         };
29         chosen {
30                 stdout-path = "serial0:115200n8";
31         };
32         memory@0 {
33                 device_type = "memory";
34                 reg = <0x0 0x0 0x0 0x40000000>;
35         };
37         cvbs-connector {
38                 compatible = "composite-video-connector";
40                 port {
41                         cvbs_connector_in: endpoint {
42                                 remote-endpoint = <&cvbs_vdac_out>;
43                         };
44                 };
45         };
47         hdmi-connector {
48                 compatible = "hdmi-connector";
49                 type = "a";
51                 port {
52                         hdmi_connector_in: endpoint {
53                                 remote-endpoint = <&hdmi_tx_tmds_out>;
54                         };
55                 };
56         };
58         emmc_pwrseq: emmc-pwrseq {
59                 compatible = "mmc-pwrseq-emmc";
60                 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
61         };
63         sdio_pwrseq: sdio-pwrseq {
64                 compatible = "mmc-pwrseq-simple";
65                 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
66                 clocks = <&wifi32k>;
67                 clock-names = "ext_clock";
68         };
70         flash_1v8: regulator-flash_1v8 {
71                 compatible = "regulator-fixed";
72                 regulator-name = "FLASH_1V8";
73                 regulator-min-microvolt = <1800000>;
74                 regulator-max-microvolt = <1800000>;
75                 vin-supply = <&vcc_3v3>;
76                 regulator-always-on;
77         };
79         dc_in: regulator-dc_in {
80                 compatible = "regulator-fixed";
81                 regulator-name = "DC_IN";
82                 regulator-min-microvolt = <5000000>;
83                 regulator-max-microvolt = <5000000>;
84                 regulator-always-on;
85         };
87         vcc_1v8: regulator-vcc_1v8 {
88                 compatible = "regulator-fixed";
89                 regulator-name = "VCC_1V8";
90                 regulator-min-microvolt = <1800000>;
91                 regulator-max-microvolt = <1800000>;
92                 vin-supply = <&vcc_3v3>;
93                 regulator-always-on;
94         };
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                 vin-supply = <&vddao_3v3>;
102                 regulator-always-on;
103                 /* FIXME: actually controlled by VDDCPU_B_EN */
104         };
106         vcc_5v: regulator-vcc_5v {
107                 compatible = "regulator-fixed";
108                 regulator-name = "VCC_5V";
109                 regulator-min-microvolt = <5000000>;
110                 regulator-max-microvolt = <5000000>;
111                 vin-supply = <&dc_in>;
113                 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
114                 enable-active-low;
115         };
117         vddao_1v8: regulator-vddao_1v8 {
118                 compatible = "regulator-fixed";
119                 regulator-name = "VDDAO_1V8";
120                 regulator-min-microvolt = <1800000>;
121                 regulator-max-microvolt = <1800000>;
122                 vin-supply = <&vddao_3v3>;
123                 regulator-always-on;
124         };
126         vddao_3v3: regulator-vddao_3v3 {
127                 compatible = "regulator-fixed";
128                 regulator-name = "VDDAO_3V3";
129                 regulator-min-microvolt = <3300000>;
130                 regulator-max-microvolt = <3300000>;
131                 vin-supply = <&dc_in>;
132                 regulator-always-on;
133         };
135         vddcpu: regulator-vddcpu {
136                 compatible = "pwm-regulator";
138                 regulator-name = "VDDCPU";
139                 regulator-min-microvolt = <721000>;
140                 regulator-max-microvolt = <1022000>;
142                 vin-supply = <&dc_in>;
144                 pwms = <&pwm_AO_cd 1 1250 0>;
145                 pwm-dutycycle-range = <100 0>;
147                 regulator-boot-on;
148                 regulator-always-on;
149         };
151         sound {
152                 compatible = "amlogic,axg-sound-card";
153                 model = "G12A-X96-MAX";
154                 audio-aux-devs = <&tdmout_b>;
155                 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
156                                 "TDMOUT_B IN 1", "FRDDR_B OUT 1",
157                                 "TDMOUT_B IN 2", "FRDDR_C OUT 1",
158                                 "TDM_B Playback", "TDMOUT_B OUT",
159                                 "SPDIFOUT IN 0", "FRDDR_A OUT 3",
160                                 "SPDIFOUT IN 1", "FRDDR_B OUT 3",
161                                 "SPDIFOUT IN 2", "FRDDR_C OUT 3";
163                 assigned-clocks = <&clkc CLKID_MPLL2>,
164                                   <&clkc CLKID_MPLL0>,
165                                   <&clkc CLKID_MPLL1>;
166                 assigned-clock-parents = <0>, <0>, <0>;
167                 assigned-clock-rates = <294912000>,
168                                        <270950400>,
169                                        <393216000>;
170                 status = "okay";
172                 dai-link-0 {
173                         sound-dai = <&frddr_a>;
174                 };
176                 dai-link-1 {
177                         sound-dai = <&frddr_b>;
178                 };
180                 dai-link-2 {
181                         sound-dai = <&frddr_c>;
182                 };
184                 /* 8ch hdmi interface */
185                 dai-link-3 {
186                         sound-dai = <&tdmif_b>;
187                         dai-format = "i2s";
188                         dai-tdm-slot-tx-mask-0 = <1 1>;
189                         dai-tdm-slot-tx-mask-1 = <1 1>;
190                         dai-tdm-slot-tx-mask-2 = <1 1>;
191                         dai-tdm-slot-tx-mask-3 = <1 1>;
192                         mclk-fs = <256>;
194                         codec {
195                                 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
196                         };
197                 };
199                 /* spdif hdmi or toslink interface */
200                 dai-link-4 {
201                         sound-dai = <&spdifout>;
203                         codec-0 {
204                                 sound-dai = <&spdif_dit>;
205                         };
207                         codec-1 {
208                                 sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
209                         };
210                 };
212                 /* spdif hdmi interface */
213                 dai-link-5 {
214                         sound-dai = <&spdifout_b>;
216                         codec {
217                                 sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
218                         };
219                 };
221                 /* hdmi glue */
222                 dai-link-6 {
223                         sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
225                         codec {
226                                 sound-dai = <&hdmi_tx>;
227                         };
228                 };
229         };
231         wifi32k: wifi32k {
232                 compatible = "pwm-clock";
233                 #clock-cells = <0>;
234                 clock-frequency = <32768>;
235                 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
236         };
239 &arb {
240         status = "okay";
243 &cec_AO {
244         pinctrl-0 = <&cec_ao_a_h_pins>;
245         pinctrl-names = "default";
246         status = "disabled";
247         hdmi-phandle = <&hdmi_tx>;
250 &cecb_AO {
251         pinctrl-0 = <&cec_ao_b_h_pins>;
252         pinctrl-names = "default";
253         status = "okay";
254         hdmi-phandle = <&hdmi_tx>;
257 &clkc_audio {
258         status = "okay";
261 &cpu0 {
262         cpu-supply = <&vddcpu>;
263         operating-points-v2 = <&cpu_opp_table>;
264         clocks = <&clkc CLKID_CPU_CLK>;
265         clock-latency = <50000>;
268 &cpu1 {
269         cpu-supply = <&vddcpu>;
270         operating-points-v2 = <&cpu_opp_table>;
271         clocks = <&clkc CLKID_CPU_CLK>;
272         clock-latency = <50000>;
275 &cpu2 {
276         cpu-supply = <&vddcpu>;
277         operating-points-v2 = <&cpu_opp_table>;
278         clocks = <&clkc CLKID_CPU_CLK>;
279         clock-latency = <50000>;
282 &cpu3 {
283         cpu-supply = <&vddcpu>;
284         operating-points-v2 = <&cpu_opp_table>;
285         clocks = <&clkc CLKID_CPU_CLK>;
286         clock-latency = <50000>;
289 &cvbs_vdac_port {
290         cvbs_vdac_out: endpoint {
291                 remote-endpoint = <&cvbs_connector_in>;
292         };
295 &frddr_a {
296         status = "okay";
299 &frddr_b {
300         status = "okay";
303 &frddr_c {
304         status = "okay";
307 &hdmi_tx {
308         status = "okay";
309         pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
310         pinctrl-names = "default";
311         hdmi-supply = <&vcc_5v>;
314 &hdmi_tx_tmds_port {
315         hdmi_tx_tmds_out: endpoint {
316                 remote-endpoint = <&hdmi_connector_in>;
317         };
320 &ir {
321         status = "okay";
322         pinctrl-0 = <&remote_input_ao_pins>;
323         pinctrl-names = "default";
324         linux,rc-map-name = "rc-x96max";
327 &pwm_AO_cd {
328         pinctrl-0 = <&pwm_ao_d_e_pins>;
329         pinctrl-names = "default";
330         clocks = <&xtal>;
331         clock-names = "clkin1";
332         status = "okay";
335 &ext_mdio {
336         external_phy: ethernet-phy@0 {
337                 /* Realtek RTL8211F (0x001cc916) */
338                 reg = <0>;
339                 max-speed = <1000>;
340                 eee-broken-1000t;
342                 reset-assert-us = <10000>;
343                 reset-deassert-us = <30000>;
344                 reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
346                 interrupt-parent = <&gpio_intc>;
347                 /* MAC_INTR on GPIOZ_14 */
348                 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
349         };
352 &ethmac {
353         pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
354         pinctrl-names = "default";
355         status = "okay";
356         phy-mode = "rgmii";
357         phy-handle = <&external_phy>;
358         amlogic,tx-delay-ns = <2>;
361 &pwm_ef {
362         status = "okay";
363         pinctrl-0 = <&pwm_e_pins>;
364         pinctrl-names = "default";
365         clocks = <&xtal>;
366         clock-names = "clkin0";
369 &uart_A {
370         status = "okay";
371         pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
372         pinctrl-names = "default";
373         uart-has-rtscts;
375         bluetooth {
376                 compatible = "brcm,bcm43438-bt";
377                 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
378                 max-speed = <2000000>;
379                 clocks = <&wifi32k>;
380                 clock-names = "lpo";
381         };
384 &uart_AO {
385         status = "okay";
386         pinctrl-0 = <&uart_ao_a_pins>;
387         pinctrl-names = "default";
390 &usb {
391         status = "okay";
392         dr_mode = "host";
395 /* SDIO */
396 &sd_emmc_a {
397         status = "okay";
398         pinctrl-0 = <&sdio_pins>;
399         pinctrl-1 = <&sdio_clk_gate_pins>;
400         pinctrl-names = "default", "clk-gate";
401         #address-cells = <1>;
402         #size-cells = <0>;
404         bus-width = <4>;
405         cap-sd-highspeed;
406         sd-uhs-sdr50;
407         max-frequency = <100000000>;
409         non-removable;
410         disable-wp;
412         /* WiFi firmware requires power to be kept while in suspend */
413         keep-power-in-suspend;
415         mmc-pwrseq = <&sdio_pwrseq>;
417         vmmc-supply = <&vddao_3v3>;
418         vqmmc-supply = <&vddao_1v8>;
420         brcmf: wifi@1 {
421                 reg = <1>;
422                 compatible = "brcm,bcm4329-fmac";
423         };
426 /* SD card */
427 &sd_emmc_b {
428         status = "okay";
429         pinctrl-0 = <&sdcard_c_pins>;
430         pinctrl-1 = <&sdcard_clk_gate_c_pins>;
431         pinctrl-names = "default", "clk-gate";
433         bus-width = <4>;
434         cap-sd-highspeed;
435         max-frequency = <100000000>;
436         disable-wp;
438         cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
439         vmmc-supply = <&vddao_3v3>;
440         vqmmc-supply = <&vddao_3v3>;
443 /* eMMC */
444 &sd_emmc_c {
445         status = "okay";
446         pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
447         pinctrl-1 = <&emmc_clk_gate_pins>;
448         pinctrl-names = "default", "clk-gate";
450         bus-width = <8>;
451         cap-mmc-highspeed;
452         max-frequency = <100000000>;
453         non-removable;
454         disable-wp;
456         mmc-pwrseq = <&emmc_pwrseq>;
457         vmmc-supply = <&vcc_3v3>;
458         vqmmc-supply = <&flash_1v8>;
461 &spdifout {
462         pinctrl-0 = <&spdif_out_h_pins>;
463         pinctrl-names = "default";
464         status = "okay";
467 &spdifout_b {
468         status = "okay";
471 &tdmif_b {
472         status = "okay";
475 &tdmout_b {
476         status = "okay";
479 &tohdmitx {
480         status = "okay";