xref: /linux/scripts/dtc/include-prefixes/arm64/amlogic/meson-g12b-bananapi-cm4.dtsi (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2023 Neil Armstrong <neil.armstrong@linaro.org>
4 */
5
6#include "meson-g12b-a311d.dtsi"
7#include <dt-bindings/gpio/meson-g12a-gpio.h>
8
9/ {
10	aliases {
11		serial0 = &uart_AO;
12		rtc1 = &vrtc;
13	};
14
15	chosen {
16		stdout-path = "serial0:115200n8";
17	};
18
19	emmc_pwrseq: emmc-pwrseq {
20		compatible = "mmc-pwrseq-emmc";
21		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
22	};
23
24	memory@0 {
25		device_type = "memory";
26		reg = <0x0 0x0 0x0 0x40000000>;
27	};
28
29	sdio_pwrseq: sdio-pwrseq {
30		compatible = "mmc-pwrseq-simple";
31		reset-gpios = <&gpio GPIOAO_6 GPIO_ACTIVE_LOW>;
32		clocks = <&wifi32k>;
33		clock-names = "ext_clock";
34	};
35
36	emmc_1v8: regulator-emmc-1v8 {
37		compatible = "regulator-fixed";
38		regulator-name = "EMMC_1V8";
39		regulator-min-microvolt = <1800000>;
40		regulator-max-microvolt = <1800000>;
41		vin-supply = <&vddao_3v3>;
42		regulator-always-on;
43	};
44
45	dc_in: regulator-dc-in {
46		compatible = "regulator-fixed";
47		regulator-name = "DC_IN";
48		regulator-min-microvolt = <5000000>;
49		regulator-max-microvolt = <5000000>;
50		regulator-always-on;
51	};
52
53	vddio_c: regulator-vddio-c {
54		compatible = "regulator-gpio";
55		regulator-name = "VDDIO_C";
56		regulator-min-microvolt = <1800000>;
57		regulator-max-microvolt = <3300000>;
58
59		enable-gpios = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
60		enable-active-high;
61		regulator-always-on;
62
63		gpios = <&gpio_ao GPIOAO_9 GPIO_OPEN_DRAIN>;
64		gpios-states = <1>;
65
66		states = <1800000 0>,
67			 <3300000 1>;
68	};
69
70	vddao_1v8: regulator-vddao-1v8 {
71		compatible = "regulator-fixed";
72		regulator-name = "VDDAO_1V8";
73		regulator-min-microvolt = <1800000>;
74		regulator-max-microvolt = <1800000>;
75		vin-supply = <&vddao_3v3>;
76		regulator-always-on;
77	};
78
79	vddao_3v3: regulator-vddao-3v3 {
80		compatible = "regulator-fixed";
81		regulator-name = "VDDAO_3V3";
82		regulator-min-microvolt = <3300000>;
83		regulator-max-microvolt = <3300000>;
84		vin-supply = <&dc_in>;
85		regulator-always-on;
86	};
87
88	vddcpu_a: regulator-vddcpu-a {
89		/*
90		 * MP8756GD DC/DC Regulator.
91		 */
92		compatible = "pwm-regulator";
93
94		regulator-name = "VDDCPU_A";
95		regulator-min-microvolt = <680000>;
96		regulator-max-microvolt = <1040000>;
97
98		pwm-supply = <&dc_in>;
99
100		pwms = <&pwm_ab 0 1250 0>;
101		pwm-dutycycle-range = <100 0>;
102
103		regulator-boot-on;
104		regulator-always-on;
105	};
106
107	vddcpu_b: regulator-vddcpu-b {
108		/*
109		 * SY8120B1ABC DC/DC Regulator.
110		 */
111		compatible = "pwm-regulator";
112
113		regulator-name = "VDDCPU_B";
114		regulator-min-microvolt = <680000>;
115		regulator-max-microvolt = <1040000>;
116
117		pwm-supply = <&dc_in>;
118
119		pwms = <&pwm_AO_cd 1 1250 0>;
120		pwm-dutycycle-range = <100 0>;
121
122		regulator-boot-on;
123		regulator-always-on;
124	};
125
126	wifi32k: wifi32k {
127		compatible = "pwm-clock";
128		#clock-cells = <0>;
129		clock-frequency = <32768>;
130		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
131	};
132};
133
134&arb {
135	status = "okay";
136};
137
138&clkc_audio {
139	status = "okay";
140};
141
142&cec_AO {
143	pinctrl-0 = <&cec_ao_a_h_pins>;
144	pinctrl-names = "default";
145	hdmi-phandle = <&hdmi_tx>;
146};
147
148&cecb_AO {
149	pinctrl-0 = <&cec_ao_b_h_pins>;
150	pinctrl-names = "default";
151	hdmi-phandle = <&hdmi_tx>;
152};
153
154&cpu0 {
155	cpu-supply = <&vddcpu_b>;
156	operating-points-v2 = <&cpu_opp_table_0>;
157	clocks = <&clkc CLKID_CPU_CLK>;
158};
159
160&cpu1 {
161	cpu-supply = <&vddcpu_b>;
162	operating-points-v2 = <&cpu_opp_table_0>;
163	clocks = <&clkc CLKID_CPU_CLK>;
164};
165
166&cpu100 {
167	cpu-supply = <&vddcpu_a>;
168	operating-points-v2 = <&cpub_opp_table_1>;
169	clocks = <&clkc CLKID_CPUB_CLK>;
170};
171
172&cpu101 {
173	cpu-supply = <&vddcpu_a>;
174	operating-points-v2 = <&cpub_opp_table_1>;
175	clocks = <&clkc CLKID_CPUB_CLK>;
176};
177
178&cpu102 {
179	cpu-supply = <&vddcpu_a>;
180	operating-points-v2 = <&cpub_opp_table_1>;
181	clocks = <&clkc CLKID_CPUB_CLK>;
182};
183
184&cpu103 {
185	cpu-supply = <&vddcpu_a>;
186	operating-points-v2 = <&cpub_opp_table_1>;
187	clocks = <&clkc CLKID_CPUB_CLK>;
188};
189
190&ext_mdio {
191	external_phy: ethernet-phy@0 {
192		/* Realtek RTL8211F (0x001cc916) */
193		reg = <0>;
194		max-speed = <1000>;
195
196		interrupt-parent = <&gpio_intc>;
197		/* MAC_INTR on GPIOZ_14 */
198		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
199	};
200};
201
202/* Ethernet to be enabled in baseboard DT */
203&ethmac {
204	pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
205	pinctrl-names = "default";
206	phy-mode = "rgmii-txid";
207	phy-handle = <&external_phy>;
208};
209
210&frddr_a {
211	status = "okay";
212};
213
214&frddr_b {
215	status = "okay";
216};
217
218&frddr_c {
219	status = "okay";
220};
221
222/* HDMI to be enabled in baseboard DT */
223&hdmi_tx {
224	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
225	pinctrl-names = "default";
226	hdmi-supply = <&dc_in>;
227};
228
229/* "Camera" I2C bus */
230&i2c1 {
231	pinctrl-0 = <&i2c1_sda_h6_pins>, <&i2c1_sck_h7_pins>;
232	pinctrl-names = "default";
233};
234
235/* Main I2C bus */
236&i2c2 {
237	pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>;
238	pinctrl-names = "default";
239};
240
241/* "ID" I2C bus */
242&i2c3 {
243	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
244	pinctrl-names = "default";
245};
246
247&pcie {
248	reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
249};
250
251&pwm_ab {
252	pinctrl-0 = <&pwm_a_e_pins>;
253	pinctrl-names = "default";
254
255	status = "okay";
256};
257
258&pwm_ef {
259	pinctrl-0 = <&pwm_e_pins>;
260	pinctrl-names = "default";
261
262	status = "okay";
263};
264
265&pwm_AO_cd {
266	pinctrl-0 = <&pwm_ao_d_e_pins>;
267	pinctrl-names = "default";
268
269	status = "okay";
270};
271
272&saradc {
273	vref-supply = <&vddao_1v8>;
274
275	status = "okay";
276};
277
278/* on-module SDIO WiFi */
279&sd_emmc_a {
280	pinctrl-0 = <&sdio_pins>;
281	pinctrl-1 = <&sdio_clk_gate_pins>;
282	pinctrl-names = "default", "clk-gate";
283	#address-cells = <1>;
284	#size-cells = <0>;
285
286	bus-width = <4>;
287	sd-uhs-sdr104;
288	max-frequency = <50000000>;
289
290	non-removable;
291	disable-wp;
292
293	/* WiFi firmware requires power in suspend */
294	keep-power-in-suspend;
295
296	mmc-pwrseq = <&sdio_pwrseq>;
297
298	vmmc-supply = <&vddao_3v3>;
299	vqmmc-supply = <&vddao_3v3>;
300
301	status = "okay";
302
303	rtl8822cs: wifi@1 {
304		reg = <1>;
305	};
306};
307
308/* SD card to be enabled in baseboard DT */
309&sd_emmc_b {
310	pinctrl-0 = <&sdcard_c_pins>;
311	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
312	pinctrl-names = "default", "clk-gate";
313
314	bus-width = <4>;
315	cap-sd-highspeed;
316	max-frequency = <50000000>;
317	disable-wp;
318
319	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
320	vmmc-supply = <&vddao_3v3>;
321	vqmmc-supply = <&vddio_c>;
322};
323
324/* on-module eMMC */
325&sd_emmc_c {
326	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
327	pinctrl-1 = <&emmc_clk_gate_pins>;
328	pinctrl-names = "default", "clk-gate";
329
330	bus-width = <8>;
331	cap-mmc-highspeed;
332	mmc-ddr-1_8v;
333	mmc-hs200-1_8v;
334	max-frequency = <200000000>;
335	disable-wp;
336
337	mmc-pwrseq = <&emmc_pwrseq>;
338	vmmc-supply = <&vddao_3v3>;
339	vqmmc-supply = <&vddao_1v8>;
340
341	status = "okay";
342};
343
344&tdmif_b {
345	status = "okay";
346};
347
348&tdmout_b {
349	status = "okay";
350};
351
352/* on-module UART BT */
353&uart_A {
354	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
355	pinctrl-names = "default";
356	uart-has-rtscts;
357
358	status = "okay";
359
360	bluetooth {
361		compatible = "realtek,rtl8822cs-bt";
362		enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
363		host-wake-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
364		device-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
365	};
366};
367
368&uart_AO {
369	pinctrl-0 = <&uart_ao_a_pins>;
370	pinctrl-names = "default";
371
372	status = "okay";
373};
374
375&usb {
376	phys = <&usb2_phy0>, <&usb2_phy1>;
377	phy-names = "usb2-phy0", "usb2-phy1";
378};
379