xref: /linux/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
4 */
5
6/dts-v1/;
7#include "rk3399-puma.dtsi"
8#include <dt-bindings/input/input.h>
9
10/ {
11	model = "Theobroma Systems RK3399-Q7 SoM";
12	compatible = "tsd,rk3399-puma-haikou", "rockchip,rk3399";
13
14	aliases {
15		mmc1 = &sdmmc;
16	};
17
18	chosen {
19		stdout-path = "serial0:115200n8";
20	};
21
22	gpio-keys {
23		compatible = "gpio-keys";
24		pinctrl-0 = <&haikou_keys_pin>;
25		pinctrl-names = "default";
26
27		button-batlow-n {
28			gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
29			label = "BATLOW#";
30			linux,code = <KEY_BATTERY>;
31		};
32
33		button-pwrbtn-n {
34			gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>;
35			label = "PWRBTN#";
36			linux,code = <KEY_POWER>;
37		};
38
39		button-slp-btn-n {
40			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>;
41			label = "SLP_BTN#";
42			linux,code = <KEY_SLEEP>;
43		};
44
45		button-wake-n {
46			gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_LOW>;
47			label = "WAKE#";
48			linux,code = <KEY_WAKEUP>;
49			wakeup-source;
50		};
51
52		switch-lid-btn-n {
53			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
54			label = "LID_BTN#";
55			linux,code = <SW_LID>;
56			linux,input-type = <EV_SW>;
57		};
58	};
59
60	leds {
61		pinctrl-0 = <&module_led_pin>, <&sd_card_led_pin>;
62
63		sd_card_led: led-1 {
64			label = "sd_card_led";
65			gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
66			linux,default-trigger = "mmc0";
67		};
68	};
69
70	i2s0-sound {
71		compatible = "simple-audio-card";
72		simple-audio-card,format = "i2s";
73		simple-audio-card,name = "Haikou,I2S-codec";
74		simple-audio-card,mclk-fs = <512>;
75
76		simple-audio-card,codec {
77			clocks = <&sgtl5000_clk>;
78			sound-dai = <&sgtl5000>;
79		};
80
81		simple-audio-card,cpu {
82			bitclock-master;
83			frame-master;
84			sound-dai = <&i2s0>;
85		};
86	};
87
88	sgtl5000_clk: sgtl5000-oscillator  {
89			compatible = "fixed-clock";
90			#clock-cells = <0>;
91			clock-frequency = <24576000>;
92	};
93
94	dc_12v: regulator-dc-12v {
95		compatible = "regulator-fixed";
96		regulator-name = "dc_12v";
97		regulator-always-on;
98		regulator-boot-on;
99		regulator-min-microvolt = <12000000>;
100		regulator-max-microvolt = <12000000>;
101	};
102
103	vcc3v3_baseboard: regulator-vcc3v3-baseboard {
104		compatible = "regulator-fixed";
105		regulator-name = "vcc3v3_baseboard";
106		regulator-always-on;
107		regulator-boot-on;
108		regulator-min-microvolt = <3300000>;
109		regulator-max-microvolt = <3300000>;
110		vin-supply = <&dc_12v>;
111	};
112
113	vcc5v0_baseboard: regulator-vcc5v0-baseboard {
114		compatible = "regulator-fixed";
115		regulator-name = "vcc5v0_baseboard";
116		regulator-always-on;
117		regulator-boot-on;
118		regulator-min-microvolt = <5000000>;
119		regulator-max-microvolt = <5000000>;
120		vin-supply = <&dc_12v>;
121	};
122
123	vcc5v0_otg: regulator-vcc5v0-otg {
124		compatible = "regulator-fixed";
125		enable-active-high;
126		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
127		pinctrl-names = "default";
128		pinctrl-0 = <&otg_vbus_drv>;
129		regulator-name = "vcc5v0_otg";
130		regulator-always-on;
131	};
132
133	vdda_codec: regulator-vdda-codec {
134		compatible = "regulator-fixed";
135		regulator-name = "vdda_codec";
136		regulator-boot-on;
137		regulator-min-microvolt = <3300000>;
138		regulator-max-microvolt = <3300000>;
139		vin-supply = <&vcc5v0_baseboard>;
140	};
141
142	vddd_codec: regulator-vddd-codec {
143		compatible = "regulator-fixed";
144		regulator-name = "vddd_codec";
145		regulator-boot-on;
146		regulator-min-microvolt = <1600000>;
147		regulator-max-microvolt = <1600000>;
148		vin-supply = <&vcc5v0_baseboard>;
149	};
150};
151
152&hdmi {
153	ddc-i2c-bus = <&i2c3>;
154	status = "okay";
155};
156
157&i2c1 {
158	status = "okay";
159	clock-frequency = <400000>;
160};
161
162&i2c2 {
163	status = "okay";
164	clock-frequency = <400000>;
165};
166
167&i2c3 {
168	i2c-scl-rising-time-ns = <450>;
169	i2c-scl-falling-time-ns = <15>;
170	status = "okay";
171};
172
173&i2c4 {
174	status = "okay";
175	clock-frequency = <400000>;
176
177	sgtl5000: codec@a {
178		compatible = "fsl,sgtl5000";
179		reg = <0x0a>;
180		clocks = <&sgtl5000_clk>;
181		#sound-dai-cells = <0>;
182		VDDA-supply = <&vdda_codec>;
183		VDDIO-supply = <&vdda_codec>;
184		VDDD-supply = <&vddd_codec>;
185		status = "okay";
186	};
187};
188
189&i2c6 {
190	status = "okay";
191	clock-frequency = <400000>;
192};
193
194&pcie_phy {
195	status = "okay";
196};
197
198&pcie0 {
199	ep-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
200	num-lanes = <4>;
201	pinctrl-names = "default";
202	pinctrl-0 = <&pcie_clkreqn_cpm>;
203	vpcie3v3-supply = <&vcc3v3_baseboard>;
204	vpcie12v-supply = <&dc_12v>;
205	status = "okay";
206};
207
208&pinctrl {
209	buttons {
210		haikou_keys_pin: haikou-keys-pin {
211			rockchip,pins =
212			  /* PWRBTN# */
213			  <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>,
214			  /* LID_BTN */
215			  <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>,
216			  /* BATLOW# */
217			  <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>,
218			  /* SLP_BTN# */
219			  <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>,
220			  /* WAKE# */
221			  <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>;
222		};
223	};
224
225	leds {
226		sd_card_led_pin: sd-card-led-pin {
227			rockchip,pins =
228			  <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
229		};
230	};
231
232	usb2 {
233		otg_vbus_drv: otg-vbus-drv {
234			rockchip,pins =
235			  <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
236		};
237	};
238};
239
240&pwm0 {
241	status = "okay";
242};
243
244&sdmmc {
245	bus-width = <4>;
246	cap-mmc-highspeed;
247	cap-sd-highspeed;
248	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
249	disable-wp;
250	max-frequency = <40000000>;
251	pinctrl-names = "default";
252	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
253	vmmc-supply = <&vcc3v3_baseboard>;
254	status = "okay";
255};
256
257&spi5 {
258	status = "okay";
259};
260
261&tcphy0 {
262	status = "okay";
263};
264
265&u2phy0 {
266	status = "okay";
267};
268
269&usbdrd3_0 {
270	status = "okay";
271};
272
273&usbdrd_dwc3_0 {
274	dr_mode = "otg";
275	extcon = <&extcon_usb3>;
276	status = "okay";
277};
278
279&u2phy0_host {
280	phy-supply = <&vcc5v0_otg>;
281	status = "okay";
282};
283
284&uart0 {
285	pinctrl-names = "default";
286	pinctrl-0 = <&uart0_xfer>;
287	status = "okay";
288};
289
290&uart2 {
291	rts-gpios = <&gpio2 RK_PC3 GPIO_ACTIVE_HIGH>;
292	status = "okay";
293};
294
295&usb_host0_ehci {
296	status = "okay";
297};
298
299&usb_host0_ohci {
300	status = "okay";
301};
302
303&vopb {
304	status = "okay";
305};
306
307&vopb_mmu {
308	status = "okay";
309};
310
311&vopl {
312	status = "okay";
313};
314
315&vopl_mmu {
316	status = "okay";
317};
318