0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003 * Copyright (c) 2018 BayLibre SAS. All rights reserved.
0004 */
0005
0006 /dts-v1/;
0007
0008 #include "meson-g12a.dtsi"
0009 #include <dt-bindings/gpio/gpio.h>
0010 #include <dt-bindings/gpio/meson-g12a-gpio.h>
0011 #include <dt-bindings/sound/meson-g12a-tohdmitx.h>
0012
0013 / {
0014 compatible = "amediatech,x96-max", "amlogic,g12a";
0015 model = "Shenzhen Amediatech Technology Co., Ltd X96 Max";
0016
0017 aliases {
0018 serial0 = &uart_AO;
0019 ethernet0 = ðmac;
0020 };
0021
0022 spdif_dit: audio-codec-1 {
0023 #sound-dai-cells = <0>;
0024 compatible = "linux,spdif-dit";
0025 status = "okay";
0026 sound-name-prefix = "DIT";
0027 };
0028
0029 chosen {
0030 stdout-path = "serial0:115200n8";
0031 };
0032 memory@0 {
0033 device_type = "memory";
0034 reg = <0x0 0x0 0x0 0x40000000>;
0035 };
0036
0037 cvbs-connector {
0038 compatible = "composite-video-connector";
0039
0040 port {
0041 cvbs_connector_in: endpoint {
0042 remote-endpoint = <&cvbs_vdac_out>;
0043 };
0044 };
0045 };
0046
0047 hdmi-connector {
0048 compatible = "hdmi-connector";
0049 type = "a";
0050
0051 port {
0052 hdmi_connector_in: endpoint {
0053 remote-endpoint = <&hdmi_tx_tmds_out>;
0054 };
0055 };
0056 };
0057
0058 emmc_pwrseq: emmc-pwrseq {
0059 compatible = "mmc-pwrseq-emmc";
0060 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
0061 };
0062
0063 sdio_pwrseq: sdio-pwrseq {
0064 compatible = "mmc-pwrseq-simple";
0065 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
0066 clocks = <&wifi32k>;
0067 clock-names = "ext_clock";
0068 };
0069
0070 flash_1v8: regulator-flash_1v8 {
0071 compatible = "regulator-fixed";
0072 regulator-name = "FLASH_1V8";
0073 regulator-min-microvolt = <1800000>;
0074 regulator-max-microvolt = <1800000>;
0075 vin-supply = <&vcc_3v3>;
0076 regulator-always-on;
0077 };
0078
0079 dc_in: regulator-dc_in {
0080 compatible = "regulator-fixed";
0081 regulator-name = "DC_IN";
0082 regulator-min-microvolt = <5000000>;
0083 regulator-max-microvolt = <5000000>;
0084 regulator-always-on;
0085 };
0086
0087 vcc_1v8: regulator-vcc_1v8 {
0088 compatible = "regulator-fixed";
0089 regulator-name = "VCC_1V8";
0090 regulator-min-microvolt = <1800000>;
0091 regulator-max-microvolt = <1800000>;
0092 vin-supply = <&vcc_3v3>;
0093 regulator-always-on;
0094 };
0095
0096 vcc_3v3: regulator-vcc_3v3 {
0097 compatible = "regulator-fixed";
0098 regulator-name = "VCC_3V3";
0099 regulator-min-microvolt = <3300000>;
0100 regulator-max-microvolt = <3300000>;
0101 vin-supply = <&vddao_3v3>;
0102 regulator-always-on;
0103 /* FIXME: actually controlled by VDDCPU_B_EN */
0104 };
0105
0106 vcc_5v: regulator-vcc_5v {
0107 compatible = "regulator-fixed";
0108 regulator-name = "VCC_5V";
0109 regulator-min-microvolt = <5000000>;
0110 regulator-max-microvolt = <5000000>;
0111 vin-supply = <&dc_in>;
0112
0113 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
0114 enable-active-low;
0115 };
0116
0117 vddao_1v8: regulator-vddao_1v8 {
0118 compatible = "regulator-fixed";
0119 regulator-name = "VDDAO_1V8";
0120 regulator-min-microvolt = <1800000>;
0121 regulator-max-microvolt = <1800000>;
0122 vin-supply = <&vddao_3v3>;
0123 regulator-always-on;
0124 };
0125
0126 vddao_3v3: regulator-vddao_3v3 {
0127 compatible = "regulator-fixed";
0128 regulator-name = "VDDAO_3V3";
0129 regulator-min-microvolt = <3300000>;
0130 regulator-max-microvolt = <3300000>;
0131 vin-supply = <&dc_in>;
0132 regulator-always-on;
0133 };
0134
0135 vddcpu: regulator-vddcpu {
0136 compatible = "pwm-regulator";
0137
0138 regulator-name = "VDDCPU";
0139 regulator-min-microvolt = <721000>;
0140 regulator-max-microvolt = <1022000>;
0141
0142 pwm-supply = <&dc_in>;
0143
0144 pwms = <&pwm_AO_cd 1 1250 0>;
0145 pwm-dutycycle-range = <100 0>;
0146
0147 regulator-boot-on;
0148 regulator-always-on;
0149 };
0150
0151 sound {
0152 compatible = "amlogic,axg-sound-card";
0153 model = "X96-MAX";
0154 audio-aux-devs = <&tdmout_b>;
0155 audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
0156 "TDMOUT_B IN 1", "FRDDR_B OUT 1",
0157 "TDMOUT_B IN 2", "FRDDR_C OUT 1",
0158 "TDM_B Playback", "TDMOUT_B OUT",
0159 "SPDIFOUT IN 0", "FRDDR_A OUT 3",
0160 "SPDIFOUT IN 1", "FRDDR_B OUT 3",
0161 "SPDIFOUT IN 2", "FRDDR_C OUT 3";
0162
0163 assigned-clocks = <&clkc CLKID_MPLL2>,
0164 <&clkc CLKID_MPLL0>,
0165 <&clkc CLKID_MPLL1>;
0166 assigned-clock-parents = <0>, <0>, <0>;
0167 assigned-clock-rates = <294912000>,
0168 <270950400>,
0169 <393216000>;
0170 status = "okay";
0171
0172 dai-link-0 {
0173 sound-dai = <&frddr_a>;
0174 };
0175
0176 dai-link-1 {
0177 sound-dai = <&frddr_b>;
0178 };
0179
0180 dai-link-2 {
0181 sound-dai = <&frddr_c>;
0182 };
0183
0184 /* 8ch hdmi interface */
0185 dai-link-3 {
0186 sound-dai = <&tdmif_b>;
0187 dai-format = "i2s";
0188 dai-tdm-slot-tx-mask-0 = <1 1>;
0189 dai-tdm-slot-tx-mask-1 = <1 1>;
0190 dai-tdm-slot-tx-mask-2 = <1 1>;
0191 dai-tdm-slot-tx-mask-3 = <1 1>;
0192 mclk-fs = <256>;
0193
0194 codec {
0195 sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
0196 };
0197 };
0198
0199 /* spdif hdmi or toslink interface */
0200 dai-link-4 {
0201 sound-dai = <&spdifout>;
0202
0203 codec-0 {
0204 sound-dai = <&spdif_dit>;
0205 };
0206
0207 codec-1 {
0208 sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
0209 };
0210 };
0211
0212 /* spdif hdmi interface */
0213 dai-link-5 {
0214 sound-dai = <&spdifout_b>;
0215
0216 codec {
0217 sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
0218 };
0219 };
0220
0221 /* hdmi glue */
0222 dai-link-6 {
0223 sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
0224
0225 codec {
0226 sound-dai = <&hdmi_tx>;
0227 };
0228 };
0229 };
0230
0231 wifi32k: wifi32k {
0232 compatible = "pwm-clock";
0233 #clock-cells = <0>;
0234 clock-frequency = <32768>;
0235 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
0236 };
0237 };
0238
0239 &arb {
0240 status = "okay";
0241 };
0242
0243 &cec_AO {
0244 pinctrl-0 = <&cec_ao_a_h_pins>;
0245 pinctrl-names = "default";
0246 status = "disabled";
0247 hdmi-phandle = <&hdmi_tx>;
0248 };
0249
0250 &cecb_AO {
0251 pinctrl-0 = <&cec_ao_b_h_pins>;
0252 pinctrl-names = "default";
0253 status = "okay";
0254 hdmi-phandle = <&hdmi_tx>;
0255 };
0256
0257 &clkc_audio {
0258 status = "okay";
0259 };
0260
0261 &cpu0 {
0262 cpu-supply = <&vddcpu>;
0263 operating-points-v2 = <&cpu_opp_table>;
0264 clocks = <&clkc CLKID_CPU_CLK>;
0265 clock-latency = <50000>;
0266 };
0267
0268 &cpu1 {
0269 cpu-supply = <&vddcpu>;
0270 operating-points-v2 = <&cpu_opp_table>;
0271 clocks = <&clkc CLKID_CPU_CLK>;
0272 clock-latency = <50000>;
0273 };
0274
0275 &cpu2 {
0276 cpu-supply = <&vddcpu>;
0277 operating-points-v2 = <&cpu_opp_table>;
0278 clocks = <&clkc CLKID_CPU_CLK>;
0279 clock-latency = <50000>;
0280 };
0281
0282 &cpu3 {
0283 cpu-supply = <&vddcpu>;
0284 operating-points-v2 = <&cpu_opp_table>;
0285 clocks = <&clkc CLKID_CPU_CLK>;
0286 clock-latency = <50000>;
0287 };
0288
0289 &cvbs_vdac_port {
0290 cvbs_vdac_out: endpoint {
0291 remote-endpoint = <&cvbs_connector_in>;
0292 };
0293 };
0294
0295 &frddr_a {
0296 status = "okay";
0297 };
0298
0299 &frddr_b {
0300 status = "okay";
0301 };
0302
0303 &frddr_c {
0304 status = "okay";
0305 };
0306
0307 &hdmi_tx {
0308 status = "okay";
0309 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
0310 pinctrl-names = "default";
0311 hdmi-supply = <&vcc_5v>;
0312 };
0313
0314 &hdmi_tx_tmds_port {
0315 hdmi_tx_tmds_out: endpoint {
0316 remote-endpoint = <&hdmi_connector_in>;
0317 };
0318 };
0319
0320 &ir {
0321 status = "okay";
0322 pinctrl-0 = <&remote_input_ao_pins>;
0323 pinctrl-names = "default";
0324 linux,rc-map-name = "rc-x96max";
0325 };
0326
0327 &pwm_AO_cd {
0328 pinctrl-0 = <&pwm_ao_d_e_pins>;
0329 pinctrl-names = "default";
0330 clocks = <&xtal>;
0331 clock-names = "clkin1";
0332 status = "okay";
0333 };
0334
0335 &ext_mdio {
0336 external_phy: ethernet-phy@0 {
0337 /* Realtek RTL8211F (0x001cc916) */
0338 reg = <0>;
0339 max-speed = <1000>;
0340 eee-broken-1000t;
0341
0342 reset-assert-us = <10000>;
0343 reset-deassert-us = <80000>;
0344 reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
0345
0346 interrupt-parent = <&gpio_intc>;
0347 /* MAC_INTR on GPIOZ_14 */
0348 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
0349 };
0350 };
0351
0352 ðmac {
0353 pinctrl-0 = <ð_pins>, <ð_rgmii_pins>;
0354 pinctrl-names = "default";
0355 status = "okay";
0356 phy-mode = "rgmii";
0357 phy-handle = <&external_phy>;
0358 amlogic,tx-delay-ns = <2>;
0359 };
0360
0361 &pwm_ef {
0362 status = "okay";
0363 pinctrl-0 = <&pwm_e_pins>;
0364 pinctrl-names = "default";
0365 clocks = <&xtal>;
0366 clock-names = "clkin0";
0367 };
0368
0369 &uart_A {
0370 status = "okay";
0371 pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
0372 pinctrl-names = "default";
0373 uart-has-rtscts;
0374
0375 bluetooth {
0376 compatible = "brcm,bcm43438-bt";
0377 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
0378 max-speed = <2000000>;
0379 clocks = <&wifi32k>;
0380 clock-names = "lpo";
0381 };
0382 };
0383
0384 &uart_AO {
0385 status = "okay";
0386 pinctrl-0 = <&uart_ao_a_pins>;
0387 pinctrl-names = "default";
0388 };
0389
0390 &usb {
0391 status = "okay";
0392 dr_mode = "host";
0393 };
0394
0395 /* SDIO */
0396 &sd_emmc_a {
0397 status = "okay";
0398 pinctrl-0 = <&sdio_pins>;
0399 pinctrl-1 = <&sdio_clk_gate_pins>;
0400 pinctrl-names = "default", "clk-gate";
0401 #address-cells = <1>;
0402 #size-cells = <0>;
0403
0404 bus-width = <4>;
0405 cap-sd-highspeed;
0406 sd-uhs-sdr50;
0407 max-frequency = <100000000>;
0408
0409 non-removable;
0410 disable-wp;
0411
0412 /* WiFi firmware requires power to be kept while in suspend */
0413 keep-power-in-suspend;
0414
0415 mmc-pwrseq = <&sdio_pwrseq>;
0416
0417 vmmc-supply = <&vddao_3v3>;
0418 vqmmc-supply = <&vddao_1v8>;
0419
0420 brcmf: wifi@1 {
0421 reg = <1>;
0422 compatible = "brcm,bcm4329-fmac";
0423 };
0424 };
0425
0426 /* SD card */
0427 &sd_emmc_b {
0428 status = "okay";
0429 pinctrl-0 = <&sdcard_c_pins>;
0430 pinctrl-1 = <&sdcard_clk_gate_c_pins>;
0431 pinctrl-names = "default", "clk-gate";
0432
0433 bus-width = <4>;
0434 cap-sd-highspeed;
0435 max-frequency = <100000000>;
0436 disable-wp;
0437
0438 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
0439 vmmc-supply = <&vddao_3v3>;
0440 vqmmc-supply = <&vddao_3v3>;
0441 };
0442
0443 /* eMMC */
0444 &sd_emmc_c {
0445 status = "okay";
0446 pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
0447 pinctrl-1 = <&emmc_clk_gate_pins>;
0448 pinctrl-names = "default", "clk-gate";
0449
0450 bus-width = <8>;
0451 cap-mmc-highspeed;
0452 max-frequency = <100000000>;
0453 non-removable;
0454 disable-wp;
0455
0456 mmc-pwrseq = <&emmc_pwrseq>;
0457 vmmc-supply = <&vcc_3v3>;
0458 vqmmc-supply = <&flash_1v8>;
0459 };
0460
0461 &spdifout {
0462 pinctrl-0 = <&spdif_out_h_pins>;
0463 pinctrl-names = "default";
0464 status = "okay";
0465 };
0466
0467 &spdifout_b {
0468 status = "okay";
0469 };
0470
0471 &tdmif_b {
0472 status = "okay";
0473 };
0474
0475 &tdmout_b {
0476 status = "okay";
0477 };
0478
0479 &tohdmitx {
0480 status = "okay";
0481 };