e33840cfd8b2fb97e0931332c336cbe5380da912
[openwrt/staging/hauke.git] / target / linux / at91 / patches-4.9 / 105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch
1 --- a/arch/arm/boot/dts/Makefile
2 +++ b/arch/arm/boot/dts/Makefile
3 @@ -49,6 +49,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
4 wb45n.dtb
5 dtb-$(CONFIG_SOC_SAM_V7) += \
6 at91-kizbox2.dtb \
7 + at91-sama5d2_ptc_ek.dtb \
8 at91-sama5d27_som1_ek.dtb \
9 at91-sama5d2_xplained.dtb \
10 at91-sama5d3_xplained.dtb \
11 --- /dev/null
12 +++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
13 @@ -0,0 +1,422 @@
14 +// SPDX-License-Identifier: (GPL-2.0+ OR X11)
15 +/*
16 + * at91-sama5d2_ptc_ek.dts - Device Tree file for SAMA5D2 PTC EK board
17 + *
18 + * Copyright (C) 2017 Microchip/Atmel,
19 + * 2017 Wenyou Yang <wenyou.yang@microchip.com>
20 + * 2017 Ludovic Desroches <ludovic.desroches@microchip.com>
21 + */
22 +/dts-v1/;
23 +#include "sama5d2.dtsi"
24 +#include "sama5d2-pinfunc.h"
25 +#include <dt-bindings/mfd/atmel-flexcom.h>
26 +#include <dt-bindings/gpio/gpio.h>
27 +#include <dt-bindings/pinctrl/at91.h>
28 +
29 +/ {
30 + model = "Atmel SAMA5D2 PTC EK";
31 + compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5";
32 +
33 + aliases {
34 + serial0 = &uart0;
35 + i2c0 = &i2c0;
36 + i2c1 = &i2c1;
37 + i2c2 = &i2c2;
38 + };
39 +
40 + chosen {
41 + stdout-path = "serial0:115200n8";
42 + };
43 +
44 + memory {
45 + reg = <0x20000000 0x80000>;
46 + };
47 +
48 + clocks {
49 + slow_xtal {
50 + clock-frequency = <32768>;
51 + };
52 +
53 + main_xtal {
54 + clock-frequency = <24000000>;
55 + };
56 + };
57 +
58 + ahb {
59 + usb0: gadget@00300000 {
60 + atmel,vbus-gpio = <&pioA PIN_PB11 GPIO_ACTIVE_HIGH>;
61 + pinctrl-names = "default";
62 + pinctrl-0 = <&pinctrl_usba_vbus>;
63 + status = "okay";
64 + };
65 +
66 + usb1: ohci@00400000 {
67 + num-ports = <3>;
68 + atmel,vbus-gpio = <0
69 + &pioA PIN_PB12 GPIO_ACTIVE_HIGH
70 + 0
71 + >;
72 + pinctrl-names = "default";
73 + pinctrl-0 = <&pinctrl_usb_default>;
74 + status = "okay";
75 + };
76 +
77 + usb2: ehci@00500000 {
78 + status = "okay";
79 + };
80 +
81 + nand0: nand@80000000 {
82 + nand-bus-width = <8>;
83 + nand-ecc-mode = "hw";
84 + nand-on-flash-bbt;
85 + atmel,has-pmecc;
86 + pinctrl-names = "default";
87 + pinctrl-0 = <&pinctrl_nand_default>;
88 + status = "okay"; /* conflicts with sdmmc1 and qspi0 */
89 +
90 + at91bootstrap@0 {
91 + label = "bootstrap";
92 + reg = <0x0 0x40000>;
93 + };
94 +
95 + bootloader@40000 {
96 + label = "bootloader";
97 + reg = <0x40000 0xc0000>;
98 + };
99 +
100 + bootloaderenv@0x100000 {
101 + label = "bootloader env";
102 + reg = <0x100000 0x40000>;
103 + };
104 +
105 + bootloaderenvred@0x140000 {
106 + label = "bootloader env redundant";
107 + reg = <0x140000 0x40000>;
108 + };
109 +
110 + dtb@180000 {
111 + label = "device tree";
112 + reg = <0x180000 0x80000>;
113 + };
114 +
115 + kernel@200000 {
116 + label = "kernel";
117 + reg = <0x200000 0x600000>;
118 + };
119 +
120 + rootfs@800000 {
121 + label = "rootfs";
122 + reg = <0x800000 0x1f800000>;
123 + };
124 + };
125 +
126 + sdmmc0: sdio-host@a0000000 {
127 + bus-width = <8>;
128 + pinctrl-names = "default";
129 + pinctrl-0 = <&pinctrl_sdmmc0_default>;
130 + status = "okay";
131 + };
132 +
133 + apb {
134 + pmc: pmc@f0014000 {
135 + pmc_fast_restart {
136 + compatible = "atmel,sama5d2-pmc-fast-startup";
137 + #address-cells = <1>;
138 + #size-cells = <0>;
139 +
140 + atmel,wakeup-rtc-timer;
141 +
142 + wkpin: input@0 {
143 + reg = <0>;
144 + };
145 +
146 + gmac_wol: input@10 {
147 + reg = <10>;
148 + atmel,wakeup-active-high;
149 + };
150 + };
151 + };
152 +
153 + spi0: spi@f8000000 {
154 + pinctrl-names = "default";
155 + pinctrl-0 = <&pinctrl_spi0_default>;
156 + status = "okay";
157 +
158 + /*
159 + m25p80@0 {
160 + compatible = "atmel,at25df321a";
161 + reg = <0>;
162 + spi-max-frequency = <50000000>;
163 + };
164 + */
165 + };
166 +
167 + macb0: ethernet@f8008000 {
168 + pinctrl-names = "default";
169 + pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>;
170 + phy-mode = "rmii";
171 + status = "okay";
172 +
173 + ethernet-phy@1 {
174 + reg = <0x1>;
175 + interrupt-parent = <&pioA>;
176 + interrupts = <56 IRQ_TYPE_LEVEL_LOW>;
177 + };
178 + };
179 +
180 + uart0: serial@f801c000 {
181 + pinctrl-names = "default";
182 + pinctrl-0 = <&pinctrl_uart0_default>;
183 + atmel,use-dma-rx;
184 + atmel,use-dma-tx;
185 + status = "okay";
186 + };
187 +
188 + uart2: serial@f8024000 {
189 + pinctrl-names = "default";
190 + pinctrl-0 = <&pinctrl_uart2_default>;
191 + atmel,use-dma-rx;
192 + atmel,use-dma-tx;
193 + status = "okay";
194 + };
195 +
196 + i2c0: i2c@f8028000 {
197 + dmas = <0>, <0>;
198 + pinctrl-names = "default";
199 + pinctrl-0 = <&pinctrl_i2c0_default>;
200 + i2c-sda-hold-time-ns = <350>;
201 + status = "okay";
202 + };
203 +
204 + flx0: flexcom@f8034000 {
205 + atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
206 + status = "okay";
207 +
208 + i2c2: i2c@600 {
209 + compatible = "atmel,sama5d2-i2c";
210 + reg = <0x600 0x200>;
211 + interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
212 + dmas = <0>, <0>;
213 + dma-names = "tx", "rx";
214 + #address-cells = <1>;
215 + #size-cells = <0>;
216 + clocks = <&flx0_clk>;
217 + pinctrl-names = "default";
218 + pinctrl-0 = <&pinctrl_flx0_default>;
219 + atmel,fifo-size = <16>;
220 + status = "okay";
221 + };
222 + };
223 +
224 + shdwc@f8048010 {
225 + atmel,shdwc-debouncer = <976>;
226 +
227 + input@0 {
228 + reg = <0>;
229 + atmel,wakeup-type = "low";
230 + };
231 + };
232 +
233 + watchdog@f8048040 {
234 + status = "okay";
235 + };
236 +
237 + spi1: spi@fc000000 {
238 + pinctrl-names = "default";
239 + pinctrl-0 = <&pinctrl_spi1_default>;
240 + status = "okay";
241 + };
242 +
243 + i2c1: i2c@fc028000 {
244 + dmas = <0>, <0>;
245 + pinctrl-names = "default";
246 + pinctrl-0 = <&pinctrl_i2c1_default>;
247 + status = "okay";
248 +
249 + at24@50 {
250 + compatible = "24c02";
251 + reg = <0x50>;
252 + pagesize = <8>;
253 + };
254 + };
255 +
256 + pinctrl@fc038000 {
257 + pinctrl_flx0_default: flx0_default {
258 + pinmux = <PIN_PB28__FLEXCOM0_IO0>,
259 + <PIN_PB29__FLEXCOM0_IO1>;
260 + bias-disable;
261 + };
262 +
263 + pinctrl_i2c0_default: i2c0_default {
264 + pinmux = <PIN_PD21__TWD0>,
265 + <PIN_PD22__TWCK0>;
266 + bias-disable;
267 + };
268 +
269 + pinctrl_i2c1_default: i2c1_default {
270 + pinmux = <PIN_PC6__TWD1>,
271 + <PIN_PC7__TWCK1>;
272 + bias-disable;
273 + };
274 +
275 + pinctrl_key_gpio_default: key_gpio_default {
276 + pinmux = <PIN_PA10__GPIO>;
277 + bias-pull-up;
278 + };
279 +
280 + pinctrl_led_gpio_default: led_gpio_default {
281 + pinmux = <PIN_PB6__GPIO>,
282 + <PIN_PB8__GPIO>,
283 + <PIN_PB10__GPIO>;
284 + bias-pull-up;
285 + };
286 +
287 + pinctrl_macb0_default: macb0_default {
288 + pinmux = <PIN_PB14__GTXCK>,
289 + <PIN_PB15__GTXEN>,
290 + <PIN_PB16__GRXDV>,
291 + <PIN_PB17__GRXER>,
292 + <PIN_PB18__GRX0>,
293 + <PIN_PB19__GRX1>,
294 + <PIN_PB20__GTX0>,
295 + <PIN_PB21__GTX1>,
296 + <PIN_PB22__GMDC>,
297 + <PIN_PB23__GMDIO>;
298 + bias-disable;
299 + };
300 +
301 + pinctrl_macb0_phy_irq: macb0_phy_irq {
302 + pinmux = <PIN_PB24__GPIO>;
303 + bias-disable;
304 + };
305 +
306 + pinctrl_nand_default: nand_default {
307 + re_we_data {
308 + pinmux = <PIN_PA22__D0>,
309 + <PIN_PA23__D1>,
310 + <PIN_PA24__D2>,
311 + <PIN_PA25__D3>,
312 + <PIN_PA26__D4>,
313 + <PIN_PA27__D5>,
314 + <PIN_PA28__D6>,
315 + <PIN_PA29__D7>,
316 + <PIN_PA30__NWE_NANDWE>,
317 + <PIN_PB2__NRD_NANDOE>;
318 + bias-pull-up;
319 + drive-strength = <ATMEL_PIO_DRVSTR_ME>;
320 + };
321 +
322 + ale_cle_rdy_cs {
323 + pinmux = <PIN_PB0__A21_NANDALE>,
324 + <PIN_PB1__A22_NANDCLE>,
325 + <PIN_PC8__NANDRDY>,
326 + <PIN_PA31__NCS3>;
327 + bias-pull-up;
328 + };
329 + };
330 +
331 + pinctrl_sdmmc0_default: sdmmc0_default {
332 + cmd_data {
333 + pinmux = <PIN_PA1__SDMMC0_CMD>,
334 + <PIN_PA2__SDMMC0_DAT0>,
335 + <PIN_PA3__SDMMC0_DAT1>,
336 + <PIN_PA4__SDMMC0_DAT2>,
337 + <PIN_PA5__SDMMC0_DAT3>,
338 + <PIN_PA6__SDMMC0_DAT4>,
339 + <PIN_PA7__SDMMC0_DAT5>,
340 + <PIN_PA8__SDMMC0_DAT6>,
341 + <PIN_PA9__SDMMC0_DAT7>;
342 + bias-pull-up;
343 + };
344 +
345 + ck_cd_vddsel {
346 + pinmux = <PIN_PA0__SDMMC0_CK>,
347 + <PIN_PA11__SDMMC0_VDDSEL>,
348 + <PIN_PA13__SDMMC0_CD>;
349 + bias-disable;
350 + };
351 + };
352 +
353 + pinctrl_spi0_default: spi0_default {
354 + pinmux = <PIN_PA14__SPI0_SPCK>,
355 + <PIN_PA15__SPI0_MOSI>,
356 + <PIN_PA16__SPI0_MISO>,
357 + <PIN_PA17__SPI0_NPCS0>;
358 + bias-disable;
359 + };
360 +
361 + pinctrl_spi1_default: spi1_default {
362 + pinmux = <PIN_PC1__SPI1_SPCK>,
363 + <PIN_PC2__SPI1_MOSI>,
364 + <PIN_PC3__SPI1_MISO>,
365 + <PIN_PC4__SPI1_NPCS0>;
366 + bias-disable;
367 + };
368 +
369 + pinctrl_uart0_default: uart0_default {
370 + pinmux = <PIN_PB26__URXD0>,
371 + <PIN_PB27__UTXD0>;
372 + bias-disable;
373 + };
374 +
375 + pinctrl_uart2_default: uart2_default {
376 + pinmux = <PIN_PD23__URXD2>,
377 + <PIN_PD24__UTXD2>;
378 + bias-disable;
379 + };
380 +
381 + pinctrl_usb_default: usb_default {
382 + pinmux = <PIN_PB12__GPIO>;
383 + bias-disable;
384 + };
385 +
386 + pinctrl_usba_vbus: usba_vbus {
387 + pinmux = <PIN_PB11__GPIO>;
388 + bias-disable;
389 + };
390 +
391 + };
392 +
393 + ptc@fc060000 {
394 + status = "okay";
395 + };
396 + };
397 + };
398 +
399 + gpio_keys {
400 + compatible = "gpio-keys";
401 +
402 + pinctrl-names = "default";
403 + pinctrl-0 = <&pinctrl_key_gpio_default>;
404 +
405 + bp1 {
406 + label = "PB_USER";
407 + gpios = <&pioA PIN_PA10 GPIO_ACTIVE_LOW>;
408 + linux,code = <0x104>;
409 + wakeup-source;
410 + };
411 + };
412 +
413 + leds {
414 + compatible = "gpio-leds";
415 + pinctrl-names = "default";
416 + pinctrl-0 = <&pinctrl_led_gpio_default>;
417 + status = "okay";
418 +
419 + red {
420 + label = "red";
421 + gpios = <&pioA PIN_PB10 GPIO_ACTIVE_HIGH>;
422 + };
423 +
424 + green {
425 + label = "green";
426 + gpios = <&pioA PIN_PB8 GPIO_ACTIVE_HIGH>;
427 + };
428 +
429 + blue {
430 + label = "blue";
431 + gpios = <&pioA PIN_PB6 GPIO_ACTIVE_HIGH>;
432 + linux,default-trigger = "heartbeat";
433 + };
434 + };
435 +};