1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
4 */
5
6/dts-v1/;
7
8#include "meson-axg.dtsi"
9#include <dt-bindings/input/input.h>
10
11/ {
12	compatible = "amlogic,s400", "amlogic,a113d", "amlogic,meson-axg";
13	model = "Amlogic Meson AXG S400 Development Board";
14
15	adc_keys {
16		compatible = "adc-keys";
17		io-channels = <&saradc 0>;
18		io-channel-names = "buttons";
19		keyup-threshold-microvolt = <1800000>;
20
21		button-next {
22			label = "Next";
23			linux,code = <KEY_NEXT>;
24			press-threshold-microvolt = <1116000>; /* 62% */
25		};
26
27		button-prev {
28			label = "Previous";
29			linux,code = <KEY_PREVIOUS>;
30			press-threshold-microvolt = <900000>; /* 50% */
31		};
32
33		button-wifi {
34			label = "Wifi";
35			linux,code = <KEY_WLAN>;
36			press-threshold-microvolt = <684000>; /* 38% */
37		};
38
39		button-up {
40			label = "Volume Up";
41			linux,code = <KEY_VOLUMEUP>;
42			press-threshold-microvolt = <468000>; /* 26% */
43		};
44
45		button-down {
46			label = "Volume Down";
47			linux,code = <KEY_VOLUMEDOWN>;
48			press-threshold-microvolt = <252000>; /* 14% */
49		};
50
51		button-voice {
52			label = "Voice";
53			linux,code = <KEY_VOICECOMMAND>;
54			press-threshold-microvolt = <0>; /* 0% */
55		};
56	};
57
58	aliases {
59		serial0 = &uart_AO;
60		serial1 = &uart_A;
61	};
62
63	main_12v: regulator-main_12v {
64		compatible = "regulator-fixed";
65		regulator-name = "12V";
66		regulator-min-microvolt = <12000000>;
67		regulator-max-microvolt = <12000000>;
68	};
69
70	vddio_boot: regulator-vddio_boot {
71		compatible = "regulator-fixed";
72		regulator-name = "VDDIO_BOOT";
73		regulator-min-microvolt = <1800000>;
74		regulator-max-microvolt = <1800000>;
75	};
76
77	vddao_3v3: regulator-vddao_3v3 {
78		compatible = "regulator-fixed";
79		regulator-name = "VDDAO_3V3";
80		regulator-min-microvolt = <3300000>;
81		regulator-max-microvolt = <3300000>;
82	};
83
84	vddio_ao18: regulator-vddio_ao18 {
85		compatible = "regulator-fixed";
86		regulator-name = "VDDIO_AO18";
87		regulator-min-microvolt = <1800000>;
88		regulator-max-microvolt = <1800000>;
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	};
97
98	emmc_pwrseq: emmc-pwrseq {
99		compatible = "mmc-pwrseq-emmc";
100		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
101	};
102
103	sdio_pwrseq: sdio-pwrseq {
104		compatible = "mmc-pwrseq-simple";
105		reset-gpios = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>;
106		clocks = <&wifi32k>;
107		clock-names = "ext_clock";
108	};
109
110	wifi32k: wifi32k {
111		compatible = "pwm-clock";
112		#clock-cells = <0>;
113		clock-frequency = <32768>;
114		pwms = <&pwm_ab 0 30518 0>; /* PWM_A at 32.768KHz */
115	};
116
117	speaker-leds {
118		compatible = "gpio-leds";
119
120		aled1 {
121			label = "speaker:aled1";
122			gpios = <&gpio_speaker 7 0>;
123		};
124
125		aled2 {
126			label = "speaker:aled2";
127			gpios = <&gpio_speaker 6 0>;
128		};
129
130		aled3 {
131			label = "speaker:aled3";
132			gpios = <&gpio_speaker 5 0>;
133		};
134
135		aled4 {
136			label = "speaker:aled4";
137			gpios = <&gpio_speaker 4 0>;
138		};
139
140		aled5 {
141			label = "speaker:aled5";
142			gpios = <&gpio_speaker 3 0>;
143		};
144
145		aled6 {
146			label = "speaker:aled6";
147			gpios = <&gpio_speaker 2 0>;
148		};
149	};
150};
151
152&ethmac {
153	status = "okay";
154	phy-mode = "rgmii";
155	pinctrl-0 = <&eth_rgmii_y_pins>;
156	pinctrl-names = "default";
157};
158
159&uart_A {
160	status = "okay";
161	pinctrl-0 = <&uart_a_pins>;
162	pinctrl-names = "default";
163};
164
165&uart_AO {
166	status = "okay";
167	pinctrl-0 = <&uart_ao_a_pins>;
168	pinctrl-names = "default";
169};
170
171&ir {
172	status = "okay";
173	pinctrl-0 = <&remote_input_ao_pins>;
174	pinctrl-names = "default";
175};
176
177&i2c1 {
178	status = "okay";
179	pinctrl-0 = <&i2c1_z_pins>;
180	pinctrl-names = "default";
181
182	speaker_amp1: audio-codec@1b {
183		compatible = "ti,tas5707";
184		reg = <0x1b>;
185		reset-gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
186		#sound-dai-cells = <0>;
187		AVDD-supply = <&vcc_3v3>;
188		DVDD-supply = <&vcc_3v3>;
189		PVDD_A-supply = <&main_12v>;
190		PVDD_B-supply = <&main_12v>;
191		PVDD_C-supply = <&main_12v>;
192		PVDD_D-supply = <&main_12v>;
193	};
194};
195
196&i2c_AO {
197	status = "okay";
198	pinctrl-0 = <&i2c_ao_sck_10_pins>, <&i2c_ao_sda_11_pins>;
199	pinctrl-names = "default";
200
201	gpio_speaker: gpio-controller@1f {
202		compatible = "nxp,pca9557";
203		reg = <0x1f>;
204		gpio-controller;
205		#gpio-cells = <2>;
206		vcc-supply = <&vddao_3v3>;
207	};
208};
209
210&pwm_ab {
211	status = "okay";
212	pinctrl-0 = <&pwm_a_x20_pins>;
213	pinctrl-names = "default";
214};
215
216/* emmc storage */
217&sd_emmc_c {
218	status = "okay";
219	pinctrl-0 = <&emmc_pins>;
220	pinctrl-1 = <&emmc_clk_gate_pins>;
221	pinctrl-names = "default", "clk-gate";
222
223	bus-width = <8>;
224	cap-sd-highspeed;
225	cap-mmc-highspeed;
226	max-frequency = <180000000>;
227	non-removable;
228	disable-wp;
229	mmc-ddr-1_8v;
230	mmc-hs200-1_8v;
231
232	vmmc-supply = <&vcc_3v3>;
233	vqmmc-supply = <&vddio_boot>;
234};
235
236/* wifi module */
237&sd_emmc_b {
238	status = "okay";
239	#address-cells = <1>;
240	#size-cells = <0>;
241
242	pinctrl-0 = <&sdio_pins>;
243	pinctrl-1 = <&sdio_clk_gate_pins>;
244	pinctrl-names = "default", "clk-gate";
245
246	bus-width = <4>;
247	cap-sd-highspeed;
248	max-frequency = <100000000>;
249	non-removable;
250	disable-wp;
251
252	mmc-pwrseq = <&sdio_pwrseq>;
253
254	vmmc-supply = <&vddao_3v3>;
255	vqmmc-supply = <&vddio_boot>;
256
257	brcmf: wifi@1 {
258		reg = <1>;
259		compatible = "brcm,bcm4329-fmac";
260	};
261};
262
263&saradc {
264	status = "okay";
265	vref-supply = <&vddio_ao18>;
266};
267