1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 BayLibre, SAS.
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 * Author: Jerome Brunet <jbrunet@baylibre.com>
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/input/input.h>
11
12#include "meson-gxl-s905x.dtsi"
13
14/ {
15	compatible = "libretech,aml-s805x-ac", "amlogic,s805x",
16		     "amlogic,meson-gxl";
17	model = "Libre Computer AML-S805X-AC";
18
19	aliases {
20		serial0 = &uart_AO;
21		ethernet0 = &ethmac;
22		spi0 = &spifc;
23	};
24
25	chosen {
26		stdout-path = "serial0:115200n8";
27	};
28
29	cvbs-connector {
30		/*
31		 * The pads are present but no connector is soldered on
32		 * 2J2, so keep this off by default.
33		 */
34		status = "disabled";
35		compatible = "composite-video-connector";
36
37		port {
38			cvbs_connector_in: endpoint {
39				remote-endpoint = <&cvbs_vdac_out>;
40			};
41		};
42	};
43
44	dc_5v: regulator-dc_5v {
45		compatible = "regulator-fixed";
46		regulator-name = "DC_5V";
47		regulator-min-microvolt = <5000000>;
48		regulator-max-microvolt = <5000000>;
49		regulator-always-on;
50	};
51
52	emmc_pwrseq: emmc-pwrseq {
53		compatible = "mmc-pwrseq-emmc";
54		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
55	};
56
57	hdmi-connector {
58		compatible = "hdmi-connector";
59		type = "a";
60
61		port {
62			hdmi_connector_in: endpoint {
63				remote-endpoint = <&hdmi_tx_tmds_out>;
64			};
65		};
66	};
67
68	memory@0 {
69		device_type = "memory";
70		reg = <0x0 0x0 0x0 0x20000000>;
71	};
72
73	vcck: regulator-vcck {
74		compatible = "regulator-fixed";
75		regulator-name = "VCCK";
76		regulator-min-microvolt = <3300000>;
77		regulator-max-microvolt = <3300000>;
78		vin-supply = <&dc_5v>;
79
80		/*
81		 * This is controlled by GPIOAO_9 we reserve this but
82		 * claiming it as done below reset the board anyway
83		 * Need to investigate this
84		 *
85		 * gpio = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
86		 * enable-active-high;
87		 */
88		regulator-always-on;
89	};
90
91	vcc_3v3: regulator-vcc_3v3 {
92		compatible = "regulator-fixed";
93		regulator-name = "VCC_3V3";
94		regulator-min-microvolt = <3300000>;
95		regulator-max-microvolt = <3300000>;
96		vin-supply = <&dc_5v>;
97		regulator-always-on;
98	};
99
100	vddio_boot: regulator-vddio_boot {
101		compatible = "regulator-fixed";
102		regulator-name = "VDDIO_BOOT";
103		regulator-min-microvolt = <1800000>;
104		regulator-max-microvolt = <1800000>;
105		vin-supply = <&vcc_3v3>;
106		regulator-always-on;
107	};
108};
109
110&cec_AO {
111	status = "okay";
112	pinctrl-0 = <&ao_cec_pins>;
113	pinctrl-names = "default";
114	hdmi-phandle = <&hdmi_tx>;
115};
116
117&cvbs_vdac_port {
118	cvbs_vdac_out: endpoint {
119		remote-endpoint = <&cvbs_connector_in>;
120	};
121};
122
123&ethmac {
124	status = "okay";
125};
126
127&internal_phy {
128	pinctrl-0 = <&eth_link_led_pins>, <&eth_act_led_pins>;
129	pinctrl-names = "default";
130};
131
132&ir {
133	status = "okay";
134	pinctrl-0 = <&remote_input_ao_pins>;
135	pinctrl-names = "default";
136};
137
138&hdmi_tx {
139	status = "okay";
140	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
141	pinctrl-names = "default";
142};
143
144&hdmi_tx_tmds_port {
145	hdmi_tx_tmds_out: endpoint {
146		remote-endpoint = <&hdmi_connector_in>;
147	};
148};
149
150&gpio_ao {
151	gpio-line-names = "UART TX",
152			  "UART RX",
153			  "7J1 Header Pin31",
154			  "", "", "", "",
155			  "IR In",
156			  "HDMI CEC",
157			  "5V VCCK Regulator",
158			  /* GPIO_TEST_N */
159			  "";
160};
161
162&gpio {
163	gpio-line-names = /* Bank GPIOZ */
164			  "", "", "", "", "", "", "",
165			  "", "", "", "", "", "", "",
166			  "Eth Link LED", "Eth Activity LED",
167			  /* Bank GPIOH */
168			  "HDMI HPD", "HDMI SDA", "HDMI SCL",
169			  "", "7J1 Header Pin13",
170			  "7J1 Header Pin15",
171			  "7J1 Header Pin7",
172			  "7J1 Header Pin12",
173			  "7J1 Header Pin16",
174			  "7J1 Header Pin18",
175			  /* Bank BOOT */
176			  "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3",
177			  "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7",
178			  "eMMC Clk", "eMMC Reset", "eMMC CMD",
179			  "SPI NOR MOSI", "SPI NOR MISO", "SPI NOR Clk",
180			  "", "SPI NOR Chip Select",
181			  /* Bank CARD */
182			  "", "", "", "", "", "", "",
183			  /* Bank GPIODV */
184			  "", "", "", "", "", "", "", "", "", "", "", "",
185			  "", "", "", "", "", "", "", "", "", "", "", "",
186			  "7J1 Header Pin27", "7J1 Header Pin28", "",
187			  "7J1 Header Pin29",
188			  "VCCK Regulator", "VDDEE Regulator",
189			  /* Bank GPIOX */
190			  "7J1 Header Pin22", "7J1 Header Pin26",
191			  "7J1 Header Pin36", "7J1 Header Pin38",
192			  "7J1 Header Pin40", "7J1 Header Pin37",
193			  "7J1 Header Pin33", "7J1 Header Pin35",
194			  "7J1 Header Pin19", "7J1 Header Pin21",
195			  "7J1 Header Pin24", "7J1 Header Pin23",
196			  "7J1 Header Pin8", "7J1 Header Pin10",
197			  "", "", "7J1 Header Pin32", "", "",
198			  /* Bank GPIOCLK */
199			  "", "";
200};
201
202&saradc {
203	status = "okay";
204	vref-supply = <&vddio_boot>;
205};
206
207/* eMMC */
208&sd_emmc_c {
209	status = "okay";
210	pinctrl-0 = <&emmc_pins>;
211	pinctrl-1 = <&emmc_clk_gate_pins>;
212	pinctrl-names = "default", "clk-gate";
213
214	bus-width = <8>;
215	cap-mmc-highspeed;
216	mmc-ddr-1_8v;
217	mmc-hs200-1_8v;
218	max-frequency = <200000000>;
219	disable-wp;
220
221	mmc-pwrseq = <&emmc_pwrseq>;
222	vmmc-supply = <&vcc_3v3>;
223	vqmmc-supply = <&vddio_boot>;
224};
225
226&spifc {
227	status = "okay";
228	pinctrl-0 = <&nor_pins>;
229	pinctrl-names = "default";
230
231	w25q32: spi-flash@0 {
232		#address-cells = <1>;
233		#size-cells = <1>;
234		compatible = "jedec,spi-nor";
235		reg = <0>;
236		spi-max-frequency = <3000000>;
237	};
238};
239
240&uart_AO {
241	status = "okay";
242	pinctrl-0 = <&uart_ao_a_pins>;
243	pinctrl-names = "default";
244};
245
246&usb {
247	status = "okay";
248	dr_mode = "host";
249};
250