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 = <100000000>;
168
169	non-removable;
170	disable-wp;
171
172	mmc-pwrseq = <&sdio_pwrseq>;
173
174	vmmc-supply = <&vddao_3v3>;
175	vqmmc-supply = <&vddio_boot>;
176};
177
178/* SD card */
179&sd_emmc_b {
180	status = "okay";
181	pinctrl-0 = <&sdcard_pins>;
182	pinctrl-1 = <&sdcard_clk_gate_pins>;
183	pinctrl-names = "default", "clk-gate";
184
185	bus-width = <4>;
186	cap-sd-highspeed;
187	max-frequency = <100000000>;
188	disable-wp;
189
190	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
191	cd-inverted;
192
193	vmmc-supply = <&vddao_3v3>;
194	vqmmc-supply = <&vddio_boot>;
195};
196
197/* eMMC */
198&sd_emmc_c {
199	status = "okay";
200	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
201	pinctrl-1 = <&emmc_clk_gate_pins>;
202	pinctrl-names = "default", "clk-gate";
203
204	bus-width = <8>;
205	cap-mmc-highspeed;
206	max-frequency = <200000000>;
207	non-removable;
208	disable-wp;
209	mmc-ddr-1_8v;
210	mmc-hs200-1_8v;
211
212	mmc-pwrseq = <&emmc_pwrseq>;
213	vmmc-supply = <&vcc_3v3>;
214	vqmmc-supply = <&vddio_boot>;
215};
216
217/* This UART is brought out to the DB9 connector */
218&uart_AO {
219	status = "okay";
220	pinctrl-0 = <&uart_ao_a_pins>;
221	pinctrl-names = "default";
222};
223
224&usb0 {
225	status = "okay";
226};
227