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	pinctrl-0 = <&eth_rgmii_y_pins>;
155	pinctrl-names = "default";
156	phy-handle = <&eth_phy0>;
157	phy-mode = "rgmii";
158
159	mdio {
160		compatible = "snps,dwmac-mdio";
161		#address-cells = <1>;
162		#size-cells = <0>;
163
164		eth_phy0: ethernet-phy@0 {
165			/* Realtek RTL8211F (0x001cc916) */
166			reg = <0>;
167			eee-broken-1000t;
168		};
169	};
170};
171
172&uart_A {
173	status = "okay";
174	pinctrl-0 = <&uart_a_pins>;
175	pinctrl-names = "default";
176};
177
178&uart_AO {
179	status = "okay";
180	pinctrl-0 = <&uart_ao_a_pins>;
181	pinctrl-names = "default";
182};
183
184&ir {
185	status = "okay";
186	pinctrl-0 = <&remote_input_ao_pins>;
187	pinctrl-names = "default";
188};
189
190&i2c1 {
191	status = "okay";
192	pinctrl-0 = <&i2c1_z_pins>;
193	pinctrl-names = "default";
194
195	speaker_amp1: audio-codec@1b {
196		compatible = "ti,tas5707";
197		reg = <0x1b>;
198		reset-gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
199		#sound-dai-cells = <0>;
200		AVDD-supply = <&vcc_3v3>;
201		DVDD-supply = <&vcc_3v3>;
202		PVDD_A-supply = <&main_12v>;
203		PVDD_B-supply = <&main_12v>;
204		PVDD_C-supply = <&main_12v>;
205		PVDD_D-supply = <&main_12v>;
206	};
207};
208
209&i2c_AO {
210	status = "okay";
211	pinctrl-0 = <&i2c_ao_sck_10_pins>, <&i2c_ao_sda_11_pins>;
212	pinctrl-names = "default";
213
214	gpio_speaker: gpio-controller@1f {
215		compatible = "nxp,pca9557";
216		reg = <0x1f>;
217		gpio-controller;
218		#gpio-cells = <2>;
219		vcc-supply = <&vddao_3v3>;
220	};
221};
222
223&pwm_ab {
224	status = "okay";
225	pinctrl-0 = <&pwm_a_x20_pins>;
226	pinctrl-names = "default";
227};
228
229/* emmc storage */
230&sd_emmc_c {
231	status = "okay";
232	pinctrl-0 = <&emmc_pins>;
233	pinctrl-1 = <&emmc_clk_gate_pins>;
234	pinctrl-names = "default", "clk-gate";
235
236	bus-width = <8>;
237	cap-sd-highspeed;
238	cap-mmc-highspeed;
239	max-frequency = <180000000>;
240	non-removable;
241	disable-wp;
242	mmc-ddr-1_8v;
243	mmc-hs200-1_8v;
244
245	vmmc-supply = <&vcc_3v3>;
246	vqmmc-supply = <&vddio_boot>;
247};
248
249/* wifi module */
250&sd_emmc_b {
251	status = "okay";
252	#address-cells = <1>;
253	#size-cells = <0>;
254
255	pinctrl-0 = <&sdio_pins>;
256	pinctrl-1 = <&sdio_clk_gate_pins>;
257	pinctrl-names = "default", "clk-gate";
258
259	bus-width = <4>;
260	cap-sd-highspeed;
261	max-frequency = <100000000>;
262	non-removable;
263	disable-wp;
264
265	mmc-pwrseq = <&sdio_pwrseq>;
266
267	vmmc-supply = <&vddao_3v3>;
268	vqmmc-supply = <&vddio_boot>;
269
270	brcmf: wifi@1 {
271		reg = <1>;
272		compatible = "brcm,bcm4329-fmac";
273	};
274};
275
276&saradc {
277	status = "okay";
278	vref-supply = <&vddio_ao18>;
279};
280