uboot-mvebu: add support for espressobin
[openwrt/openwrt.git] / package / boot / uboot-mvebu / patches / 132-arm64-dts-armada-3720-espressobin-split-common-parts.patch
1 From ee59573dd531df96de0d9dc8e79b34ed3716c864 Mon Sep 17 00:00:00 2001
2 From: Andre Heider <a.heider@gmail.com>
3 Date: Fri, 4 Sep 2020 15:38:58 +0200
4 Subject: [PATCH] arm64: dts: armada-3720-espressobin: split common parts to
5 .dtsi
6
7 Move most of the dts to the new common
8 arch/arm/dts/armada-3720-espressobin.dtsi file, just like Linux has.
9
10 The dts itself is imported from Linux.
11
12 Signed-off-by: Andre Heider <a.heider@gmail.com>
13 ---
14 arch/arm/dts/armada-3720-espressobin.dts | 190 ++----------------
15 ...sobin.dts => armada-3720-espressobin.dtsi} | 3 -
16 2 files changed, 20 insertions(+), 173 deletions(-)
17 rewrite arch/arm/dts/armada-3720-espressobin.dts (95%)
18 copy arch/arm/dts/{armada-3720-espressobin.dts => armada-3720-espressobin.dtsi} (96%)
19
20 --- a/arch/arm/dts/armada-3720-espressobin.dts
21 +++ b/arch/arm/dts/armada-3720-espressobin.dts
22 @@ -1,170 +1,20 @@
23 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
24 /*
25 - * Device Tree file for Marvell Armada 3720 community board
26 - * (ESPRESSOBin)
27 + * Device Tree file for Globalscale Marvell ESPRESSOBin Board
28 * Copyright (C) 2016 Marvell
29 *
30 - * Gregory CLEMENT <gregory.clement@free-electrons.com>
31 - * Konstantin Porotchkin <kostap@marvell.com>
32 + * Romain Perier <romain.perier@free-electrons.com>
33 *
34 - * This file is dual-licensed: you can use it either under the terms
35 - * of the GPL or the X11 license, at your option. Note that this dual
36 - * licensing only applies to this file, and not this project as a
37 - * whole.
38 - *
39 - * a) This file is free software; you can redistribute it and/or
40 - * modify it under the terms of the GNU General Public License as
41 - * published by the Free Software Foundation; either version 2 of the
42 - * License, or (at your option) any later version.
43 - *
44 - * This file is distributed in the hope that it will be useful
45 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
46 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 - * GNU General Public License for more details.
48 - *
49 - * Or, alternatively
50 - *
51 - * b) Permission is hereby granted, free of charge, to any person
52 - * obtaining a copy of this software and associated documentation
53 - * files (the "Software"), to deal in the Software without
54 - * restriction, including without limitation the rights to use
55 - * copy, modify, merge, publish, distribute, sublicense, and/or
56 - * sell copies of the Software, and to permit persons to whom the
57 - * Software is furnished to do so, subject to the following
58 - * conditions:
59 - *
60 - * The above copyright notice and this permission notice shall be
61 - * included in all copies or substantial portions of the Software.
62 - *
63 - * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
64 - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
65 - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
66 - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
67 - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
68 - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
69 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
70 - * OTHER DEALINGS IN THE SOFTWARE.
71 + */
72 +/*
73 + * Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics.pdf
74 */
75
76 /dts-v1/;
77
78 -#include "armada-372x.dtsi"
79 +#include "armada-3720-espressobin.dtsi"
80
81 / {
82 model = "Globalscale Marvell ESPRESSOBin Board";
83 compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
84 -
85 - chosen {
86 - stdout-path = "serial0:115200n8";
87 - };
88 -
89 - aliases {
90 - ethernet0 = &eth0;
91 - i2c0 = &i2c0;
92 - spi0 = &spi0;
93 - };
94 -
95 - memory {
96 - device_type = "memory";
97 - reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
98 - };
99 -
100 - vcc_sd_reg0: regulator@0 {
101 - compatible = "regulator-gpio";
102 - regulator-name = "vcc_sd0";
103 - regulator-min-microvolt = <1800000>;
104 - regulator-max-microvolt = <3300000>;
105 - regulator-type = "voltage";
106 - states = <1800000 0x1
107 - 3300000 0x0>;
108 - gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
109 - };
110 -};
111 -
112 -&comphy {
113 - max-lanes = <3>;
114 - phy0 {
115 - phy-type = <PHY_TYPE_USB3_HOST0>;
116 - phy-speed = <PHY_SPEED_5G>;
117 - };
118 -
119 - phy1 {
120 - phy-type = <PHY_TYPE_PEX0>;
121 - phy-speed = <PHY_SPEED_2_5G>;
122 - };
123 -
124 - phy2 {
125 - phy-type = <PHY_TYPE_SATA0>;
126 - phy-speed = <PHY_SPEED_5G>;
127 - };
128 -};
129 -
130 -&eth0 {
131 - status = "okay";
132 - pinctrl-names = "default";
133 - pinctrl-0 = <&rgmii_pins>, <&smi_pins>;
134 - phy-mode = "rgmii";
135 - phy_addr = <0x1>;
136 - fixed-link {
137 - speed = <1000>;
138 - full-duplex;
139 - };
140 -};
141 -
142 -&i2c0 {
143 - pinctrl-names = "default";
144 - pinctrl-0 = <&i2c1_pins>;
145 - status = "okay";
146 -};
147 -
148 -/* CON3 */
149 -&sata {
150 - status = "okay";
151 -};
152 -
153 -&sdhci0 {
154 - pinctrl-names = "default";
155 - pinctrl-0 = <&sdio_pins>;
156 - bus-width = <4>;
157 - cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
158 - vqmmc-supply = <&vcc_sd_reg0>;
159 - status = "okay";
160 -};
161 -
162 -&spi0 {
163 - status = "okay";
164 - pinctrl-names = "default";
165 - pinctrl-0 = <&spi_quad_pins>;
166 -
167 - spi-flash@0 {
168 - #address-cells = <1>;
169 - #size-cells = <1>;
170 - compatible = "st,m25p128", "jedec,spi-nor";
171 - reg = <0>; /* Chip select 0 */
172 - spi-max-frequency = <50000000>;
173 - m25p,fast-read;
174 - };
175 -};
176 -
177 -/* Exported on the micro USB connector CON32 through an FTDI */
178 -&uart0 {
179 - pinctrl-names = "default";
180 - pinctrl-0 = <&uart1_pins>;
181 - status = "okay";
182 -};
183 -
184 -/* CON29 */
185 -&usb2 {
186 - status = "okay";
187 -};
188 -
189 -/* CON31 */
190 -&usb3 {
191 - status = "okay";
192 -};
193 -
194 -&pcie0 {
195 - pinctrl-names = "default";
196 - pinctrl-0 = <&pcie_pins>;
197 - reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
198 - status = "okay";
199 };
200 --- /dev/null
201 +++ b/arch/arm/dts/armada-3720-espressobin.dtsi
202 @@ -0,0 +1,167 @@
203 +/*
204 + * Device Tree file for Marvell Armada 3720 community board
205 + * (ESPRESSOBin)
206 + * Copyright (C) 2016 Marvell
207 + *
208 + * Gregory CLEMENT <gregory.clement@free-electrons.com>
209 + * Konstantin Porotchkin <kostap@marvell.com>
210 + *
211 + * This file is dual-licensed: you can use it either under the terms
212 + * of the GPL or the X11 license, at your option. Note that this dual
213 + * licensing only applies to this file, and not this project as a
214 + * whole.
215 + *
216 + * a) This file is free software; you can redistribute it and/or
217 + * modify it under the terms of the GNU General Public License as
218 + * published by the Free Software Foundation; either version 2 of the
219 + * License, or (at your option) any later version.
220 + *
221 + * This file is distributed in the hope that it will be useful
222 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
223 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
224 + * GNU General Public License for more details.
225 + *
226 + * Or, alternatively
227 + *
228 + * b) Permission is hereby granted, free of charge, to any person
229 + * obtaining a copy of this software and associated documentation
230 + * files (the "Software"), to deal in the Software without
231 + * restriction, including without limitation the rights to use
232 + * copy, modify, merge, publish, distribute, sublicense, and/or
233 + * sell copies of the Software, and to permit persons to whom the
234 + * Software is furnished to do so, subject to the following
235 + * conditions:
236 + *
237 + * The above copyright notice and this permission notice shall be
238 + * included in all copies or substantial portions of the Software.
239 + *
240 + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
241 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
242 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
243 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
244 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
245 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
246 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
247 + * OTHER DEALINGS IN THE SOFTWARE.
248 + */
249 +
250 +/dts-v1/;
251 +
252 +#include "armada-372x.dtsi"
253 +
254 +/ {
255 + chosen {
256 + stdout-path = "serial0:115200n8";
257 + };
258 +
259 + aliases {
260 + ethernet0 = &eth0;
261 + i2c0 = &i2c0;
262 + spi0 = &spi0;
263 + };
264 +
265 + memory {
266 + device_type = "memory";
267 + reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
268 + };
269 +
270 + vcc_sd_reg0: regulator@0 {
271 + compatible = "regulator-gpio";
272 + regulator-name = "vcc_sd0";
273 + regulator-min-microvolt = <1800000>;
274 + regulator-max-microvolt = <3300000>;
275 + regulator-type = "voltage";
276 + states = <1800000 0x1
277 + 3300000 0x0>;
278 + gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
279 + };
280 +};
281 +
282 +&comphy {
283 + max-lanes = <3>;
284 + phy0 {
285 + phy-type = <PHY_TYPE_USB3_HOST0>;
286 + phy-speed = <PHY_SPEED_5G>;
287 + };
288 +
289 + phy1 {
290 + phy-type = <PHY_TYPE_PEX0>;
291 + phy-speed = <PHY_SPEED_2_5G>;
292 + };
293 +
294 + phy2 {
295 + phy-type = <PHY_TYPE_SATA0>;
296 + phy-speed = <PHY_SPEED_5G>;
297 + };
298 +};
299 +
300 +&eth0 {
301 + status = "okay";
302 + pinctrl-names = "default";
303 + pinctrl-0 = <&rgmii_pins>, <&smi_pins>;
304 + phy-mode = "rgmii";
305 + phy_addr = <0x1>;
306 + fixed-link {
307 + speed = <1000>;
308 + full-duplex;
309 + };
310 +};
311 +
312 +&i2c0 {
313 + pinctrl-names = "default";
314 + pinctrl-0 = <&i2c1_pins>;
315 + status = "okay";
316 +};
317 +
318 +/* CON3 */
319 +&sata {
320 + status = "okay";
321 +};
322 +
323 +&sdhci0 {
324 + pinctrl-names = "default";
325 + pinctrl-0 = <&sdio_pins>;
326 + bus-width = <4>;
327 + cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
328 + vqmmc-supply = <&vcc_sd_reg0>;
329 + status = "okay";
330 +};
331 +
332 +&spi0 {
333 + status = "okay";
334 + pinctrl-names = "default";
335 + pinctrl-0 = <&spi_quad_pins>;
336 +
337 + spi-flash@0 {
338 + #address-cells = <1>;
339 + #size-cells = <1>;
340 + compatible = "st,m25p128", "jedec,spi-nor";
341 + reg = <0>; /* Chip select 0 */
342 + spi-max-frequency = <50000000>;
343 + m25p,fast-read;
344 + };
345 +};
346 +
347 +/* Exported on the micro USB connector CON32 through an FTDI */
348 +&uart0 {
349 + pinctrl-names = "default";
350 + pinctrl-0 = <&uart1_pins>;
351 + status = "okay";
352 +};
353 +
354 +/* CON29 */
355 +&usb2 {
356 + status = "okay";
357 +};
358 +
359 +/* CON31 */
360 +&usb3 {
361 + status = "okay";
362 +};
363 +
364 +&pcie0 {
365 + pinctrl-names = "default";
366 + pinctrl-0 = <&pcie_pins>;
367 + reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
368 + status = "okay";
369 +};