1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 Akash Gajjar <akash@openedev.com>
4 * Copyright (c) 2019 Jagan Teki <jagan@openedev.com>
5 */
6
7/dts-v1/;
8#include "rk3308.dtsi"
9
10/ {
11	model = "Radxa ROCK Pi S";
12	compatible = "radxa,rockpis", "rockchip,rk3308";
13
14	aliases {
15		ethernet0 = &gmac;
16		mmc0 = &emmc;
17		mmc1 = &sdmmc;
18	};
19
20	chosen {
21		stdout-path = "serial0:1500000n8";
22	};
23
24	leds {
25		compatible = "gpio-leds";
26		pinctrl-names = "default";
27		pinctrl-0 = <&green_led_gio>, <&heartbeat_led_gpio>;
28
29		green-led {
30			default-state = "on";
31			gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
32			label = "rockpis:green:power";
33			linux,default-trigger = "default-on";
34		};
35
36		blue-led {
37			default-state = "on";
38			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
39			label = "rockpis:blue:user";
40			linux,default-trigger = "heartbeat";
41		};
42	};
43
44	sdio_pwrseq: sdio-pwrseq {
45		compatible = "mmc-pwrseq-simple";
46		pinctrl-0 = <&wifi_enable_h>;
47		pinctrl-names = "default";
48		reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
49	};
50
51	vcc_1v8: vcc-1v8 {
52		compatible = "regulator-fixed";
53		regulator-name = "vcc_1v8";
54		regulator-always-on;
55		regulator-boot-on;
56		regulator-min-microvolt = <1800000>;
57		regulator-max-microvolt = <1800000>;
58		vin-supply = <&vcc_io>;
59	};
60
61	vcc_io: vcc-io {
62		compatible = "regulator-fixed";
63		regulator-name = "vcc_io";
64		regulator-always-on;
65		regulator-boot-on;
66		regulator-min-microvolt = <3300000>;
67		regulator-max-microvolt = <3300000>;
68		vin-supply = <&vcc5v0_sys>;
69	};
70
71	vcc_ddr: vcc-ddr {
72		compatible = "regulator-fixed";
73		regulator-name = "vcc_ddr";
74		regulator-always-on;
75		regulator-boot-on;
76		regulator-min-microvolt = <1500000>;
77		regulator-max-microvolt = <1500000>;
78		vin-supply = <&vcc5v0_sys>;
79	};
80
81	vcc5v0_otg: vcc5v0-otg {
82		compatible = "regulator-fixed";
83		enable-active-high;
84		gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
85		pinctrl-names = "default";
86		pinctrl-0 = <&otg_vbus_drv>;
87		regulator-name = "vcc5v0_otg";
88		regulator-always-on;
89		vin-supply = <&vcc5v0_sys>;
90	};
91
92	vcc5v0_sys: vcc5v0-sys {
93		compatible = "regulator-fixed";
94		regulator-name = "vcc5v0_sys";
95		regulator-always-on;
96		regulator-boot-on;
97		regulator-min-microvolt = <5000000>;
98		regulator-max-microvolt = <5000000>;
99	};
100
101	vdd_core: vdd-core {
102		compatible = "pwm-regulator";
103		pwms = <&pwm0 0 5000 1>;
104		pwm-supply = <&vcc5v0_sys>;
105		regulator-name = "vdd_core";
106		regulator-min-microvolt = <827000>;
107		regulator-max-microvolt = <1340000>;
108		regulator-settling-time-up-us = <250>;
109		regulator-always-on;
110		regulator-boot-on;
111	};
112
113	vdd_log: vdd-log {
114		compatible = "regulator-fixed";
115		regulator-name = "vdd_log";
116		regulator-always-on;
117		regulator-boot-on;
118		regulator-min-microvolt = <1050000>;
119		regulator-max-microvolt = <1050000>;
120		vin-supply = <&vcc5v0_sys>;
121	};
122};
123
124&cpu0 {
125	cpu-supply = <&vdd_core>;
126};
127
128&emmc {
129	bus-width = <4>;
130	cap-mmc-highspeed;
131	mmc-hs200-1_8v;
132	non-removable;
133	vmmc-supply = <&vcc_io>;
134	status = "okay";
135};
136
137&gmac {
138	clock_in_out = "output";
139	phy-supply = <&vcc_io>;
140	snps,reset-gpio = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
141	snps,reset-active-low;
142	snps,reset-delays-us = <0 50000 50000>;
143	status = "okay";
144};
145
146&i2c1 {
147	status = "okay";
148};
149
150&pinctrl {
151	pinctrl-names = "default";
152	pinctrl-0 = <&rtc_32k>;
153
154	leds {
155		green_led_gio: green-led-gpio {
156			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
157		};
158
159		heartbeat_led_gpio: heartbeat-led-gpio {
160			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
161		};
162	};
163
164	usb {
165		otg_vbus_drv: otg-vbus-drv {
166			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
167		};
168	};
169
170	sdio-pwrseq {
171		wifi_enable_h: wifi-enable-h {
172			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
173		};
174
175		wifi_host_wake: wifi-host-wake {
176			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>;
177		};
178	};
179};
180
181&pwm0 {
182	status = "okay";
183	pinctrl-0 = <&pwm0_pin_pull_down>;
184};
185
186&saradc {
187	vref-supply = <&vcc_1v8>;
188	status = "okay";
189};
190
191&sdio {
192	#address-cells = <1>;
193	#size-cells = <0>;
194	cap-sd-highspeed;
195	cap-sdio-irq;
196	keep-power-in-suspend;
197	max-frequency = <1000000>;
198	mmc-pwrseq = <&sdio_pwrseq>;
199	non-removable;
200	sd-uhs-sdr104;
201	status = "okay";
202};
203
204&sdmmc {
205	cap-sd-highspeed;
206	status = "okay";
207};
208
209&u2phy {
210	status = "okay";
211
212	u2phy_host: host-port {
213		phy-supply = <&vcc5v0_otg>;
214		status = "okay";
215	};
216
217	u2phy_otg: otg-port {
218		phy-supply = <&vcc5v0_otg>;
219		status = "okay";
220	};
221};
222
223&uart0 {
224	status = "okay";
225};
226
227&uart4 {
228	status = "okay";
229
230	bluetooth {
231		compatible = "realtek,rtl8723bs-bt";
232		device-wake-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
233		host-wake-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
234	};
235};
236
237&usb_host_ehci {
238	status = "okay";
239};
240
241&usb_host_ohci {
242	status = "okay";
243};
244
245&usb20_otg {
246	dr_mode = "peripheral";
247	status = "okay";
248};
249
250&wdt {
251	status = "okay";
252};
253