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	sdio_pwrseq: sdio-pwrseq {
55		compatible = "mmc-pwrseq-simple";
56		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
57		clocks = <&wifi32k>;
58		clock-names = "ext_clock";
59	};
60
61	flash_1v8: regulator-flash_1v8 {
62		compatible = "regulator-fixed";
63		regulator-name = "FLASH_1V8";
64		regulator-min-microvolt = <1800000>;
65		regulator-max-microvolt = <1800000>;
66		vin-supply = <&vcc_3v3>;
67		regulator-always-on;
68	};
69
70	dc_in: regulator-dc_in {
71		compatible = "regulator-fixed";
72		regulator-name = "DC_IN";
73		regulator-min-microvolt = <5000000>;
74		regulator-max-microvolt = <5000000>;
75		regulator-always-on;
76	};
77
78	vcc_1v8: regulator-vcc_1v8 {
79		compatible = "regulator-fixed";
80		regulator-name = "VCC_1V8";
81		regulator-min-microvolt = <1800000>;
82		regulator-max-microvolt = <1800000>;
83		vin-supply = <&vcc_3v3>;
84		regulator-always-on;
85	};
86
87	vcc_3v3: regulator-vcc_3v3 {
88		compatible = "regulator-fixed";
89		regulator-name = "VCC_3V3";
90		regulator-min-microvolt = <3300000>;
91		regulator-max-microvolt = <3300000>;
92		vin-supply = <&vddao_3v3>;
93		regulator-always-on;
94		/* FIXME: actually controlled by VDDCPU_B_EN */
95	};
96
97	vcc_5v: regulator-vcc_5v {
98		compatible = "regulator-fixed";
99		regulator-name = "VCC_5V";
100		regulator-min-microvolt = <5000000>;
101		regulator-max-microvolt = <5000000>;
102		vin-supply = <&dc_in>;
103
104		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
105		enable-active-low;
106	};
107
108	vddao_1v8: regulator-vddao_1v8 {
109		compatible = "regulator-fixed";
110		regulator-name = "VDDAO_1V8";
111		regulator-min-microvolt = <1800000>;
112		regulator-max-microvolt = <1800000>;
113		vin-supply = <&vddao_3v3>;
114		regulator-always-on;
115	};
116
117	vddao_3v3: regulator-vddao_3v3 {
118		compatible = "regulator-fixed";
119		regulator-name = "VDDAO_3V3";
120		regulator-min-microvolt = <3300000>;
121		regulator-max-microvolt = <3300000>;
122		vin-supply = <&dc_in>;
123		regulator-always-on;
124	};
125
126	wifi32k: wifi32k {
127		compatible = "pwm-clock";
128		#clock-cells = <0>;
129		clock-frequency = <32768>;
130		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
131	};
132};
133
134&cec_AO {
135	pinctrl-0 = <&cec_ao_a_h_pins>;
136	pinctrl-names = "default";
137	status = "disabled";
138	hdmi-phandle = <&hdmi_tx>;
139};
140
141&cecb_AO {
142	pinctrl-0 = <&cec_ao_b_h_pins>;
143	pinctrl-names = "default";
144	status = "okay";
145	hdmi-phandle = <&hdmi_tx>;
146};
147
148&cvbs_vdac_port {
149	cvbs_vdac_out: endpoint {
150		remote-endpoint = <&cvbs_connector_in>;
151	};
152};
153
154&hdmi_tx {
155	status = "okay";
156	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
157	pinctrl-names = "default";
158	hdmi-supply = <&vcc_5v>;
159};
160
161&hdmi_tx_tmds_port {
162	hdmi_tx_tmds_out: endpoint {
163		remote-endpoint = <&hdmi_connector_in>;
164	};
165};
166
167&ir {
168	status = "okay";
169	pinctrl-0 = <&remote_input_ao_pins>;
170	pinctrl-names = "default";
171};
172
173&ext_mdio {
174	external_phy: ethernet-phy@0 {
175		/* Realtek RTL8211F (0x001cc916) */
176		reg = <0>;
177		max-speed = <1000>;
178		eee-broken-1000t;
179	};
180};
181
182&ethmac {
183	pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
184	pinctrl-names = "default";
185	status = "okay";
186	phy-mode = "rgmii";
187	phy-handle = <&external_phy>;
188	amlogic,tx-delay-ns = <2>;
189	snps,reset-gpio = <&gpio GPIOZ_14 0>;
190	snps,reset-delays-us = <0 10000 1000000>;
191	snps,reset-active-low;
192};
193
194&pwm_ef {
195	status = "okay";
196	pinctrl-0 = <&pwm_e_pins>;
197	pinctrl-names = "default";
198	clocks = <&xtal>;
199	clock-names = "clkin0";
200};
201
202&uart_A {
203	status = "okay";
204	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
205	pinctrl-names = "default";
206	uart-has-rtscts;
207
208	bluetooth {
209		compatible = "brcm,bcm43438-bt";
210		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
211		max-speed = <2000000>;
212		clocks = <&wifi32k>;
213		clock-names = "lpo";
214	};
215};
216
217&uart_AO {
218	status = "okay";
219	pinctrl-0 = <&uart_ao_a_pins>;
220	pinctrl-names = "default";
221};
222
223&usb {
224	status = "okay";
225	dr_mode = "host";
226};
227
228/* SDIO */
229&sd_emmc_a {
230	status = "okay";
231	pinctrl-0 = <&sdio_pins>;
232	pinctrl-1 = <&sdio_clk_gate_pins>;
233	pinctrl-names = "default", "clk-gate";
234	#address-cells = <1>;
235	#size-cells = <0>;
236
237	bus-width = <4>;
238	cap-sd-highspeed;
239	sd-uhs-sdr50;
240	max-frequency = <100000000>;
241
242	non-removable;
243	disable-wp;
244
245	mmc-pwrseq = <&sdio_pwrseq>;
246
247	vmmc-supply = <&vddao_3v3>;
248	vqmmc-supply = <&vddao_1v8>;
249
250	brcmf: wifi@1 {
251		reg = <1>;
252		compatible = "brcm,bcm4329-fmac";
253	};
254};
255
256/* SD card */
257&sd_emmc_b {
258	status = "okay";
259	pinctrl-0 = <&sdcard_c_pins>;
260	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
261	pinctrl-names = "default", "clk-gate";
262
263	bus-width = <4>;
264	cap-sd-highspeed;
265	max-frequency = <100000000>;
266	disable-wp;
267
268	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
269	vmmc-supply = <&vddao_3v3>;
270	vqmmc-supply = <&vddao_3v3>;
271};
272
273/* eMMC */
274&sd_emmc_c {
275	status = "okay";
276	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
277	pinctrl-1 = <&emmc_clk_gate_pins>;
278	pinctrl-names = "default", "clk-gate";
279
280	bus-width = <8>;
281	cap-mmc-highspeed;
282	max-frequency = <100000000>;
283	non-removable;
284	disable-wp;
285
286	mmc-pwrseq = <&emmc_pwrseq>;
287	vmmc-supply = <&vcc_3v3>;
288	vqmmc-supply = <&flash_1v8>;
289};
290