1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Andreas Färber
4 */
5
6#include "meson-gxbb.dtsi"
7#include <dt-bindings/sound/meson-aiu.h>
8
9/ {
10	compatible = "tronsmart,vega-s95", "amlogic,meson-gxbb";
11
12	aliases {
13		serial0 = &uart_AO;
14		ethernet0 = &ethmac;
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	spdif_dit: audio-codec-0 {
22		#sound-dai-cells = <0>;
23		compatible = "linux,spdif-dit";
24		status = "okay";
25		sound-name-prefix = "DIT";
26	};
27
28	leds {
29		compatible = "gpio-leds";
30
31		led-blue {
32			label = "vega-s95:blue:on";
33			gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
34			default-state = "on";
35			panic-indicator;
36		};
37	};
38
39	usb_pwr: regulator-usb-pwrs {
40		compatible = "regulator-fixed";
41
42		regulator-name = "USB_PWR";
43
44		regulator-min-microvolt = <5000000>;
45		regulator-max-microvolt = <5000000>;
46
47		gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
48		enable-active-high;
49	};
50
51	vddio_boot: regulator-vddio_boot {
52		compatible = "regulator-fixed";
53		regulator-name = "VDDIO_BOOT";
54		regulator-min-microvolt = <1800000>;
55		regulator-max-microvolt = <1800000>;
56	};
57
58	vddao_3v3: regulator-vddao_3v3 {
59		compatible = "regulator-fixed";
60		regulator-name = "VDDAO_3V3";
61		regulator-min-microvolt = <3300000>;
62		regulator-max-microvolt = <3300000>;
63	};
64
65	vddio_ao18: regulator-vddio_ao18 {
66		compatible = "regulator-fixed";
67		regulator-name = "VDDIO_AO18";
68		regulator-min-microvolt = <1800000>;
69		regulator-max-microvolt = <1800000>;
70	};
71
72	vcc_3v3: regulator-vcc_3v3 {
73		compatible = "regulator-fixed";
74		regulator-name = "VCC_3V3";
75		regulator-min-microvolt = <3300000>;
76		regulator-max-microvolt = <3300000>;
77	};
78
79	emmc_pwrseq: emmc-pwrseq {
80		compatible = "mmc-pwrseq-emmc";
81		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
82	};
83
84	wifi32k: wifi32k {
85		compatible = "pwm-clock";
86		#clock-cells = <0>;
87		clock-frequency = <32768>;
88		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
89	};
90
91	hdmi-connector {
92		compatible = "hdmi-connector";
93		type = "a";
94
95		port {
96			hdmi_connector_in: endpoint {
97				remote-endpoint = <&hdmi_tx_tmds_out>;
98			};
99		};
100	};
101
102	sdio_pwrseq: sdio-pwrseq {
103		compatible = "mmc-pwrseq-simple";
104		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
105		clocks = <&wifi32k>;
106		clock-names = "ext_clock";
107	};
108
109	sound {
110		compatible = "amlogic,gx-sound-card";
111		model = "VEGA-S95";
112		assigned-clocks = <&clkc CLKID_MPLL0>,
113				  <&clkc CLKID_MPLL1>,
114				  <&clkc CLKID_MPLL2>;
115		assigned-clock-parents = <0>, <0>, <0>;
116		assigned-clock-rates = <294912000>,
117				       <270950400>,
118				       <393216000>;
119		status = "okay";
120
121		dai-link-0 {
122			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
123		};
124
125		dai-link-1 {
126			sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
127		};
128
129		dai-link-2 {
130			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
131			dai-format = "i2s";
132			mclk-fs = <256>;
133
134			codec-0 {
135				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
136			};
137		};
138
139		dai-link-3 {
140			sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
141
142			codec-0 {
143				sound-dai = <&spdif_dit>;
144			};
145		};
146
147		dai-link-4 {
148			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
149
150			codec-0 {
151				sound-dai = <&hdmi_tx>;
152			};
153		};
154	};
155};
156
157&aiu {
158	status = "okay";
159	pinctrl-0 = <&spdif_out_y_pins>;
160	pinctrl-names = "default";
161};
162
163&cec_AO {
164	status = "okay";
165	pinctrl-0 = <&ao_cec_pins>;
166	pinctrl-names = "default";
167	hdmi-phandle = <&hdmi_tx>;
168};
169
170&ethmac {
171	status = "okay";
172	pinctrl-0 = <&eth_rgmii_pins>;
173	pinctrl-names = "default";
174
175	phy-handle = <&eth_phy0>;
176	phy-mode = "rgmii";
177
178	amlogic,tx-delay-ns = <2>;
179
180	mdio {
181		compatible = "snps,dwmac-mdio";
182		#address-cells = <1>;
183		#size-cells = <0>;
184
185		eth_phy0: ethernet-phy@0 {
186			/* Realtek RTL8211F (0x001cc916) */
187			reg = <0>;
188
189			reset-assert-us = <10000>;
190			reset-deassert-us = <80000>;
191			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
192
193			interrupt-parent = <&gpio_intc>;
194			/* MAC_INTR on GPIOZ_15 */
195			interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
196		};
197	};
198};
199
200&hdmi_tx {
201	status = "okay";
202	pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>;
203	pinctrl-names = "default";
204};
205
206&hdmi_tx_tmds_port {
207	hdmi_tx_tmds_out: endpoint {
208		remote-endpoint = <&hdmi_connector_in>;
209	};
210};
211
212&ir {
213	status = "okay";
214	pinctrl-0 = <&remote_input_ao_pins>;
215	pinctrl-names = "default";
216	linux,rc-map-name = "rc-vega-s9x";
217};
218
219&pwm_ef {
220	status = "okay";
221	pinctrl-0 = <&pwm_e_pins>;
222	pinctrl-names = "default";
223	clocks = <&clkc CLKID_FCLK_DIV4>;
224	clock-names = "clkin0";
225};
226
227&saradc {
228	status = "okay";
229	vref-supply = <&vddio_ao18>;
230};
231
232/* Wireless SDIO Module */
233&sd_emmc_a {
234	status = "okay";
235	pinctrl-0 = <&sdio_pins>;
236	pinctrl-1 = <&sdio_clk_gate_pins>;
237	pinctrl-names = "default", "clk-gate";
238	#address-cells = <1>;
239	#size-cells = <0>;
240
241	bus-width = <4>;
242	cap-sd-highspeed;
243	max-frequency = <50000000>;
244
245	non-removable;
246	disable-wp;
247
248	/* WiFi firmware requires power to be kept while in suspend */
249	keep-power-in-suspend;
250
251	mmc-pwrseq = <&sdio_pwrseq>;
252
253	vmmc-supply = <&vddao_3v3>;
254	vqmmc-supply = <&vddio_boot>;
255
256	brcmf: wifi@1 {
257		reg = <1>;
258		compatible = "brcm,bcm4329-fmac";
259	};
260};
261
262/* SD card */
263&sd_emmc_b {
264	status = "okay";
265	pinctrl-0 = <&sdcard_pins>;
266	pinctrl-1 = <&sdcard_clk_gate_pins>;
267	pinctrl-names = "default", "clk-gate";
268
269	bus-width = <4>;
270	cap-sd-highspeed;
271	max-frequency = <50000000>;
272	disable-wp;
273
274	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
275
276	vmmc-supply = <&vddao_3v3>;
277	vqmmc-supply = <&vcc_3v3>;
278};
279
280/* eMMC */
281&sd_emmc_c {
282	status = "okay";
283	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
284	pinctrl-1 = <&emmc_clk_gate_pins>;
285	pinctrl-names = "default", "clk-gate";
286
287	bus-width = <8>;
288	cap-mmc-highspeed;
289	max-frequency = <200000000>;
290	non-removable;
291	disable-wp;
292	mmc-ddr-1_8v;
293	mmc-hs200-1_8v;
294
295	mmc-pwrseq = <&emmc_pwrseq>;
296	vmmc-supply = <&vcc_3v3>;
297	vqmmc-supply = <&vddio_boot>;
298};
299
300/* This is connected to the Bluetooth module: */
301&uart_A {
302	status = "okay";
303	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
304	pinctrl-names = "default";
305
306	bluetooth {
307		compatible = "brcm,bcm43438-bt";
308		shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
309		max-speed = <2000000>;
310		clocks = <&wifi32k>;
311		clock-names = "lpo";
312	};
313};
314
315/* This UART is brought out to the DB9 connector */
316&uart_AO {
317	status = "okay";
318	pinctrl-0 = <&uart_ao_a_pins>;
319	pinctrl-names = "default";
320};
321
322&usb0_phy {
323	status = "okay";
324	phy-supply = <&usb_pwr>;
325};
326
327&usb1_phy {
328	status = "okay";
329};
330
331&usb0 {
332	status = "okay";
333};
334
335&usb1 {
336	status = "okay";
337};
338