1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Endless Computers, Inc.
4 * Author: Carlo Caione <carlo@endlessm.com>
5 */
6
7/* Common DTSI for same Amlogic Q200/Q201 and P230/P231 boards using either
8 * the pin-compatible S912 (GXM) or S905D (GXL) SoCs.
9 */
10
11/ {
12	aliases {
13		serial0 = &uart_AO;
14		ethernet0 = &ethmac;
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	memory@0 {
22		device_type = "memory";
23		reg = <0x0 0x0 0x0 0x80000000>;
24	};
25
26	hdmi_5v: regulator-hdmi-5v {
27		compatible = "regulator-fixed";
28
29		regulator-name = "HDMI_5V";
30		regulator-min-microvolt = <5000000>;
31		regulator-max-microvolt = <5000000>;
32
33		gpio = <&gpio GPIOH_3 GPIO_ACTIVE_HIGH>;
34		enable-active-high;
35		regulator-always-on;
36	};
37
38	vddio_ao18: regulator-vddio_ao18 {
39		compatible = "regulator-fixed";
40		regulator-name = "VDDIO_AO18";
41		regulator-min-microvolt = <1800000>;
42		regulator-max-microvolt = <1800000>;
43	};
44
45	vddio_boot: regulator-vddio_boot {
46		compatible = "regulator-fixed";
47		regulator-name = "VDDIO_BOOT";
48		regulator-min-microvolt = <1800000>;
49		regulator-max-microvolt = <1800000>;
50	};
51
52	vddao_3v3: regulator-vddao_3v3 {
53		compatible = "regulator-fixed";
54		regulator-name = "VDDAO_3V3";
55		regulator-min-microvolt = <3300000>;
56		regulator-max-microvolt = <3300000>;
57	};
58
59	vcc_3v3: regulator-vcc_3v3 {
60		compatible = "regulator-fixed";
61		regulator-name = "VCC_3V3";
62		regulator-min-microvolt = <3300000>;
63		regulator-max-microvolt = <3300000>;
64	};
65
66	emmc_pwrseq: emmc-pwrseq {
67		compatible = "mmc-pwrseq-emmc";
68		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
69	};
70
71	wifi32k: wifi32k {
72		compatible = "pwm-clock";
73		#clock-cells = <0>;
74		clock-frequency = <32768>;
75		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
76	};
77
78	sdio_pwrseq: sdio-pwrseq {
79		compatible = "mmc-pwrseq-simple";
80		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
81		clocks = <&wifi32k>;
82		clock-names = "ext_clock";
83	};
84
85	cvbs-connector {
86		compatible = "composite-video-connector";
87
88		port {
89			cvbs_connector_in: endpoint {
90				remote-endpoint = <&cvbs_vdac_out>;
91			};
92		};
93	};
94
95	hdmi-connector {
96		compatible = "hdmi-connector";
97		type = "a";
98
99		port {
100			hdmi_connector_in: endpoint {
101				remote-endpoint = <&hdmi_tx_tmds_out>;
102			};
103		};
104	};
105};
106
107&cec_AO {
108	status = "okay";
109	pinctrl-0 = <&ao_cec_pins>;
110	pinctrl-names = "default";
111	hdmi-phandle = <&hdmi_tx>;
112};
113
114&cvbs_vdac_port {
115	cvbs_vdac_out: endpoint {
116		remote-endpoint = <&cvbs_connector_in>;
117	};
118};
119
120&ethmac {
121	status = "okay";
122};
123
124&hdmi_tx {
125	status = "okay";
126	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
127	pinctrl-names = "default";
128	hdmi-supply = <&hdmi_5v>;
129};
130
131&hdmi_tx_tmds_port {
132	hdmi_tx_tmds_out: endpoint {
133		remote-endpoint = <&hdmi_connector_in>;
134	};
135};
136
137&ir {
138	status = "okay";
139	pinctrl-0 = <&remote_input_ao_pins>;
140	pinctrl-names = "default";
141};
142
143&pwm_ef {
144	status = "okay";
145	pinctrl-0 = <&pwm_e_pins>;
146	pinctrl-names = "default";
147	clocks = <&clkc CLKID_FCLK_DIV4>;
148	clock-names = "clkin0";
149};
150
151&saradc {
152	status = "okay";
153	vref-supply = <&vddio_ao18>;
154};
155
156/* Wireless SDIO Module */
157&sd_emmc_a {
158	status = "okay";
159	pinctrl-0 = <&sdio_pins>;
160	pinctrl-1 = <&sdio_clk_gate_pins>;
161	pinctrl-names = "default", "clk-gate";
162	#address-cells = <1>;
163	#size-cells = <0>;
164
165	bus-width = <4>;
166	cap-sd-highspeed;
167	max-frequency = <50000000>;
168
169	non-removable;
170	disable-wp;
171
172	/* WiFi firmware requires power to be kept while in suspend */
173	keep-power-in-suspend;
174
175	mmc-pwrseq = <&sdio_pwrseq>;
176
177	vmmc-supply = <&vddao_3v3>;
178	vqmmc-supply = <&vddio_boot>;
179};
180
181/* SD card */
182&sd_emmc_b {
183	status = "okay";
184	pinctrl-0 = <&sdcard_pins>;
185	pinctrl-1 = <&sdcard_clk_gate_pins>;
186	pinctrl-names = "default", "clk-gate";
187
188	bus-width = <4>;
189	cap-sd-highspeed;
190	max-frequency = <50000000>;
191	disable-wp;
192
193	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
194
195	vmmc-supply = <&vddao_3v3>;
196	vqmmc-supply = <&vddio_boot>;
197};
198
199/* eMMC */
200&sd_emmc_c {
201	status = "okay";
202	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
203	pinctrl-1 = <&emmc_clk_gate_pins>;
204	pinctrl-names = "default", "clk-gate";
205
206	bus-width = <8>;
207	cap-mmc-highspeed;
208	max-frequency = <200000000>;
209	non-removable;
210	disable-wp;
211	mmc-ddr-1_8v;
212	mmc-hs200-1_8v;
213
214	mmc-pwrseq = <&emmc_pwrseq>;
215	vmmc-supply = <&vcc_3v3>;
216	vqmmc-supply = <&vddio_boot>;
217};
218
219/* This UART is brought out to the DB9 connector */
220&uart_AO {
221	status = "okay";
222	pinctrl-0 = <&uart_ao_a_pins>;
223	pinctrl-names = "default";
224};
225
226&usb0 {
227	status = "okay";
228};
229