1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 BayLibre SAS. All rights reserved.
4 */
5
6/dts-v1/;
7
8#include "meson-g12a.dtsi"
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/gpio/meson-g12a-gpio.h>
11
12/ {
13	compatible = "amediatech,x96-max", "amlogic,u200", "amlogic,g12a";
14	model = "Shenzhen Amediatech Technology Co., Ltd X96 Max";
15
16	aliases {
17		serial0 = &uart_AO;
18		ethernet0 = &ethmac;
19	};
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23	memory@0 {
24		device_type = "memory";
25		reg = <0x0 0x0 0x0 0x40000000>;
26	};
27
28	cvbs-connector {
29		compatible = "composite-video-connector";
30
31		port {
32			cvbs_connector_in: endpoint {
33				remote-endpoint = <&cvbs_vdac_out>;
34			};
35		};
36	};
37
38	hdmi-connector {
39		compatible = "hdmi-connector";
40		type = "a";
41
42		port {
43			hdmi_connector_in: endpoint {
44				remote-endpoint = <&hdmi_tx_tmds_out>;
45			};
46		};
47	};
48
49	emmc_pwrseq: emmc-pwrseq {
50		compatible = "mmc-pwrseq-emmc";
51		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
52	};
53
54	flash_1v8: regulator-flash_1v8 {
55		compatible = "regulator-fixed";
56		regulator-name = "FLASH_1V8";
57		regulator-min-microvolt = <1800000>;
58		regulator-max-microvolt = <1800000>;
59		vin-supply = <&vcc_3v3>;
60		regulator-always-on;
61	};
62
63	dc_in: regulator-dc_in {
64		compatible = "regulator-fixed";
65		regulator-name = "DC_IN";
66		regulator-min-microvolt = <5000000>;
67		regulator-max-microvolt = <5000000>;
68		regulator-always-on;
69	};
70
71	vcc_1v8: regulator-vcc_1v8 {
72		compatible = "regulator-fixed";
73		regulator-name = "VCC_1V8";
74		regulator-min-microvolt = <1800000>;
75		regulator-max-microvolt = <1800000>;
76		vin-supply = <&vcc_3v3>;
77		regulator-always-on;
78	};
79
80	vcc_3v3: regulator-vcc_3v3 {
81		compatible = "regulator-fixed";
82		regulator-name = "VCC_3V3";
83		regulator-min-microvolt = <3300000>;
84		regulator-max-microvolt = <3300000>;
85		vin-supply = <&vddao_3v3>;
86		regulator-always-on;
87		/* FIXME: actually controlled by VDDCPU_B_EN */
88	};
89
90	vcc_5v: regulator-vcc_5v {
91		compatible = "regulator-fixed";
92		regulator-name = "VCC_5V";
93		regulator-min-microvolt = <5000000>;
94		regulator-max-microvolt = <5000000>;
95		vin-supply = <&dc_in>;
96
97		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
98		enable-active-low;
99	};
100
101	vddao_1v8: regulator-vddao_1v8 {
102		compatible = "regulator-fixed";
103		regulator-name = "VDDAO_1V8";
104		regulator-min-microvolt = <1800000>;
105		regulator-max-microvolt = <1800000>;
106		vin-supply = <&vddao_3v3>;
107		regulator-always-on;
108	};
109
110	vddao_3v3: regulator-vddao_3v3 {
111		compatible = "regulator-fixed";
112		regulator-name = "VDDAO_3V3";
113		regulator-min-microvolt = <3300000>;
114		regulator-max-microvolt = <3300000>;
115		vin-supply = <&dc_in>;
116		regulator-always-on;
117	};
118};
119
120&cec_AO {
121	pinctrl-0 = <&cec_ao_a_h_pins>;
122	pinctrl-names = "default";
123	status = "disabled";
124	hdmi-phandle = <&hdmi_tx>;
125};
126
127&cecb_AO {
128	pinctrl-0 = <&cec_ao_b_h_pins>;
129	pinctrl-names = "default";
130	status = "okay";
131	hdmi-phandle = <&hdmi_tx>;
132};
133
134&cvbs_vdac_port {
135	cvbs_vdac_out: endpoint {
136		remote-endpoint = <&cvbs_connector_in>;
137	};
138};
139
140&hdmi_tx {
141	status = "okay";
142	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
143	pinctrl-names = "default";
144	hdmi-supply = <&vcc_5v>;
145};
146
147&hdmi_tx_tmds_port {
148	hdmi_tx_tmds_out: endpoint {
149		remote-endpoint = <&hdmi_connector_in>;
150	};
151};
152
153&ir {
154	status = "okay";
155	pinctrl-0 = <&remote_input_ao_pins>;
156	pinctrl-names = "default";
157};
158
159&ext_mdio {
160	external_phy: ethernet-phy@0 {
161		/* Realtek RTL8211F (0x001cc916) */
162		reg = <0>;
163		max-speed = <1000>;
164		eee-broken-1000t;
165	};
166};
167
168&ethmac {
169	pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
170	pinctrl-names = "default";
171	status = "okay";
172	phy-mode = "rgmii";
173	phy-handle = <&external_phy>;
174	amlogic,tx-delay-ns = <2>;
175	snps,reset-gpio = <&gpio GPIOZ_14 0>;
176	snps,reset-delays-us = <0 10000 1000000>;
177	snps,reset-active-low;
178};
179
180&uart_A {
181	status = "okay";
182	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
183	pinctrl-names = "default";
184	uart-has-rtscts;
185
186	bluetooth {
187		compatible = "brcm,bcm43438-bt";
188		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
189	};
190};
191
192&uart_AO {
193	status = "okay";
194	pinctrl-0 = <&uart_ao_a_pins>;
195	pinctrl-names = "default";
196};
197
198&usb {
199	status = "okay";
200	dr_mode = "host";
201};
202
203/* SD card */
204&sd_emmc_b {
205	status = "okay";
206	pinctrl-0 = <&sdcard_c_pins>;
207	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
208	pinctrl-names = "default", "clk-gate";
209
210	bus-width = <4>;
211	cap-sd-highspeed;
212	max-frequency = <100000000>;
213	disable-wp;
214
215	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
216	vmmc-supply = <&vddao_3v3>;
217	vqmmc-supply = <&vddao_3v3>;
218};
219
220/* eMMC */
221&sd_emmc_c {
222	status = "okay";
223	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
224	pinctrl-1 = <&emmc_clk_gate_pins>;
225	pinctrl-names = "default", "clk-gate";
226
227	bus-width = <8>;
228	cap-mmc-highspeed;
229	max-frequency = <100000000>;
230	non-removable;
231	disable-wp;
232
233	mmc-pwrseq = <&emmc_pwrseq>;
234	vmmc-supply = <&vcc_3v3>;
235	vqmmc-supply = <&flash_1v8>;
236};
237