GNU Linux-libre 4.19.286-gnu1
[releases.git] / arch / arm64 / boot / dts / rockchip / rk3368-geekbox.dts
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         chosen {
15                 stdout-path = "serial2:115200n8";
16         };
17
18         memory@0 {
19                 device_type = "memory";
20                 reg = <0x0 0x0 0x0 0x80000000>;
21         };
22
23         ext_gmac: gmac-clk {
24                 compatible = "fixed-clock";
25                 clock-frequency = <125000000>;
26                 clock-output-names = "ext_gmac";
27                 #clock-cells = <0>;
28         };
29
30         ir: ir-receiver {
31                 compatible = "gpio-ir-receiver";
32                 gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_LOW>;
33                 pinctrl-names = "default";
34                 pinctrl-0 = <&ir_int>;
35         };
36
37         keys: gpio-keys {
38                 compatible = "gpio-keys";
39                 pinctrl-names = "default";
40                 pinctrl-0 = <&pwr_key>;
41
42                 power {
43                         gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
44                         label = "GPIO Power";
45                         linux,code = <KEY_POWER>;
46                         wakeup-source;
47                 };
48         };
49
50         leds: gpio-leds {
51                 compatible = "gpio-leds";
52
53                 blue {
54                         gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
55                         label = "geekbox:blue:led";
56                         default-state = "on";
57                 };
58
59                 red {
60                         gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
61                         label = "geekbox:red:led";
62                         default-state = "off";
63                 };
64         };
65
66         vcc_sys: vcc-sys-regulator {
67                 compatible = "regulator-fixed";
68                 regulator-name = "vcc_sys";
69                 regulator-min-microvolt = <5000000>;
70                 regulator-max-microvolt = <5000000>;
71                 regulator-always-on;
72                 regulator-boot-on;
73         };
74 };
75
76 &emmc {
77         status = "okay";
78         bus-width = <8>;
79         cap-mmc-highspeed;
80         clock-frequency = <150000000>;
81         disable-wp;
82         non-removable;
83         vmmc-supply = <&vcc_io>;
84         vqmmc-supply = <&vcc18_flash>;
85         pinctrl-names = "default";
86         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>;
87 };
88
89 &gmac {
90         status = "okay";
91         phy-supply = <&vcc_lan>;
92         phy-mode = "rgmii";
93         clock_in_out = "input";
94         assigned-clocks = <&cru SCLK_MAC>;
95         assigned-clock-parents = <&ext_gmac>;
96         pinctrl-names = "default";
97         pinctrl-0 = <&rgmii_pins>;
98         tx_delay = <0x30>;
99         rx_delay = <0x10>;
100 };
101
102 &i2c0 {
103         status = "okay";
104
105         rk808: pmic@1b {
106                 compatible = "rockchip,rk808";
107                 reg = <0x1b>;
108                 pinctrl-names = "default";
109                 pinctrl-0 = <&pmic_int>, <&pmic_sleep>;
110                 interrupt-parent = <&gpio0>;
111                 interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
112                 rockchip,system-power-controller;
113                 vcc1-supply = <&vcc_sys>;
114                 vcc2-supply = <&vcc_sys>;
115                 vcc3-supply = <&vcc_sys>;
116                 vcc4-supply = <&vcc_sys>;
117                 vcc6-supply = <&vcc_sys>;
118                 vcc7-supply = <&vcc_sys>;
119                 vcc8-supply = <&vcc_io>;
120                 vcc9-supply = <&vcc_sys>;
121                 vcc10-supply = <&vcc_sys>;
122                 vcc11-supply = <&vcc_sys>;
123                 vcc12-supply = <&vcc_io>;
124                 clock-output-names = "xin32k", "rk808-clkout2";
125                 #clock-cells = <1>;
126
127                 regulators {
128                         vdd_cpu: DCDC_REG1 {
129                                 regulator-always-on;
130                                 regulator-boot-on;
131                                 regulator-min-microvolt = <700000>;
132                                 regulator-max-microvolt = <1500000>;
133                                 regulator-name = "vdd_cpu";
134                         };
135
136                         vdd_log: DCDC_REG2 {
137                                 regulator-always-on;
138                                 regulator-boot-on;
139                                 regulator-min-microvolt = <700000>;
140                                 regulator-max-microvolt = <1500000>;
141                                 regulator-name = "vdd_log";
142                         };
143
144                         vcc_ddr: DCDC_REG3 {
145                                 regulator-always-on;
146                                 regulator-boot-on;
147                                 regulator-name = "vcc_ddr";
148                         };
149
150                         vcc_io: DCDC_REG4 {
151                                 regulator-always-on;
152                                 regulator-boot-on;
153                                 regulator-min-microvolt = <3300000>;
154                                 regulator-max-microvolt = <3300000>;
155                                 regulator-name = "vcc_io";
156                         };
157
158                         vcc18_flash: LDO_REG1 {
159                                 regulator-always-on;
160                                 regulator-boot-on;
161                                 regulator-min-microvolt = <1800000>;
162                                 regulator-max-microvolt = <1800000>;
163                                 regulator-name = "vcc18_flash";
164                         };
165
166                         vcc33_lcd: LDO_REG2 {
167                                 regulator-always-on;
168                                 regulator-boot-on;
169                                 regulator-min-microvolt = <3300000>;
170                                 regulator-max-microvolt = <3300000>;
171                                 regulator-name = "vcc33_lcd";
172                         };
173
174                         vdd_10: LDO_REG3 {
175                                 regulator-always-on;
176                                 regulator-boot-on;
177                                 regulator-min-microvolt = <1000000>;
178                                 regulator-max-microvolt = <1000000>;
179                                 regulator-name = "vdd_10";
180                         };
181
182                         vcca_18: LDO_REG4 {
183                                 regulator-boot-on;
184                                 regulator-min-microvolt = <1800000>;
185                                 regulator-max-microvolt = <1800000>;
186                                 regulator-name = "vcca_18";
187                         };
188
189                         vccio_sd: LDO_REG5 {
190                                 regulator-always-on;
191                                 regulator-boot-on;
192                                 regulator-min-microvolt = <1800000>;
193                                 regulator-max-microvolt = <3300000>;
194                                 regulator-name = "vccio_sd";
195                         };
196
197                         vdd10_lcd: LDO_REG6 {
198                                 regulator-always-on;
199                                 regulator-boot-on;
200                                 regulator-min-microvolt = <1000000>;
201                                 regulator-max-microvolt = <1000000>;
202                                 regulator-name = "vdd10_lcd";
203                         };
204
205                         vcc_18: LDO_REG7 {
206                                 regulator-always-on;
207                                 regulator-boot-on;
208                                 regulator-min-microvolt = <1800000>;
209                                 regulator-max-microvolt = <1800000>;
210                                 regulator-name = "vcc_18";
211                         };
212
213                         vcc18_lcd: LDO_REG8 {
214                                 regulator-always-on;
215                                 regulator-boot-on;
216                                 regulator-min-microvolt = <1800000>;
217                                 regulator-max-microvolt = <1800000>;
218                                 regulator-name = "vcc18_lcd";
219                         };
220
221                         vcc_sd: SWITCH_REG1 {
222                                 regulator-name = "vcc_sd";
223                         };
224
225                         vcc_lan: SWITCH_REG2 {
226                                 regulator-always-on;
227                                 regulator-boot-on;
228                                 regulator-name = "vcc_lan";
229                         };
230                 };
231         };
232 };
233
234 &pinctrl {
235         ir {
236                 ir_int: ir-int {
237                         rockchip,pins = <3 30 RK_FUNC_GPIO &pcfg_pull_none>;
238                 };
239         };
240
241         keys {
242                 pwr_key: pwr-key {
243                         rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_none>;
244                 };
245         };
246
247         pmic {
248                 pmic_sleep: pmic-sleep {
249                         rockchip,pins = <0 0 RK_FUNC_2 &pcfg_pull_none>;
250                 };
251
252                 pmic_int: pmic-int {
253                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
254                 };
255         };
256 };
257
258 &tsadc {
259         status = "okay";
260         rockchip,hw-tshut-mode = <0>; /* CRU */
261         rockchip,hw-tshut-polarity = <1>; /* high */
262 };
263
264 &uart2 {
265         status = "okay";
266 };
267
268 &usb_host0_ehci {
269         status = "okay";
270 };
271
272 &usb_otg {
273         status = "okay";
274 };
275
276 &wdt {
277         status = "okay";
278 };