]>
Commit | Line | Data |
---|---|---|
b8d85a7e | 1 | /* |
4397b1f3 | 2 | * Copyright (C) 2018 Arne Fitzenreiter <arne_f@ipfire.org> |
b8d85a7e AF |
3 | * |
4 | * based on sun8i-h2-plus-nanopi-duo | |
5 | * | |
6 | * This file is dual-licensed: you can use it either under the terms | |
7 | * of the GPL or the X11 license, at your option. Note that this dual | |
8 | * licensing only applies to this file, and not this project as a | |
9 | * whole. | |
10 | * | |
11 | * a) This file is free software; you can redistribute it and/or | |
12 | * modify it under the terms of the GNU General Public License as | |
13 | * published by the Free Software Foundation; either version 2 of the | |
14 | * License, or (at your option) any later version. | |
15 | * | |
16 | * This file is distributed in the hope that it will be useful, | |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | * GNU General Public License for more details. | |
20 | * | |
21 | * Or, alternatively, | |
22 | * | |
23 | * b) Permission is hereby granted, free of charge, to any person | |
24 | * obtaining a copy of this software and associated documentation | |
25 | * files (the "Software"), to deal in the Software without | |
26 | * restriction, including without limitation the rights to use, | |
27 | * copy, modify, merge, publish, distribute, sublicense, and/or | |
28 | * sell copies of the Software, and to permit persons to whom the | |
29 | * Software is furnished to do so, subject to the following | |
30 | * conditions: | |
31 | * | |
32 | * The above copyright notice and this permission notice shall be | |
33 | * included in all copies or substantial portions of the Software. | |
34 | * | |
35 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
36 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |
37 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
38 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | |
39 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |
40 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
41 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |
42 | * OTHER DEALINGS IN THE SOFTWARE. | |
43 | */ | |
44 | ||
45 | /dts-v1/; | |
46 | #include "sun8i-h3.dtsi" | |
47 | #include "sunxi-common-regulators.dtsi" | |
48 | ||
49 | #include <dt-bindings/gpio/gpio.h> | |
50 | #include <dt-bindings/input/input.h> | |
51 | #include <dt-bindings/pinctrl/sun4i-a10.h> | |
52 | ||
53 | / { | |
54 | model = "IPFire Nano"; | |
55 | compatible = "ipfire,nano", "allwinner,sun8i-h3"; | |
56 | ||
57 | aliases { | |
58 | ethernet0 = &emac; | |
4397b1f3 | 59 | ethernet1 = &usbr8152; |
afa134af | 60 | ethernet2 = &xr819; |
b8d85a7e AF |
61 | serial0 = &uart0; |
62 | }; | |
63 | ||
64 | chosen { | |
65 | stdout-path = "serial0:115200n8"; | |
66 | }; | |
67 | ||
68 | leds { | |
69 | compatible = "gpio-leds"; | |
70 | pinctrl-names = "default"; | |
71 | pinctrl-0 = <&leds_npi>, <&leds_r_npi>; | |
72 | ||
73 | status { | |
74 | label = "ipfire:blue:status"; | |
75 | gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; | |
76 | linux,default-trigger = "mmc0"; | |
77 | }; | |
78 | ||
79 | pwr { | |
80 | label = "ipfire:green:pwr"; | |
81 | gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; | |
82 | linux,default-trigger = "heartbeat"; | |
83 | }; | |
84 | }; | |
85 | ||
86 | r_gpio_keys { | |
87 | compatible = "gpio-keys"; | |
88 | input-name = "k1"; | |
89 | pinctrl-names = "default"; | |
90 | pinctrl-0 = <&sw_r_npi>; | |
91 | ||
92 | k1@0 { | |
93 | label = "k1"; | |
94 | linux,code = <KEY_POWER>; | |
95 | gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; | |
96 | }; | |
97 | }; | |
98 | ||
99 | reg_vcc_wifi: reg_vcc_wifi { | |
100 | compatible = "regulator-fixed"; | |
101 | regulator-min-microvolt = <1800000>; | |
102 | regulator-max-microvolt = <1800000>; | |
103 | regulator-name = "vcc-wifi"; | |
104 | gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; // PL7 WIFI_POWER_EN | |
105 | startup-delay-us = <70000>; | |
106 | enable-active-high; | |
107 | }; | |
108 | ||
109 | reg_sy8113b: gpio-regulator { | |
110 | compatible = "regulator-gpio"; | |
111 | regulator-name = "vdd-cpux"; | |
112 | regulator-type = "voltage"; | |
113 | regulator-boot-on; | |
114 | regulator-always-on; | |
115 | regulator-min-microvolt = <1100000>; | |
116 | regulator-max-microvolt = <1300000>; | |
117 | regulator-ramp-delay = <50>; // 50=4ms check | |
118 | ||
119 | gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; // PL6 check | |
120 | enable-active-high; | |
121 | gpios-states = <0x1>; | |
122 | states = <1100000 0x0 | |
123 | 1300000 0x1>; | |
124 | }; | |
125 | ||
126 | wifi_pwrseq: wifi_pwrseq { | |
127 | compatible = "mmc-pwrseq-simple"; | |
128 | pinctrl-names = "default"; | |
129 | pinctrl-0 = <&wifi_en_npi>; | |
130 | reset-gpios = <&pio 6 13 GPIO_ACTIVE_LOW>; // PG13 WL_RESTN | |
131 | post-power-on-delay-ms = <50>; | |
132 | }; | |
afa134af AF |
133 | |
134 | // lower the cma shared mem pool from 64 to 8MB | |
135 | // we use no mali | |
136 | reserved-memory { | |
137 | cma: linux,cma { | |
138 | size = <0x800000>; | |
139 | }; | |
140 | }; | |
b8d85a7e AF |
141 | }; |
142 | ||
143 | &cpu0 { | |
144 | cpu-supply = <®_sy8113b>; | |
145 | }; | |
146 | ||
147 | &emac { | |
148 | phy-handle = <&int_mii_phy>; | |
149 | phy-mode = "mii"; | |
150 | allwinner,leds-active-low; | |
151 | status = "okay"; | |
152 | }; | |
153 | ||
154 | &mmc0 { | |
155 | bus-width = <4>; | |
156 | cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; | |
157 | cd-inverted; | |
158 | pinctrl-names = "default"; | |
159 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; | |
160 | status = "okay"; | |
161 | vmmc-supply = <®_vcc3v3>; | |
162 | }; | |
163 | ||
164 | &mmc1 { | |
165 | pinctrl-names = "default"; | |
166 | pinctrl-0 = <&mmc1_pins_a>; | |
167 | vqmmc-supply = <®_vcc_wifi>; | |
168 | vmmc-supply = <®_vcc3v3>; | |
169 | mmc-pwrseq = <&wifi_pwrseq>; | |
170 | bus-width = <4>; | |
171 | non-removable; | |
172 | status = "okay"; | |
173 | ||
174 | xr819: sdio_wifi@1 { | |
175 | reg = <1>; | |
176 | compatible = "xradio,xr819"; | |
177 | pinctrl-names = "default"; | |
178 | pinctrl-0 = <&wifi_wake>; | |
179 | interrupt-parent = <&pio>; | |
180 | interrupts = <6 10 IRQ_TYPE_EDGE_RISING>; | |
181 | interrupt-names = "host-wake"; | |
182 | }; | |
183 | }; | |
184 | ||
185 | &mmc1_pins_a { | |
186 | bias-pull-up; | |
187 | }; | |
188 | ||
189 | &pio { | |
190 | leds_npi: led_pins@0 { | |
191 | pins = "PA10"; | |
192 | function = "gpio_out"; | |
193 | }; | |
194 | wifi_en_npi: wifi_en_pin { | |
195 | pins = "PG13"; | |
196 | function = "gpio_out"; | |
197 | }; | |
198 | wifi_wake: wifi_wake@0 { | |
199 | pins = "PG10"; | |
200 | function = "irq"; | |
201 | pull = <SUN4I_PINCTRL_NO_PULL>; | |
202 | }; | |
203 | }; | |
204 | ||
205 | &r_pio { | |
206 | leds_r_npi: led_pins@0 { | |
207 | pins = "PL10"; | |
208 | function = "gpio_out"; | |
209 | }; | |
210 | ||
211 | sw_r_npi: key_pins@0 { | |
212 | pins = "PL3"; | |
213 | function = "gpio_in"; | |
214 | }; | |
215 | }; | |
216 | ||
217 | ||
218 | &ehci0 { | |
219 | status = "okay"; | |
220 | }; | |
221 | ||
222 | &ohci0 { | |
223 | status = "okay"; | |
224 | }; | |
225 | ||
226 | &ehci2 { | |
5630cd60 AF |
227 | status = "okay"; |
228 | #address-cells = <1>; | |
229 | #size-cells = <0>; | |
230 | usbr8152: usbether@1 { | |
231 | compatible = "usb0bda,8152"; | |
232 | reg = <1>; | |
233 | }; | |
b8d85a7e AF |
234 | }; |
235 | ||
236 | &ohci2 { | |
4397b1f3 | 237 | status = "disabled"; |
b8d85a7e AF |
238 | }; |
239 | ||
240 | &ehci3 { | |
241 | status = "okay"; | |
4397b1f3 | 242 | |
b8d85a7e AF |
243 | }; |
244 | ||
245 | &ohci3 { | |
246 | status = "okay"; | |
247 | }; | |
248 | ||
249 | &i2c0 { | |
250 | status = "okay"; | |
251 | }; | |
252 | ||
253 | &uart0 { | |
254 | pinctrl-names = "default"; | |
255 | pinctrl-0 = <&uart0_pins_a>; | |
256 | status = "okay"; | |
257 | }; | |
258 | ||
259 | &usb_otg { | |
260 | dr_mode = "peripheral"; | |
261 | status = "okay"; | |
262 | }; | |
263 | ||
264 | &usbphy { | |
265 | /* | |
266 | * USB Type-A port VBUS is always on. However, MicroUSB VBUS can only | |
267 | * power up the board; when it's used as OTG port, this VBUS is | |
268 | * always off even if the board is powered via GPIO pins. | |
269 | */ | |
270 | status = "okay"; | |
271 | usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ | |
272 | }; |