1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Andreas Färber
4 * Copyright (c) 2016 BayLibre, Inc.
5 * Author: Neil Armstrong <narmstrong@kernel.org>
6 */
7
8/dts-v1/;
9
10#include "meson-gxbb.dtsi"
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13
14/ {
15	compatible = "nexbox,a95x", "amlogic,meson-gxbb";
16	model = "NEXBOX A95X";
17
18	aliases {
19		serial0 = &uart_AO;
20		ethernet0 = &ethmac;
21	};
22
23	chosen {
24		stdout-path = "serial0:115200n8";
25	};
26
27	memory@0 {
28		device_type = "memory";
29		reg = <0x0 0x0 0x0 0x40000000>;
30	};
31
32	leds {
33		compatible = "gpio-leds";
34		blue {
35			label = "a95x:system-status";
36			gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
37			linux,default-trigger = "heartbeat";
38			default-state = "off";
39		};
40	};
41
42	gpio-keys-polled {
43		compatible = "gpio-keys-polled";
44		#address-cells = <1>;
45		#size-cells = <0>;
46		poll-interval = <100>;
47
48		button@0 {
49			label = "reset";
50			linux,code = <KEY_RESTART>;
51			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
52		};
53	};
54
55	usb_pwr: regulator-usb-pwrs {
56		compatible = "regulator-fixed";
57
58		regulator-name = "USB_PWR";
59
60		regulator-min-microvolt = <5000000>;
61		regulator-max-microvolt = <5000000>;
62
63		gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
64		enable-active-high;
65	};
66
67	vddio_card: gpio-regulator {
68		compatible = "regulator-gpio";
69
70		regulator-name = "VDDIO_CARD";
71		regulator-min-microvolt = <1800000>;
72		regulator-max-microvolt = <3300000>;
73
74		gpios = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
75		gpios-states = <1>;
76
77		/* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */
78		states = <1800000 0
79			  3300000 1>;
80	};
81
82	vddio_boot: regulator-vddio_boot {
83		compatible = "regulator-fixed";
84		regulator-name = "VDDIO_BOOT";
85		regulator-min-microvolt = <1800000>;
86		regulator-max-microvolt = <1800000>;
87	};
88
89	vddao_3v3: regulator-vddao_3v3 {
90		compatible = "regulator-fixed";
91		regulator-name = "VDDAO_3V3";
92		regulator-min-microvolt = <3300000>;
93		regulator-max-microvolt = <3300000>;
94	};
95
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	};
102
103	emmc_pwrseq: emmc-pwrseq {
104		compatible = "mmc-pwrseq-emmc";
105		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
106	};
107
108	wifi32k: wifi32k {
109		compatible = "pwm-clock";
110		#clock-cells = <0>;
111		clock-frequency = <32768>;
112		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
113	};
114
115	sdio_pwrseq: sdio-pwrseq {
116		compatible = "mmc-pwrseq-simple";
117		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
118		clocks = <&wifi32k>;
119		clock-names = "ext_clock";
120	};
121
122	cvbs-connector {
123		compatible = "composite-video-connector";
124
125		port {
126			cvbs_connector_in: endpoint {
127				remote-endpoint = <&cvbs_vdac_out>;
128			};
129		};
130	};
131
132	hdmi-connector {
133		compatible = "hdmi-connector";
134		type = "a";
135
136		port {
137			hdmi_connector_in: endpoint {
138				remote-endpoint = <&hdmi_tx_tmds_out>;
139			};
140		};
141	};
142};
143
144&cvbs_vdac_port {
145	cvbs_vdac_out: endpoint {
146		remote-endpoint = <&cvbs_connector_in>;
147	};
148};
149
150&cec_AO {
151	status = "okay";
152	pinctrl-0 = <&ao_cec_pins>;
153	pinctrl-names = "default";
154	hdmi-phandle = <&hdmi_tx>;
155};
156
157&ethmac {
158	status = "okay";
159	pinctrl-0 = <&eth_rmii_pins>;
160	pinctrl-names = "default";
161
162	phy-handle = <&eth_phy0>;
163	phy-mode = "rmii";
164
165	mdio {
166		compatible = "snps,dwmac-mdio";
167		#address-cells = <1>;
168		#size-cells = <0>;
169
170		eth_phy0: ethernet-phy@0 {
171			/* IC Plus IP101GR (0x02430c54) */
172			reg = <0>;
173
174			reset-assert-us = <10000>;
175			reset-deassert-us = <10000>;
176			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
177		};
178	};
179};
180
181&hdmi_tx {
182	status = "okay";
183	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
184	pinctrl-names = "default";
185};
186
187&hdmi_tx_tmds_port {
188	hdmi_tx_tmds_out: endpoint {
189		remote-endpoint = <&hdmi_connector_in>;
190	};
191};
192
193&ir {
194	status = "okay";
195	pinctrl-0 = <&remote_input_ao_pins>;
196	pinctrl-names = "default";
197};
198
199&pwm_ef {
200	status = "okay";
201	pinctrl-0 = <&pwm_e_pins>;
202	pinctrl-names = "default";
203	clocks = <&clkc CLKID_FCLK_DIV4>;
204	clock-names = "clkin0";
205};
206
207/* Wireless SDIO Module */
208&sd_emmc_a {
209	status = "okay";
210	pinctrl-0 = <&sdio_pins>;
211	pinctrl-1 = <&sdio_clk_gate_pins>;
212	pinctrl-names = "default", "clk-gate";
213	#address-cells = <1>;
214	#size-cells = <0>;
215
216	bus-width = <4>;
217	cap-sd-highspeed;
218	max-frequency = <100000000>;
219
220	non-removable;
221	disable-wp;
222
223	mmc-pwrseq = <&sdio_pwrseq>;
224
225	vmmc-supply = <&vddao_3v3>;
226	vqmmc-supply = <&vddio_boot>;
227};
228
229/* SD card */
230&sd_emmc_b {
231	status = "okay";
232	pinctrl-0 = <&sdcard_pins>;
233	pinctrl-1 = <&sdcard_clk_gate_pins>;
234	pinctrl-names = "default", "clk-gate";
235
236	bus-width = <4>;
237	cap-sd-highspeed;
238	max-frequency = <50000000>;
239	disable-wp;
240
241	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
242
243	vmmc-supply = <&vddao_3v3>;
244	vqmmc-supply = <&vddio_card>;
245};
246
247/* eMMC */
248&sd_emmc_c {
249	status = "okay";
250	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
251	pinctrl-1 = <&emmc_clk_gate_pins>;
252	pinctrl-names = "default", "clk-gate";
253
254	bus-width = <8>;
255	cap-mmc-highspeed;
256	max-frequency = <200000000>;
257	non-removable;
258	disable-wp;
259	mmc-ddr-1_8v;
260	mmc-hs200-1_8v;
261
262	mmc-pwrseq = <&emmc_pwrseq>;
263	vmmc-supply = <&vcc_3v3>;
264	vqmmc-supply = <&vddio_boot>;
265};
266
267&uart_AO {
268	status = "okay";
269	pinctrl-0 = <&uart_ao_a_pins>;
270	pinctrl-names = "default";
271};
272
273&usb0_phy {
274	status = "okay";
275	phy-supply = <&usb_pwr>;
276};
277
278&usb1_phy {
279	status = "okay";
280};
281
282&usb0 {
283	status = "okay";
284};
285
286&usb1 {
287	status = "okay";
288};
289