xref: /linux/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
6 */
7
8/dts-v1/;
9
10#include "meson-g12b.dtsi"
11#include "meson-g12b-s922x.dtsi"
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/gpio/meson-g12a-gpio.h>
14
15/ {
16	aliases {
17		serial0 = &uart_AO;
18		ethernet0 = &ethmac;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24
25	memory@0 {
26		device_type = "memory";
27		reg = <0x0 0x0 0x0 0x40000000>;
28	};
29
30	emmc_pwrseq: emmc-pwrseq {
31		compatible = "mmc-pwrseq-emmc";
32		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
33	};
34
35	sdio_pwrseq: sdio-pwrseq {
36		compatible = "mmc-pwrseq-simple";
37		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
38		clocks = <&wifi32k>;
39		clock-names = "ext_clock";
40	};
41
42	flash_1v8: regulator-flash-1v8 {
43		compatible = "regulator-fixed";
44		regulator-name = "FLASH_1V8";
45		regulator-min-microvolt = <1800000>;
46		regulator-max-microvolt = <1800000>;
47		vin-supply = <&vcc_3v3>;
48		regulator-always-on;
49	};
50
51	main_12v: regulator-main-12v {
52		compatible = "regulator-fixed";
53		regulator-name = "12V";
54		regulator-min-microvolt = <12000000>;
55		regulator-max-microvolt = <12000000>;
56		regulator-always-on;
57	};
58
59	vcc_5v: regulator-vcc-5v {
60		compatible = "regulator-fixed";
61		regulator-name = "VCC_5V";
62		regulator-min-microvolt = <5000000>;
63		regulator-max-microvolt = <5000000>;
64		vin-supply = <&main_12v>;
65
66		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
67		enable-active-high;
68	};
69
70	vcc_1v8: regulator-vcc-1v8 {
71		compatible = "regulator-fixed";
72		regulator-name = "VCC_1V8";
73		regulator-min-microvolt = <1800000>;
74		regulator-max-microvolt = <1800000>;
75		vin-supply = <&vcc_3v3>;
76		regulator-always-on;
77	};
78
79	vcc_3v3: regulator-vcc-3v3 {
80		compatible = "regulator-fixed";
81		regulator-name = "VCC_3V3";
82		regulator-min-microvolt = <3300000>;
83		regulator-max-microvolt = <3300000>;
84		vin-supply = <&vddao_3v3>;
85		regulator-always-on;
86		/* FIXME: actually controlled by VDDCPU_B_EN */
87	};
88
89	vddcpu_a: regulator-vddcpu-a {
90		/*
91		 * MP1653 Regulator.
92		 */
93		compatible = "pwm-regulator";
94
95		regulator-name = "VDDCPU_A";
96		regulator-min-microvolt = <721000>;
97		regulator-max-microvolt = <1022000>;
98
99		pwm-supply = <&main_12v>;
100
101		pwms = <&pwm_ab 0 1250 0>;
102		pwm-dutycycle-range = <100 0>;
103
104		regulator-boot-on;
105		regulator-always-on;
106	};
107
108	vddcpu_b: regulator-vddcpu-b {
109		/*
110		 * MP1652 Regulator.
111		 */
112		compatible = "pwm-regulator";
113
114		regulator-name = "VDDCPU_B";
115		regulator-min-microvolt = <721000>;
116		regulator-max-microvolt = <1022000>;
117
118		pwm-supply = <&main_12v>;
119
120		pwms = <&pwm_AO_cd 1 1250 0>;
121		pwm-dutycycle-range = <100 0>;
122
123		regulator-boot-on;
124		regulator-always-on;
125	};
126
127	usb1_pow: regulator-usb1-pow {
128		compatible = "regulator-fixed";
129		regulator-name = "USB1_POW";
130		regulator-min-microvolt = <5000000>;
131		regulator-max-microvolt = <5000000>;
132		vin-supply = <&vcc_5v>;
133
134		/* connected to SY6280A Power Switch */
135		gpio = <&gpio GPIOA_8 GPIO_ACTIVE_HIGH>;
136		enable-active-high;
137	};
138
139	usb_pwr_en: regulator-usb-pwr-en {
140		compatible = "regulator-fixed";
141		regulator-name = "USB_PWR_EN";
142		regulator-min-microvolt = <5000000>;
143		regulator-max-microvolt = <5000000>;
144		vin-supply = <&vcc_5v>;
145
146		/* Connected to USB3 Type-A Port power enable */
147		gpio = <&gpio GPIOAO_7 GPIO_ACTIVE_HIGH>;
148		enable-active-high;
149	};
150
151	vddao_1v8: regulator-vddao-1v8 {
152		compatible = "regulator-fixed";
153		regulator-name = "VDDAO_1V8";
154		regulator-min-microvolt = <1800000>;
155		regulator-max-microvolt = <1800000>;
156		vin-supply = <&vddao_3v3>;
157		regulator-always-on;
158	};
159
160	vddao_3v3: regulator-vddao-3v3 {
161		compatible = "regulator-fixed";
162		regulator-name = "VDDAO_3V3";
163		regulator-min-microvolt = <3300000>;
164		regulator-max-microvolt = <3300000>;
165		vin-supply = <&main_12v>;
166		regulator-always-on;
167	};
168
169	cvbs-connector {
170		compatible = "composite-video-connector";
171
172		port {
173			cvbs_connector_in: endpoint {
174				remote-endpoint = <&cvbs_vdac_out>;
175			};
176		};
177	};
178
179	hdmi-connector {
180		compatible = "hdmi-connector";
181		type = "a";
182
183		port {
184			hdmi_connector_in: endpoint {
185				remote-endpoint = <&hdmi_tx_tmds_out>;
186			};
187		};
188	};
189
190	wifi32k: wifi32k {
191		compatible = "pwm-clock";
192		#clock-cells = <0>;
193		clock-frequency = <32768>;
194		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
195	};
196};
197
198&cec_AO {
199	pinctrl-0 = <&cec_ao_a_h_pins>;
200	pinctrl-names = "default";
201	status = "disabled";
202	hdmi-phandle = <&hdmi_tx>;
203};
204
205&cecb_AO {
206	pinctrl-0 = <&cec_ao_b_h_pins>;
207	pinctrl-names = "default";
208	status = "okay";
209	hdmi-phandle = <&hdmi_tx>;
210};
211
212&cpu0 {
213	cpu-supply = <&vddcpu_b>;
214	operating-points-v2 = <&cpu_opp_table_0>;
215	clocks = <&clkc CLKID_CPU_CLK>;
216};
217
218&cpu1 {
219	cpu-supply = <&vddcpu_b>;
220	operating-points-v2 = <&cpu_opp_table_0>;
221	clocks = <&clkc CLKID_CPU_CLK>;
222};
223
224&cpu100 {
225	cpu-supply = <&vddcpu_a>;
226	operating-points-v2 = <&cpub_opp_table_1>;
227	clocks = <&clkc CLKID_CPUB_CLK>;
228};
229
230&cpu101 {
231	cpu-supply = <&vddcpu_a>;
232	operating-points-v2 = <&cpub_opp_table_1>;
233	clocks = <&clkc CLKID_CPUB_CLK>;
234};
235
236&cpu102 {
237	cpu-supply = <&vddcpu_a>;
238	operating-points-v2 = <&cpub_opp_table_1>;
239	clocks = <&clkc CLKID_CPUB_CLK>;
240};
241
242&cpu103 {
243	cpu-supply = <&vddcpu_a>;
244	operating-points-v2 = <&cpub_opp_table_1>;
245	clocks = <&clkc CLKID_CPUB_CLK>;
246};
247
248&cvbs_vdac_port {
249	cvbs_vdac_out: endpoint {
250		remote-endpoint = <&cvbs_connector_in>;
251	};
252};
253
254&ext_mdio {
255	external_phy: ethernet-phy@0 {
256		/* Realtek RTL8211F (0x001cc916) */
257		reg = <0>;
258		max-speed = <1000>;
259
260		reset-assert-us = <10000>;
261		reset-deassert-us = <80000>;
262		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
263
264		interrupt-parent = <&gpio_intc>;
265		/* MAC_INTR on GPIOZ_14 */
266		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
267	};
268};
269
270&ethmac {
271	pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
272	pinctrl-names = "default";
273	status = "okay";
274	phy-mode = "rgmii";
275	phy-handle = <&external_phy>;
276	amlogic,tx-delay-ns = <2>;
277};
278
279&hdmi_tx {
280	status = "okay";
281	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
282	pinctrl-names = "default";
283	hdmi-supply = <&vcc_5v>;
284};
285
286&hdmi_tx_tmds_port {
287	hdmi_tx_tmds_out: endpoint {
288		remote-endpoint = <&hdmi_connector_in>;
289	};
290};
291
292&ir {
293	status = "okay";
294	pinctrl-0 = <&remote_input_ao_pins>;
295	pinctrl-names = "default";
296};
297
298&pwm_ab {
299	pinctrl-0 = <&pwm_a_e_pins>;
300	pinctrl-names = "default";
301	status = "okay";
302};
303
304&pwm_AO_cd {
305	pinctrl-0 = <&pwm_ao_d_e_pins>;
306	pinctrl-names = "default";
307	status = "okay";
308};
309
310&pwm_ef {
311	pinctrl-0 = <&pwm_e_pins>;
312	pinctrl-names = "default";
313	status = "okay";
314};
315
316/* SDIO */
317&sd_emmc_a {
318	status = "okay";
319	pinctrl-0 = <&sdio_pins>;
320	pinctrl-1 = <&sdio_clk_gate_pins>;
321	pinctrl-names = "default", "clk-gate";
322	#address-cells = <1>;
323	#size-cells = <0>;
324
325	bus-width = <4>;
326	cap-sd-highspeed;
327	max-frequency = <100000000>;
328
329	/* WiFi firmware requires power to be kept while in suspend */
330	keep-power-in-suspend;
331
332	non-removable;
333	disable-wp;
334
335	mmc-pwrseq = <&sdio_pwrseq>;
336
337	vmmc-supply = <&vddao_3v3>;
338	vqmmc-supply = <&vddao_1v8>;
339
340	brcmf: wifi@1 {
341		reg = <1>;
342		compatible = "brcm,bcm4329-fmac";
343	};
344};
345
346/* SD card */
347&sd_emmc_b {
348	status = "okay";
349	pinctrl-0 = <&sdcard_c_pins>;
350	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
351	pinctrl-names = "default", "clk-gate";
352
353	bus-width = <4>;
354	cap-sd-highspeed;
355	max-frequency = <50000000>;
356	disable-wp;
357
358	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
359	vmmc-supply = <&vddao_3v3>;
360	vqmmc-supply = <&vddao_3v3>;
361};
362
363/* eMMC */
364&sd_emmc_c {
365	status = "okay";
366	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
367	pinctrl-1 = <&emmc_clk_gate_pins>;
368	pinctrl-names = "default", "clk-gate";
369
370	bus-width = <8>;
371	cap-mmc-highspeed;
372	max-frequency = <100000000>;
373	disable-wp;
374
375	mmc-pwrseq = <&emmc_pwrseq>;
376	vmmc-supply = <&vcc_3v3>;
377	vqmmc-supply = <&flash_1v8>;
378};
379
380&uart_A {
381	status = "okay";
382	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
383	pinctrl-names = "default";
384	uart-has-rtscts;
385
386	bluetooth {
387		compatible = "brcm,bcm43438-bt";
388		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
389		max-speed = <2000000>;
390		clocks = <&wifi32k>;
391		clock-names = "lpo";
392	};
393};
394
395&uart_AO {
396	status = "okay";
397	pinctrl-0 = <&uart_ao_a_pins>;
398	pinctrl-names = "default";
399};
400
401&usb {
402	status = "okay";
403	dr_mode = "host";
404	vbus-supply = <&usb_pwr_en>;
405};
406
407&usb2_phy0 {
408	phy-supply = <&usb1_pow>;
409};
410
411&usb2_phy1 {
412	phy-supply = <&usb1_pow>;
413};
414