xref: /freebsd/sys/contrib/device-tree/src/arm64/amlogic/meson-gxm-rbox-pro.dts (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016-2017 Andreas Färber
4 *
5 * Based on nexbox-a1:
6 *
7 * Copyright (c) 2016 BayLibre, SAS.
8 * Author: Neil Armstrong <narmstrong@baylibre.com>
9 *
10 * Copyright (c) 2016 Endless Computers, Inc.
11 * Author: Carlo Caione <carlo@endlessm.com>
12 */
13
14/dts-v1/;
15
16#include "meson-gxm.dtsi"
17#include <dt-bindings/sound/meson-aiu.h>
18
19/ {
20	compatible = "kingnovel,r-box-pro", "amlogic,s912", "amlogic,meson-gxm";
21	model = "R-Box Pro";
22
23	aliases {
24		serial0 = &uart_AO;
25		ethernet0 = &ethmac;
26	};
27
28	chosen {
29		stdout-path = "serial0:115200n8";
30	};
31
32	memory@0 {
33		device_type = "memory";
34		reg = <0x0 0x0 0x0 0x80000000>; /* 2 GiB or 3 GiB */
35	};
36
37	spdif_dit: audio-codec-0 {
38		#sound-dai-cells = <0>;
39		compatible = "linux,spdif-dit";
40		sound-name-prefix = "DIT";
41	};
42
43	leds {
44		compatible = "gpio-leds";
45
46		led-blue {
47			label = "rbox-pro:blue:on";
48			gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>;
49			default-state = "on";
50		};
51
52		led-red {
53			label = "rbox-pro:red:standby";
54			gpios = <&gpio GPIODV_28 GPIO_ACTIVE_HIGH>;
55			default-state = "off";
56			retain-state-suspended;
57			panic-indicator;
58		};
59	};
60
61	vddio_boot: regulator-vddio-boot {
62		compatible = "regulator-fixed";
63		regulator-name = "VDDIO_BOOT";
64		regulator-min-microvolt = <1800000>;
65		regulator-max-microvolt = <1800000>;
66	};
67
68	vddao_3v3: regulator-vddao-3v3 {
69		compatible = "regulator-fixed";
70		regulator-name = "VDDAO_3V3";
71		regulator-min-microvolt = <3300000>;
72		regulator-max-microvolt = <3300000>;
73	};
74
75	vcc_3v3: regulator-vcc-3v3 {
76		compatible = "regulator-fixed";
77		regulator-name = "VCC_3V3";
78		regulator-min-microvolt = <3300000>;
79		regulator-max-microvolt = <3300000>;
80	};
81
82	emmc_pwrseq: emmc-pwrseq {
83		compatible = "mmc-pwrseq-emmc";
84		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
85	};
86
87	wifi32k: wifi32k {
88		compatible = "pwm-clock";
89		#clock-cells = <0>;
90		clock-frequency = <32768>;
91		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
92	};
93
94	sdio_pwrseq: sdio-pwrseq {
95		compatible = "mmc-pwrseq-simple";
96		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
97		clocks = <&wifi32k>;
98		clock-names = "ext_clock";
99	};
100
101	sound {
102		compatible = "amlogic,gx-sound-card";
103		model = "RBOX-PRO";
104		assigned-clocks = <&clkc CLKID_MPLL0>,
105				  <&clkc CLKID_MPLL1>,
106				  <&clkc CLKID_MPLL2>;
107		assigned-clock-parents = <0>, <0>, <0>;
108		assigned-clock-rates = <294912000>,
109				       <270950400>,
110				       <393216000>;
111
112		dai-link-0 {
113			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
114		};
115
116		dai-link-1 {
117			sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
118		};
119
120		dai-link-2 {
121			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
122			dai-format = "i2s";
123			mclk-fs = <256>;
124
125			codec-0 {
126				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
127			};
128		};
129
130		dai-link-3 {
131			sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
132
133			codec-0 {
134				sound-dai = <&spdif_dit>;
135			};
136		};
137
138		dai-link-4 {
139			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
140
141			codec-0 {
142				sound-dai = <&hdmi_tx>;
143			};
144		};
145	};
146};
147
148&aiu {
149	status = "okay";
150	pinctrl-0 = <&spdif_out_h_pins>;
151	pinctrl-names = "default";
152};
153
154&ethmac {
155	status = "okay";
156
157	pinctrl-0 = <&eth_pins>;
158	pinctrl-names = "default";
159
160	/* Select external PHY by default */
161	phy-handle = <&external_phy>;
162
163	amlogic,tx-delay-ns = <2>;
164
165	/* External PHY is in RGMII */
166	phy-mode = "rgmii";
167};
168
169&external_mdio {
170	external_phy: ethernet-phy@0 {
171		/* Realtek RTL8211F (0x001cc916) */
172		reg = <0>;
173		max-speed = <1000>;
174
175		reset-assert-us = <10000>;
176		reset-deassert-us = <80000>;
177		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
178	};
179};
180
181&ir {
182	status = "okay";
183	pinctrl-0 = <&remote_input_ao_pins>;
184	pinctrl-names = "default";
185};
186
187&pwm_ef {
188	status = "okay";
189	pinctrl-0 = <&pwm_e_pins>;
190	pinctrl-names = "default";
191	clocks = <&clkc CLKID_FCLK_DIV4>;
192	clock-names = "clkin0";
193};
194
195/* Wireless SDIO Module */
196&sd_emmc_a {
197	status = "okay";
198	pinctrl-0 = <&sdio_pins>;
199	pinctrl-names = "default";
200	#address-cells = <1>;
201	#size-cells = <0>;
202
203	bus-width = <4>;
204	cap-sd-highspeed;
205	max-frequency = <50000000>;
206
207	non-removable;
208	disable-wp;
209
210	/* WiFi firmware requires power to be kept while in suspend */
211	keep-power-in-suspend;
212
213	mmc-pwrseq = <&sdio_pwrseq>;
214
215	vmmc-supply = <&vddao_3v3>;
216	vqmmc-supply = <&vddio_boot>;
217
218	brcmf: brcmf@1 {
219		reg = <1>;
220		compatible = "brcm,bcm4329-fmac";
221	};
222};
223
224/* SD card */
225&sd_emmc_b {
226	status = "okay";
227	pinctrl-0 = <&sdcard_pins>;
228	pinctrl-names = "default";
229
230	bus-width = <4>;
231	cap-sd-highspeed;
232	max-frequency = <50000000>;
233	disable-wp;
234
235	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
236
237	vmmc-supply = <&vddao_3v3>;
238	vqmmc-supply = <&vddio_boot>;
239};
240
241/* eMMC */
242&sd_emmc_c {
243	status = "okay";
244	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
245	pinctrl-names = "default";
246
247	bus-width = <8>;
248	cap-mmc-highspeed;
249	max-frequency = <200000000>;
250	non-removable;
251	disable-wp;
252	mmc-ddr-1_8v;
253	mmc-hs200-1_8v;
254
255	mmc-pwrseq = <&emmc_pwrseq>;
256	vmmc-supply = <&vcc_3v3>;
257	vqmmc-supply = <&vddio_boot>;
258};
259
260&uart_AO {
261	status = "okay";
262	pinctrl-0 = <&uart_ao_a_pins>;
263	pinctrl-names = "default";
264};
265