1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Theobroma Systems Design und Consulting GmbH
4 */
5
6/dts-v1/;
7#include "rk3368.dtsi"
8
9/ {
10	chosen {
11		stdout-path = "serial0:115200n8";
12	};
13
14	ext_gmac: gmac-clk {
15		compatible = "fixed-clock";
16		clock-frequency = <125000000>;
17		clock-output-names = "ext_gmac";
18		#clock-cells = <0>;
19	};
20
21	i2cmux1 {
22		compatible = "i2c-mux-gpio";
23		#address-cells = <1>;
24		#size-cells = <0>;
25		i2c-parent = <&i2c1>;
26		mux-gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_HIGH>;
27
28		/* Q7_GPO_I2C */
29		i2c@0 {
30			reg = <0>;
31			#address-cells = <1>;
32			#size-cells = <0>;
33		};
34
35		/* Q7_SMB */
36		i2c@1 {
37			reg = <1>;
38			#address-cells = <1>;
39			#size-cells = <0>;
40		};
41	};
42
43	i2cmux2 {
44		compatible = "i2c-mux-gpio";
45		#address-cells = <1>;
46		#size-cells = <0>;
47		i2c-parent = <&i2c2>;
48		mux-gpios = <&gpio1 RK_PB4 GPIO_ACTIVE_HIGH>;
49
50		/* Q7_LVDS_BLC_I2C */
51		i2c@0 {
52			reg = <0>;
53			#address-cells = <1>;
54			#size-cells = <0>;
55
56			fan: fan@18 {
57				compatible = "ti,amc6821";
58				reg = <0x18>;
59				#cooling-cells = <2>;
60			};
61
62			rtc_twi: rtc@6f {
63				compatible = "isil,isl1208";
64				reg = <0x6f>;
65			};
66		};
67
68		/* Q7_GP2_I2C */
69		i2c@1 {
70			reg = <1>;
71			#address-cells = <1>;
72			#size-cells = <0>;
73		};
74	};
75
76	leds {
77		compatible = "gpio-leds";
78		pinctrl-names = "default";
79		pinctrl-0 = <&module_led_pins>;
80
81		module_led1: led-1 {
82			label = "module_led1";
83			gpios = <&gpio2 RK_PB5 GPIO_ACTIVE_HIGH>;
84			linux,default-trigger = "heartbeat";
85			panic-indicator;
86		};
87
88		module_led2: led-2 {
89			label = "module_led2";
90			gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
91			default-state = "off";
92		};
93	};
94
95	vcc_sys: vcc-sys-regulator {
96		compatible = "regulator-fixed";
97		regulator-name = "vcc_sys";
98		regulator-min-microvolt = <5000000>;
99		regulator-max-microvolt = <5000000>;
100		regulator-always-on;
101		regulator-boot-on;
102	};
103};
104
105&cpu_l0 {
106	cpu-supply = <&vdd_cpu>;
107};
108
109&cpu_l1 {
110	cpu-supply = <&vdd_cpu>;
111};
112
113&cpu_l2 {
114	cpu-supply = <&vdd_cpu>;
115};
116
117&cpu_l3 {
118	cpu-supply = <&vdd_cpu>;
119};
120
121&cpu_b0 {
122	cpu-supply = <&vdd_cpu>;
123};
124
125&cpu_b1 {
126	cpu-supply = <&vdd_cpu>;
127};
128
129&cpu_b2 {
130	cpu-supply = <&vdd_cpu>;
131};
132
133&cpu_b3 {
134	cpu-supply = <&vdd_cpu>;
135};
136
137&emmc {
138	bus-width = <8>;
139	clock-frequency = <150000000>;
140	mmc-hs200-1_8v;
141	non-removable;
142	vmmc-supply = <&vcc33_io>;
143	vqmmc-supply = <&vcc18_io>;
144	pinctrl-names = "default";
145	pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
146	status = "okay";
147};
148
149&gmac {
150	assigned-clocks = <&cru SCLK_MAC>;
151	assigned-clock-parents = <&ext_gmac>;
152	clock_in_out = "input";
153	phy-supply = <&vcc33_io>;
154	phy-mode = "rgmii";
155	pinctrl-names = "default";
156	pinctrl-0 = <&rgmii_pins>;
157	snps,reset-active-low;
158	snps,reset-delays-us = <0 10000 50000>;
159	snps,reset-gpio = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
160	tx_delay = <0x10>;
161	rx_delay = <0x10>;
162	status = "okay";
163};
164
165&i2c0 {
166	status = "okay";
167
168	rk808: pmic@1b {
169		compatible = "rockchip,rk808";
170		reg = <0x1b>;
171		interrupt-parent = <&gpio0>;
172		interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
173		clock-output-names = "xin32k", "rk808-clkout2";
174		#clock-cells = <1>;
175		pinctrl-names = "default";
176		pinctrl-0 = <&pmic_int_l>, <&pmic_sleep>;
177		rockchip,system-power-controller;
178		vcc1-supply = <&vcc_sys>;
179		vcc2-supply = <&vcc_sys>;
180		vcc3-supply = <&vcc_sys>;
181		vcc4-supply = <&vcc_sys>;
182		vcc6-supply = <&vcc_sys>;
183		vcc7-supply = <&vcc_sys>;
184		vcc8-supply = <&vcc_sys>;
185		vcc9-supply = <&vcc_sys>;
186		vcc10-supply = <&vcc_sys>;
187		vcc11-supply = <&vcc_sys>;
188		vcc12-supply = <&vcc_sys>;
189
190		regulators {
191			vdd_cpu: DCDC_REG1 {
192				regulator-name = "vdd_cpu";
193				regulator-min-microvolt = <700000>;
194				regulator-max-microvolt = <1500000>;
195				regulator-always-on;
196				regulator-boot-on;
197			};
198
199			vdd_log: DCDC_REG2 {
200				regulator-name = "vdd_log";
201				regulator-min-microvolt = <700000>;
202				regulator-max-microvolt = <1500000>;
203				regulator-always-on;
204				regulator-boot-on;
205			};
206
207			vcc_ddr: DCDC_REG3 {
208				regulator-name = "vcc_ddr";
209				regulator-always-on;
210				regulator-boot-on;
211			};
212
213			vcc33_io: DCDC_REG4 {
214				regulator-name = "vcc33_io";
215				regulator-min-microvolt = <3300000>;
216				regulator-max-microvolt = <3300000>;
217				regulator-always-on;
218				regulator-boot-on;
219			};
220
221			vcc33_video: LDO_REG2 {
222				regulator-name = "vcc33_video";
223				regulator-min-microvolt = <3300000>;
224				regulator-max-microvolt = <3300000>;
225				regulator-always-on;
226				regulator-boot-on;
227			};
228
229			vdd10_pll: LDO_REG3 {
230				regulator-name = "vdd10_pll";
231				regulator-min-microvolt = <1000000>;
232				regulator-max-microvolt = <1000000>;
233				regulator-always-on;
234				regulator-boot-on;
235			};
236
237			vcc18_io: LDO_REG4 {
238				regulator-name = "vcc18_io";
239				regulator-min-microvolt = <1800000>;
240				regulator-max-microvolt = <1800000>;
241				regulator-boot-on;
242			};
243
244			vdd10_video: LDO_REG6 {
245				regulator-name = "vdd10_video";
246				regulator-min-microvolt = <1000000>;
247				regulator-max-microvolt = <1000000>;
248				regulator-always-on;
249				regulator-boot-on;
250			};
251
252			vcc18_video: LDO_REG8 {
253				regulator-name = "vcc18_video";
254				regulator-min-microvolt = <1800000>;
255				regulator-max-microvolt = <1800000>;
256				regulator-always-on;
257				regulator-boot-on;
258			};
259		};
260	};
261};
262
263&i2c1 {
264	status = "okay";
265};
266
267&i2c2 {
268	status = "okay";
269};
270
271&pinctrl {
272	leds {
273		module_led_pins: module-led-pins {
274			rockchip,pins =
275				<2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
276				<3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
277		};
278	};
279	pmic {
280		pmic_int_l: pmic-int-l {
281			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
282		};
283
284		pmic_sleep: pmic-sleep {
285			rockchip,pins = <0 RK_PA0 2 &pcfg_pull_none>;
286		};
287	};
288};
289
290&spi1 {
291	status = "okay";
292
293	norflash: flash@0 {
294		compatible = "jedec,spi-nor";
295		reg = <0>;
296		spi-max-frequency = <50000000>;
297	};
298};
299
300&uart1 {
301	status = "okay";
302};
303
304&uart3 {
305	status = "okay";
306};
307
308&usb_host0_ehci {
309	status = "okay";
310};
311
312&wdt {
313	status = "okay";
314};
315