1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2022 Theobroma Systems Design und Consulting GmbH
4 */
5
6/dts-v1/;
7#include "px30-ringneck.dtsi"
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/leds/common.h>
10
11/ {
12	model = "Theobroma Systems PX30-uQ7 SoM on Haikou devkit";
13	compatible = "tsd,px30-ringneck-haikou", "rockchip,px30";
14
15	aliases {
16		mmc2 = &sdmmc;
17	};
18
19	chosen {
20		stdout-path = "serial0:115200n8";
21	};
22
23	gpio-keys {
24		compatible = "gpio-keys";
25		pinctrl-0 = <&haikou_keys_pin>;
26		pinctrl-names = "default";
27
28		button-batlow-n {
29			label = "BATLOW#";
30			linux,code = <KEY_BATTERY>;
31			gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>;
32		};
33
34		button-slp-btn-n {
35			label = "SLP_BTN#";
36			linux,code = <KEY_SLEEP>;
37			gpios = <&gpio1 RK_PB7 GPIO_ACTIVE_LOW>;
38		};
39
40		button-wake-n {
41			label = "WAKE#";
42			linux,code = <KEY_WAKEUP>;
43			gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_LOW>;
44			wakeup-source;
45		};
46
47		switch-lid-btn-n {
48			label = "LID_BTN#";
49			linux,code = <SW_LID>;
50			linux,input-type = <EV_SW>;
51			gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>;
52		};
53	};
54
55	leds {
56		pinctrl-0 = <&module_led_pin>, <&sd_card_led_pin>;
57
58		sd_card_led: led-1 {
59			gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
60			linux,default-trigger = "mmc2";
61			function = LED_FUNCTION_SD;
62			color = <LED_COLOR_ID_BLUE>;
63		};
64	};
65
66	i2s0-sound {
67		compatible = "simple-audio-card";
68		simple-audio-card,format = "i2s";
69		simple-audio-card,name = "Haikou,I2S-codec";
70		simple-audio-card,mclk-fs = <512>;
71
72		simple-audio-card,codec {
73			clocks = <&sgtl5000_clk>;
74			sound-dai = <&sgtl5000>;
75		};
76
77		simple-audio-card,cpu {
78			bitclock-master;
79			frame-master;
80			sound-dai = <&i2s0_8ch>;
81		};
82	};
83
84	sgtl5000_clk: sgtl5000-oscillator {
85		compatible = "fixed-clock";
86		#clock-cells = <0>;
87		clock-frequency  = <24576000>;
88	};
89
90	dc_12v: dc-12v-regulator {
91		compatible = "regulator-fixed";
92		regulator-name = "dc_12v";
93		regulator-always-on;
94		regulator-boot-on;
95		regulator-min-microvolt = <12000000>;
96		regulator-max-microvolt = <12000000>;
97	};
98
99	vcc3v3_baseboard: vcc3v3-baseboard-regulator {
100		compatible = "regulator-fixed";
101		regulator-name = "vcc3v3_baseboard";
102		regulator-always-on;
103		regulator-boot-on;
104		regulator-min-microvolt = <3300000>;
105		regulator-max-microvolt = <3300000>;
106		vin-supply = <&dc_12v>;
107	};
108
109	vcc5v0_baseboard: vcc5v0-baseboard-regulator {
110		compatible = "regulator-fixed";
111		regulator-name = "vcc5v0_baseboard";
112		regulator-always-on;
113		regulator-boot-on;
114		regulator-min-microvolt = <5000000>;
115		regulator-max-microvolt = <5000000>;
116		vin-supply = <&dc_12v>;
117	};
118
119	vdda_codec: vdda-codec-regulator {
120		compatible = "regulator-fixed";
121		regulator-name = "vdda_codec";
122		regulator-boot-on;
123		regulator-min-microvolt = <3300000>;
124		regulator-max-microvolt = <3300000>;
125		vin-supply = <&vcc5v0_baseboard>;
126	};
127
128	vddd_codec: vddd-codec-regulator {
129		compatible = "regulator-fixed";
130		regulator-name = "vddd_codec";
131		regulator-boot-on;
132		regulator-min-microvolt = <1600000>;
133		regulator-max-microvolt = <1600000>;
134		vin-supply = <&vcc5v0_baseboard>;
135	};
136};
137
138&i2c2 {
139	status = "okay";
140	clock-frequency = <400000>;
141
142	sgtl5000: codec@a {
143		compatible = "fsl,sgtl5000";
144		reg = <0x0a>;
145		clocks = <&sgtl5000_clk>;
146		#sound-dai-cells = <0>;
147		VDDA-supply = <&vdda_codec>;
148		VDDIO-supply = <&vcc3v3_baseboard>;
149		VDDD-supply = <&vddd_codec>;
150	};
151};
152
153&i2c3 {
154	eeprom@50 {
155		reg = <0x50>;
156		compatible = "atmel,24c01";
157		pagesize = <8>;
158		size = <128>;
159		vcc-supply = <&vcc3v3_baseboard>;
160	};
161};
162
163&i2s0_8ch {
164	status = "okay";
165};
166
167&gmac {
168	status = "okay";
169};
170
171&pinctrl {
172	haikou {
173		haikou_keys_pin: haikou-keys-pin {
174			rockchip,pins =
175			  /* WAKE# */
176			  <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>,
177			  /* SLP_BTN# */
178			  <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>,
179			  /* LID_BTN */
180			  <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>,
181			  /* BATLOW# */
182			  <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>,
183			  /* BIOS_DISABLE# */
184			  <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
185		};
186	};
187
188	leds {
189		sd_card_led_pin: sd-card-led-pin {
190			rockchip,pins =
191			  <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
192		};
193	};
194};
195
196&pwm0 {
197	status = "okay";
198};
199
200&sdmmc {
201	sd-uhs-sdr12;
202	sd-uhs-sdr25;
203	sd-uhs-sdr50;
204	bus-width = <4>;
205	cap-mmc-highspeed;
206	cap-sd-highspeed;
207	cd-gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_LOW>;
208	disable-wp;
209	vmmc-supply = <&vcc3v3_baseboard>;
210	status = "okay";
211};
212
213&spi1 {
214	status = "okay";
215};
216
217&u2phy_otg {
218	status = "okay";
219};
220
221&uart0 {
222	status = "okay";
223};
224
225&uart5 {
226	pinctrl-0 = <&uart5_xfer>;
227	status = "okay";
228};
229
230&usb20_otg {
231	status = "okay";
232};
233