Loading...
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2016 Andreas Färber
4 */
5
6/dts-v1/;
7#include "rk3368.dtsi"
8#include <dt-bindings/input/input.h>
9
10/ {
11 model = "GeekBox";
12 compatible = "geekbuying,geekbox", "rockchip,rk3368";
13
14 aliases {
15 ethernet0 = &gmac;
16 mmc0 = &emmc;
17 };
18
19 chosen {
20 stdout-path = "serial2:115200n8";
21 };
22
23 memory@0 {
24 device_type = "memory";
25 reg = <0x0 0x0 0x0 0x80000000>;
26 };
27
28 ext_gmac: gmac-clk {
29 compatible = "fixed-clock";
30 clock-frequency = <125000000>;
31 clock-output-names = "ext_gmac";
32 #clock-cells = <0>;
33 };
34
35 ir: ir-receiver {
36 compatible = "gpio-ir-receiver";
37 gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_LOW>;
38 pinctrl-names = "default";
39 pinctrl-0 = <&ir_int>;
40 };
41
42 keys: gpio-keys {
43 compatible = "gpio-keys";
44 pinctrl-names = "default";
45 pinctrl-0 = <&pwr_key>;
46
47 key-power {
48 gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
49 label = "GPIO Power";
50 linux,code = <KEY_POWER>;
51 wakeup-source;
52 };
53 };
54
55 leds: gpio-leds {
56 compatible = "gpio-leds";
57
58 blue_led: led-0 {
59 gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
60 label = "geekbox:blue:led";
61 default-state = "on";
62 };
63
64 red_led: led-1 {
65 gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
66 label = "geekbox:red:led";
67 default-state = "off";
68 };
69 };
70
71 vcc_sys: regulator-vcc-sys {
72 compatible = "regulator-fixed";
73 regulator-name = "vcc_sys";
74 regulator-min-microvolt = <5000000>;
75 regulator-max-microvolt = <5000000>;
76 regulator-always-on;
77 regulator-boot-on;
78 };
79};
80
81&emmc {
82 status = "okay";
83 bus-width = <8>;
84 cap-mmc-highspeed;
85 clock-frequency = <150000000>;
86 non-removable;
87 vmmc-supply = <&vcc_io>;
88 vqmmc-supply = <&vcc18_flash>;
89 pinctrl-names = "default";
90 pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
91};
92
93&gmac {
94 status = "okay";
95 phy-supply = <&vcc_lan>;
96 phy-mode = "rgmii";
97 clock_in_out = "input";
98 assigned-clocks = <&cru SCLK_MAC>;
99 assigned-clock-parents = <&ext_gmac>;
100 pinctrl-names = "default";
101 pinctrl-0 = <&rgmii_pins>;
102 tx_delay = <0x30>;
103 rx_delay = <0x10>;
104};
105
106&i2c0 {
107 status = "okay";
108
109 rk808: pmic@1b {
110 compatible = "rockchip,rk808";
111 reg = <0x1b>;
112 pinctrl-names = "default";
113 pinctrl-0 = <&pmic_int>, <&pmic_sleep>;
114 interrupt-parent = <&gpio0>;
115 interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
116 system-power-controller;
117 vcc1-supply = <&vcc_sys>;
118 vcc2-supply = <&vcc_sys>;
119 vcc3-supply = <&vcc_sys>;
120 vcc4-supply = <&vcc_sys>;
121 vcc6-supply = <&vcc_sys>;
122 vcc7-supply = <&vcc_sys>;
123 vcc8-supply = <&vcc_io>;
124 vcc9-supply = <&vcc_sys>;
125 vcc10-supply = <&vcc_sys>;
126 vcc11-supply = <&vcc_sys>;
127 vcc12-supply = <&vcc_io>;
128 clock-output-names = "xin32k", "rk808-clkout2";
129 #clock-cells = <1>;
130
131 regulators {
132 vdd_cpu: DCDC_REG1 {
133 regulator-always-on;
134 regulator-boot-on;
135 regulator-min-microvolt = <700000>;
136 regulator-max-microvolt = <1500000>;
137 regulator-name = "vdd_cpu";
138 };
139
140 vdd_log: DCDC_REG2 {
141 regulator-always-on;
142 regulator-boot-on;
143 regulator-min-microvolt = <700000>;
144 regulator-max-microvolt = <1500000>;
145 regulator-name = "vdd_log";
146 };
147
148 vcc_ddr: DCDC_REG3 {
149 regulator-always-on;
150 regulator-boot-on;
151 regulator-name = "vcc_ddr";
152 };
153
154 vcc_io: DCDC_REG4 {
155 regulator-always-on;
156 regulator-boot-on;
157 regulator-min-microvolt = <3300000>;
158 regulator-max-microvolt = <3300000>;
159 regulator-name = "vcc_io";
160 };
161
162 vcc18_flash: LDO_REG1 {
163 regulator-always-on;
164 regulator-boot-on;
165 regulator-min-microvolt = <1800000>;
166 regulator-max-microvolt = <1800000>;
167 regulator-name = "vcc18_flash";
168 };
169
170 vcc33_lcd: LDO_REG2 {
171 regulator-always-on;
172 regulator-boot-on;
173 regulator-min-microvolt = <3300000>;
174 regulator-max-microvolt = <3300000>;
175 regulator-name = "vcc33_lcd";
176 };
177
178 vdd_10: LDO_REG3 {
179 regulator-always-on;
180 regulator-boot-on;
181 regulator-min-microvolt = <1000000>;
182 regulator-max-microvolt = <1000000>;
183 regulator-name = "vdd_10";
184 };
185
186 vcca_18: LDO_REG4 {
187 regulator-boot-on;
188 regulator-min-microvolt = <1800000>;
189 regulator-max-microvolt = <1800000>;
190 regulator-name = "vcca_18";
191 };
192
193 vccio_sd: LDO_REG5 {
194 regulator-always-on;
195 regulator-boot-on;
196 regulator-min-microvolt = <1800000>;
197 regulator-max-microvolt = <3300000>;
198 regulator-name = "vccio_sd";
199 };
200
201 vdd10_lcd: LDO_REG6 {
202 regulator-always-on;
203 regulator-boot-on;
204 regulator-min-microvolt = <1000000>;
205 regulator-max-microvolt = <1000000>;
206 regulator-name = "vdd10_lcd";
207 };
208
209 vcc_18: LDO_REG7 {
210 regulator-always-on;
211 regulator-boot-on;
212 regulator-min-microvolt = <1800000>;
213 regulator-max-microvolt = <1800000>;
214 regulator-name = "vcc_18";
215 };
216
217 vcc18_lcd: LDO_REG8 {
218 regulator-always-on;
219 regulator-boot-on;
220 regulator-min-microvolt = <1800000>;
221 regulator-max-microvolt = <1800000>;
222 regulator-name = "vcc18_lcd";
223 };
224
225 vcc_sd: SWITCH_REG1 {
226 regulator-name = "vcc_sd";
227 };
228
229 vcc_lan: SWITCH_REG2 {
230 regulator-always-on;
231 regulator-boot-on;
232 regulator-name = "vcc_lan";
233 };
234 };
235 };
236};
237
238&pinctrl {
239 ir {
240 ir_int: ir-int {
241 rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
242 };
243 };
244
245 keys {
246 pwr_key: pwr-key {
247 rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
248 };
249 };
250
251 pmic {
252 pmic_sleep: pmic-sleep {
253 rockchip,pins = <0 RK_PA0 2 &pcfg_pull_none>;
254 };
255
256 pmic_int: pmic-int {
257 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
258 };
259 };
260};
261
262&tsadc {
263 status = "okay";
264 rockchip,hw-tshut-mode = <0>; /* CRU */
265 rockchip,hw-tshut-polarity = <1>; /* high */
266};
267
268&uart2 {
269 status = "okay";
270};
271
272&usb_host0_ehci {
273 status = "okay";
274};
275
276&usb_otg {
277 status = "okay";
278};
279
280&wdt {
281 status = "okay";
282};
1/*
2 * Copyright (c) 2016 Andreas Färber
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This file is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This file is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/dts-v1/;
44#include "rk3368.dtsi"
45#include <dt-bindings/input/input.h>
46
47/ {
48 model = "GeekBox";
49 compatible = "geekbuying,geekbox", "rockchip,rk3368";
50
51 chosen {
52 stdout-path = "serial2:115200n8";
53 };
54
55 memory@0 {
56 device_type = "memory";
57 reg = <0x0 0x0 0x0 0x80000000>;
58 };
59
60 ext_gmac: gmac-clk {
61 compatible = "fixed-clock";
62 clock-frequency = <125000000>;
63 clock-output-names = "ext_gmac";
64 #clock-cells = <0>;
65 };
66
67 ir: ir-receiver {
68 compatible = "gpio-ir-receiver";
69 gpios = <&gpio3 30 GPIO_ACTIVE_LOW>;
70 pinctrl-names = "default";
71 pinctrl-0 = <&ir_int>;
72 };
73
74 keys: gpio-keys {
75 compatible = "gpio-keys";
76 pinctrl-names = "default";
77 pinctrl-0 = <&pwr_key>;
78
79 power {
80 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
81 label = "GPIO Power";
82 linux,code = <KEY_POWER>;
83 wakeup-source;
84 };
85 };
86
87 leds: gpio-leds {
88 compatible = "gpio-leds";
89
90 blue {
91 gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
92 label = "geekbox:blue:led";
93 default-state = "on";
94 };
95
96 red {
97 gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
98 label = "geekbox:red:led";
99 default-state = "off";
100 };
101 };
102
103 vcc_sys: vcc-sys-regulator {
104 compatible = "regulator-fixed";
105 regulator-name = "vcc_sys";
106 regulator-min-microvolt = <5000000>;
107 regulator-max-microvolt = <5000000>;
108 regulator-always-on;
109 regulator-boot-on;
110 };
111};
112
113&emmc {
114 status = "okay";
115 bus-width = <8>;
116 cap-mmc-highspeed;
117 clock-frequency = <150000000>;
118 disable-wp;
119 non-removable;
120 num-slots = <1>;
121 vmmc-supply = <&vcc_io>;
122 vqmmc-supply = <&vcc18_flash>;
123 pinctrl-names = "default";
124 pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
125};
126
127&gmac {
128 status = "okay";
129 phy-supply = <&vcc_lan>;
130 phy-mode = "rgmii";
131 clock_in_out = "input";
132 assigned-clocks = <&cru SCLK_MAC>;
133 assigned-clock-parents = <&ext_gmac>;
134 pinctrl-names = "default";
135 pinctrl-0 = <&rgmii_pins>;
136 tx_delay = <0x30>;
137 rx_delay = <0x10>;
138};
139
140&i2c0 {
141 status = "okay";
142
143 rk808: pmic@1b {
144 compatible = "rockchip,rk808";
145 reg = <0x1b>;
146 pinctrl-names = "default";
147 pinctrl-0 = <&pmic_int>, <&pmic_sleep>;
148 interrupt-parent = <&gpio0>;
149 interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
150 rockchip,system-power-controller;
151 vcc1-supply = <&vcc_sys>;
152 vcc2-supply = <&vcc_sys>;
153 vcc3-supply = <&vcc_sys>;
154 vcc4-supply = <&vcc_sys>;
155 vcc6-supply = <&vcc_sys>;
156 vcc7-supply = <&vcc_sys>;
157 vcc8-supply = <&vcc_io>;
158 vcc9-supply = <&vcc_sys>;
159 vcc10-supply = <&vcc_sys>;
160 vcc11-supply = <&vcc_sys>;
161 vcc12-supply = <&vcc_io>;
162 clock-output-names = "xin32k", "rk808-clkout2";
163 #clock-cells = <1>;
164
165 regulators {
166 vdd_cpu: DCDC_REG1 {
167 regulator-always-on;
168 regulator-boot-on;
169 regulator-min-microvolt = <700000>;
170 regulator-max-microvolt = <1500000>;
171 regulator-name = "vdd_cpu";
172 };
173
174 vdd_log: DCDC_REG2 {
175 regulator-always-on;
176 regulator-boot-on;
177 regulator-min-microvolt = <700000>;
178 regulator-max-microvolt = <1500000>;
179 regulator-name = "vdd_log";
180 };
181
182 vcc_ddr: DCDC_REG3 {
183 regulator-always-on;
184 regulator-boot-on;
185 regulator-name = "vcc_ddr";
186 };
187
188 vcc_io: DCDC_REG4 {
189 regulator-always-on;
190 regulator-boot-on;
191 regulator-min-microvolt = <3300000>;
192 regulator-max-microvolt = <3300000>;
193 regulator-name = "vcc_io";
194 };
195
196 vcc18_flash: LDO_REG1 {
197 regulator-always-on;
198 regulator-boot-on;
199 regulator-min-microvolt = <1800000>;
200 regulator-max-microvolt = <1800000>;
201 regulator-name = "vcc18_flash";
202 };
203
204 vcc33_lcd: LDO_REG2 {
205 regulator-always-on;
206 regulator-boot-on;
207 regulator-min-microvolt = <3300000>;
208 regulator-max-microvolt = <3300000>;
209 regulator-name = "vcc33_lcd";
210 };
211
212 vdd_10: LDO_REG3 {
213 regulator-always-on;
214 regulator-boot-on;
215 regulator-min-microvolt = <1000000>;
216 regulator-max-microvolt = <1000000>;
217 regulator-name = "vdd_10";
218 };
219
220 vcca_18: LDO_REG4 {
221 regulator-boot-on;
222 regulator-min-microvolt = <1800000>;
223 regulator-max-microvolt = <1800000>;
224 regulator-name = "vcca_18";
225 };
226
227 vccio_sd: LDO_REG5 {
228 regulator-always-on;
229 regulator-boot-on;
230 regulator-min-microvolt = <1800000>;
231 regulator-max-microvolt = <3300000>;
232 regulator-name = "vccio_sd";
233 };
234
235 vdd10_lcd: LDO_REG6 {
236 regulator-always-on;
237 regulator-boot-on;
238 regulator-min-microvolt = <1000000>;
239 regulator-max-microvolt = <1000000>;
240 regulator-name = "vdd10_lcd";
241 };
242
243 vcc_18: LDO_REG7 {
244 regulator-always-on;
245 regulator-boot-on;
246 regulator-min-microvolt = <1800000>;
247 regulator-max-microvolt = <1800000>;
248 regulator-name = "vcc_18";
249 };
250
251 vcc18_lcd: LDO_REG8 {
252 regulator-always-on;
253 regulator-boot-on;
254 regulator-min-microvolt = <1800000>;
255 regulator-max-microvolt = <1800000>;
256 regulator-name = "vcc18_lcd";
257 };
258
259 vcc_sd: SWITCH_REG1 {
260 regulator-name = "vcc_sd";
261 };
262
263 vcc_lan: SWITCH_REG2 {
264 regulator-always-on;
265 regulator-boot-on;
266 regulator-name = "vcc_lan";
267 };
268 };
269 };
270};
271
272&pinctrl {
273 ir {
274 ir_int: ir-int {
275 rockchip,pins = <3 30 RK_FUNC_GPIO &pcfg_pull_none>;
276 };
277 };
278
279 keys {
280 pwr_key: pwr-key {
281 rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_none>;
282 };
283 };
284
285 pmic {
286 pmic_sleep: pmic-sleep {
287 rockchip,pins = <0 0 RK_FUNC_2 &pcfg_pull_none>;
288 };
289
290 pmic_int: pmic-int {
291 rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
292 };
293 };
294};
295
296&tsadc {
297 status = "okay";
298 rockchip,hw-tshut-mode = <0>; /* CRU */
299 rockchip,hw-tshut-polarity = <1>; /* high */
300};
301
302&uart2 {
303 status = "okay";
304};
305
306&usb_host0_ehci {
307 status = "okay";
308};
309
310&usb_otg {
311 status = "okay";
312};
313
314&wdt {
315 status = "okay";
316};