1/*
2 * This file is dual-licensed: you can use it either under the terms
3 * of the GPL or the X11 license, at your option. Note that this dual
4 * licensing only applies to this file, and not this project as a
5 * whole.
6 *
7 *  a) This file is free software; you can redistribute it and/or
8 *     modify it under the terms of the GNU General Public License as
9 *     published by the Free Software Foundation; either version 2 of the
10 *     License, or (at your option) any later version.
11 *
12 *     This file is distributed in the hope that it will be useful,
13 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *     GNU General Public License for more details.
16 *
17 * Or, alternatively,
18 *
19 *  b) Permission is hereby granted, free of charge, to any person
20 *     obtaining a copy of this software and associated documentation
21 *     files (the "Software"), to deal in the Software without
22 *     restriction, including without limitation the rights to use,
23 *     copy, modify, merge, publish, distribute, sublicense, and/or
24 *     sell copies of the Software, and to permit persons to whom the
25 *     Software is furnished to do so, subject to the following
26 *     conditions:
27 *
28 *     The above copyright notice and this permission notice shall be
29 *     included in all copies or substantial portions of the Software.
30 *
31 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38 *     OTHER DEALINGS IN THE SOFTWARE.
39 */
40
41/dts-v1/;
42#include "rk3288-rock2-som.dtsi"
43
44/ {
45	model = "Radxa Rock 2 Square";
46	compatible = "radxa,rock2-square", "rockchip,rk3288";
47
48	chosen {
49		stdout-path = "serial2:115200n8";
50	};
51
52	sound {
53		compatible = "simple-audio-card";
54		simple-audio-card,name = "SPDIF";
55		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
56			cpu { sound-dai = <&spdif>; };
57			codec { sound-dai = <&spdif_out>; };
58		};
59	};
60
61	spdif_out: spdif-out {
62		compatible = "linux,spdif-dit";
63		#sound-dai-cells = <0>;
64	};
65
66	vcc_usb_host: vcc-host-regulator {
67		compatible = "regulator-fixed";
68		enable-active-high;
69		gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
70		pinctrl-names = "default";
71		pinctrl-0 = <&host_vbus_drv>;
72		/* Always on as the rockchip usb phy doesn't have a vbus-supply
73		 * property
74		 */
75		regulator-always-on;
76		regulator-name = "vcc_host";
77	};
78
79	vcc_sd: sdmmc-regulator {
80		compatible = "regulator-fixed";
81		gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
82		pinctrl-names = "default";
83		pinctrl-0 = <&sdmmc_pwr>;
84		regulator-name = "vcc_sd";
85		regulator-min-microvolt = <3300000>;
86		regulator-max-microvolt = <3300000>;
87		vin-supply = <&vcc_io>;
88	};
89};
90
91&sdmmc {
92	bus-width = <4>;
93	cap-mmc-highspeed;
94	cap-sd-highspeed;
95	card-detect-delay = <200>;
96	disable-wp;	/* wp not hooked up */
97	num-slots = <1>;
98	pinctrl-names = "default";
99	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
100	vmmc-supply = <&vcc_sd>;
101	vqmmc-supply = <&vccio_sd>;
102	status = "okay";
103};
104
105&gmac {
106	status = "ok";
107};
108
109&hdmi {
110	ddc-i2c-bus = <&i2c5>;
111	status = "okay";
112};
113
114&i2c0 {
115	hym8563@51 {
116		compatible = "haoyu,hym8563";
117		reg = <0x51>;
118		#clock-cells = <0>;
119		clock-frequency = <32768>;
120		clock-output-names = "xin32k";
121		interrupt-parent = <&gpio0>;
122		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
123		pinctrl-names = "default";
124		pinctrl-0 = <&pmic_int>;
125
126	};
127};
128
129&i2c5 {
130	status = "okay";
131};
132
133&pinctrl {
134	pmic {
135		pmic_int: pmic-int {
136			rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
137		};
138	};
139
140	usb {
141		host_vbus_drv: host-vbus-drv {
142			rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
143		};
144	};
145
146	sdmmc {
147		sdmmc_pwr: sdmmc-pwr {
148			rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
149		};
150	};
151};
152
153&spdif {
154	status = "okay";
155};
156
157&uart2 {
158	status = "okay";
159};
160
161&usbphy {
162	status = "okay";
163};
164
165&usb_host0_ehci {
166	status = "okay";
167};
168