1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*f126890aSEmmanuel Vadot/*
3*f126890aSEmmanuel Vadot * at91-sama5d4ek.dts - Device Tree file for SAMA5D4 Evaluation Kit
4*f126890aSEmmanuel Vadot *
5*f126890aSEmmanuel Vadot *  Copyright (C) 2014 Atmel,
6*f126890aSEmmanuel Vadot *                2014 Nicolas Ferre <nicolas.ferre@atmel.com>
7*f126890aSEmmanuel Vadot */
8*f126890aSEmmanuel Vadot/dts-v1/;
9*f126890aSEmmanuel Vadot#include "sama5d4.dtsi"
10*f126890aSEmmanuel Vadot
11*f126890aSEmmanuel Vadot/ {
12*f126890aSEmmanuel Vadot	model = "Atmel SAMA5D4-EK";
13*f126890aSEmmanuel Vadot	compatible = "atmel,sama5d4ek", "atmel,sama5d4", "atmel,sama5";
14*f126890aSEmmanuel Vadot
15*f126890aSEmmanuel Vadot	chosen {
16*f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
17*f126890aSEmmanuel Vadot	};
18*f126890aSEmmanuel Vadot
19*f126890aSEmmanuel Vadot	memory@20000000 {
20*f126890aSEmmanuel Vadot		reg = <0x20000000 0x20000000>;
21*f126890aSEmmanuel Vadot	};
22*f126890aSEmmanuel Vadot
23*f126890aSEmmanuel Vadot	clocks {
24*f126890aSEmmanuel Vadot		slow_xtal {
25*f126890aSEmmanuel Vadot			clock-frequency = <32768>;
26*f126890aSEmmanuel Vadot		};
27*f126890aSEmmanuel Vadot
28*f126890aSEmmanuel Vadot		main_xtal {
29*f126890aSEmmanuel Vadot			clock-frequency = <12000000>;
30*f126890aSEmmanuel Vadot		};
31*f126890aSEmmanuel Vadot	};
32*f126890aSEmmanuel Vadot
33*f126890aSEmmanuel Vadot	ahb {
34*f126890aSEmmanuel Vadot		apb {
35*f126890aSEmmanuel Vadot			adc0: adc@fc034000 {
36*f126890aSEmmanuel Vadot				pinctrl-names = "default";
37*f126890aSEmmanuel Vadot				pinctrl-0 = <
38*f126890aSEmmanuel Vadot					/* external trigger conflicts with USBA_VBUS */
39*f126890aSEmmanuel Vadot					&pinctrl_adc0_ad0
40*f126890aSEmmanuel Vadot					&pinctrl_adc0_ad1
41*f126890aSEmmanuel Vadot					&pinctrl_adc0_ad2
42*f126890aSEmmanuel Vadot					&pinctrl_adc0_ad3
43*f126890aSEmmanuel Vadot					&pinctrl_adc0_ad4
44*f126890aSEmmanuel Vadot					>;
45*f126890aSEmmanuel Vadot				/* The vref depends on JP22 of EK. If connect 1-2 then use 3.3V. connect 2-3 use 3.0V */
46*f126890aSEmmanuel Vadot				atmel,adc-vref = <3300>;
47*f126890aSEmmanuel Vadot				/*atmel,adc-ts-wires = <4>;*/	/* Set up ADC touch screen */
48*f126890aSEmmanuel Vadot				status = "okay";		/* Enable ADC IIO support */
49*f126890aSEmmanuel Vadot			};
50*f126890aSEmmanuel Vadot
51*f126890aSEmmanuel Vadot			mmc0: mmc@f8000000 {
52*f126890aSEmmanuel Vadot				pinctrl-names = "default";
53*f126890aSEmmanuel Vadot				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>;
54*f126890aSEmmanuel Vadot				slot@0 {
55*f126890aSEmmanuel Vadot					reg = <0>;
56*f126890aSEmmanuel Vadot					bus-width = <4>;
57*f126890aSEmmanuel Vadot					cd-gpios = <&pioE 5 0>;
58*f126890aSEmmanuel Vadot				};
59*f126890aSEmmanuel Vadot			};
60*f126890aSEmmanuel Vadot
61*f126890aSEmmanuel Vadot			ssc0: ssc@f8008000 {
62*f126890aSEmmanuel Vadot				status = "okay";
63*f126890aSEmmanuel Vadot			};
64*f126890aSEmmanuel Vadot
65*f126890aSEmmanuel Vadot			spi0: spi@f8010000 {
66*f126890aSEmmanuel Vadot				cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
67*f126890aSEmmanuel Vadot				status = "okay";
68*f126890aSEmmanuel Vadot				flash@0 {
69*f126890aSEmmanuel Vadot					compatible = "atmel,at25df321a";
70*f126890aSEmmanuel Vadot					spi-max-frequency = <50000000>;
71*f126890aSEmmanuel Vadot					reg = <0>;
72*f126890aSEmmanuel Vadot				};
73*f126890aSEmmanuel Vadot			};
74*f126890aSEmmanuel Vadot
75*f126890aSEmmanuel Vadot			i2c0: i2c@f8014000 {
76*f126890aSEmmanuel Vadot				status = "okay";
77*f126890aSEmmanuel Vadot
78*f126890aSEmmanuel Vadot				wm8904: codec@1a {
79*f126890aSEmmanuel Vadot					compatible = "wlf,wm8904";
80*f126890aSEmmanuel Vadot					reg = <0x1a>;
81*f126890aSEmmanuel Vadot					clocks = <&pmc PMC_TYPE_SYSTEM 10>;
82*f126890aSEmmanuel Vadot					clock-names = "mclk";
83*f126890aSEmmanuel Vadot				};
84*f126890aSEmmanuel Vadot
85*f126890aSEmmanuel Vadot				qt1070:keyboard@1b {
86*f126890aSEmmanuel Vadot					compatible = "qt1070";
87*f126890aSEmmanuel Vadot					reg = <0x1b>;
88*f126890aSEmmanuel Vadot					interrupt-parent = <&pioE>;
89*f126890aSEmmanuel Vadot					interrupts = <25 0x0>;
90*f126890aSEmmanuel Vadot					pinctrl-names = "default";
91*f126890aSEmmanuel Vadot					pinctrl-0 = <&pinctrl_qt1070_irq>;
92*f126890aSEmmanuel Vadot					wakeup-source;
93*f126890aSEmmanuel Vadot				};
94*f126890aSEmmanuel Vadot
95*f126890aSEmmanuel Vadot				touchscreen@4c {
96*f126890aSEmmanuel Vadot					compatible = "atmel,maxtouch";
97*f126890aSEmmanuel Vadot					reg = <0x4c>;
98*f126890aSEmmanuel Vadot					interrupt-parent = <&pioE>;
99*f126890aSEmmanuel Vadot					interrupts = <24 0x0>;
100*f126890aSEmmanuel Vadot					pinctrl-names = "default";
101*f126890aSEmmanuel Vadot					pinctrl-0 = <&pinctrl_mxt_ts>;
102*f126890aSEmmanuel Vadot				};
103*f126890aSEmmanuel Vadot			};
104*f126890aSEmmanuel Vadot
105*f126890aSEmmanuel Vadot			macb0: ethernet@f8020000 {
106*f126890aSEmmanuel Vadot				pinctrl-0 = <&pinctrl_macb0_rmii &pinctrl_macb0_phy_irq>;
107*f126890aSEmmanuel Vadot				phy-mode = "rmii";
108*f126890aSEmmanuel Vadot				status = "okay";
109*f126890aSEmmanuel Vadot
110*f126890aSEmmanuel Vadot				ethernet-phy@1 {
111*f126890aSEmmanuel Vadot					reg = <0x1>;
112*f126890aSEmmanuel Vadot					interrupt-parent = <&pioE>;
113*f126890aSEmmanuel Vadot					interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
114*f126890aSEmmanuel Vadot				};
115*f126890aSEmmanuel Vadot			};
116*f126890aSEmmanuel Vadot
117*f126890aSEmmanuel Vadot			mmc1: mmc@fc000000 {
118*f126890aSEmmanuel Vadot				pinctrl-names = "default";
119*f126890aSEmmanuel Vadot				pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
120*f126890aSEmmanuel Vadot				status = "okay";
121*f126890aSEmmanuel Vadot				slot@0 {
122*f126890aSEmmanuel Vadot					reg = <0>;
123*f126890aSEmmanuel Vadot					bus-width = <4>;
124*f126890aSEmmanuel Vadot					cd-gpios = <&pioE 6 0>;
125*f126890aSEmmanuel Vadot				};
126*f126890aSEmmanuel Vadot			};
127*f126890aSEmmanuel Vadot
128*f126890aSEmmanuel Vadot			usart2: serial@fc008000 {
129*f126890aSEmmanuel Vadot				status = "okay";
130*f126890aSEmmanuel Vadot			};
131*f126890aSEmmanuel Vadot
132*f126890aSEmmanuel Vadot			usart3: serial@fc00c000 {
133*f126890aSEmmanuel Vadot				status = "okay";
134*f126890aSEmmanuel Vadot			};
135*f126890aSEmmanuel Vadot
136*f126890aSEmmanuel Vadot			usart4: serial@fc010000 {
137*f126890aSEmmanuel Vadot				status = "okay";
138*f126890aSEmmanuel Vadot			};
139*f126890aSEmmanuel Vadot
140*f126890aSEmmanuel Vadot			tcb2: timer@fc024000 {
141*f126890aSEmmanuel Vadot				timer@0 {
142*f126890aSEmmanuel Vadot					compatible = "atmel,tcb-timer";
143*f126890aSEmmanuel Vadot					reg = <0>;
144*f126890aSEmmanuel Vadot				};
145*f126890aSEmmanuel Vadot
146*f126890aSEmmanuel Vadot				timer@1 {
147*f126890aSEmmanuel Vadot					compatible = "atmel,tcb-timer";
148*f126890aSEmmanuel Vadot					reg = <1>;
149*f126890aSEmmanuel Vadot				};
150*f126890aSEmmanuel Vadot			};
151*f126890aSEmmanuel Vadot
152*f126890aSEmmanuel Vadot			watchdog@fc068640 {
153*f126890aSEmmanuel Vadot				status = "okay";
154*f126890aSEmmanuel Vadot			};
155*f126890aSEmmanuel Vadot
156*f126890aSEmmanuel Vadot			pinctrl@fc06a000 {
157*f126890aSEmmanuel Vadot				board {
158*f126890aSEmmanuel Vadot					pinctrl_macb0_phy_irq: macb0_phy_irq {
159*f126890aSEmmanuel Vadot						atmel,pins =
160*f126890aSEmmanuel Vadot							<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
161*f126890aSEmmanuel Vadot					};
162*f126890aSEmmanuel Vadot					pinctrl_mmc0_cd: mmc0_cd {
163*f126890aSEmmanuel Vadot						atmel,pins =
164*f126890aSEmmanuel Vadot							<AT91_PIOE 5 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
165*f126890aSEmmanuel Vadot					};
166*f126890aSEmmanuel Vadot					pinctrl_mmc1_cd: mmc1_cd {
167*f126890aSEmmanuel Vadot						atmel,pins =
168*f126890aSEmmanuel Vadot							<AT91_PIOE 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
169*f126890aSEmmanuel Vadot					};
170*f126890aSEmmanuel Vadot					pinctrl_pck2_as_audio_mck: pck2_as_audio_mck {
171*f126890aSEmmanuel Vadot						atmel,pins =
172*f126890aSEmmanuel Vadot							<AT91_PIOB 10 AT91_PERIPH_B AT91_PINCTRL_NONE>;
173*f126890aSEmmanuel Vadot					};
174*f126890aSEmmanuel Vadot					pinctrl_usba_vbus: usba_vbus {
175*f126890aSEmmanuel Vadot						atmel,pins =
176*f126890aSEmmanuel Vadot							<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
177*f126890aSEmmanuel Vadot					};
178*f126890aSEmmanuel Vadot					pinctrl_key_gpio: key_gpio_0 {
179*f126890aSEmmanuel Vadot						atmel,pins =
180*f126890aSEmmanuel Vadot							<AT91_PIOE 13 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PE13 gpio */
181*f126890aSEmmanuel Vadot					};
182*f126890aSEmmanuel Vadot					pinctrl_qt1070_irq: qt1070_irq {
183*f126890aSEmmanuel Vadot						atmel,pins =
184*f126890aSEmmanuel Vadot							<AT91_PIOE 25 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
185*f126890aSEmmanuel Vadot					};
186*f126890aSEmmanuel Vadot					pinctrl_mxt_ts: mxt_irq {
187*f126890aSEmmanuel Vadot						atmel,pins =
188*f126890aSEmmanuel Vadot							<AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
189*f126890aSEmmanuel Vadot					};
190*f126890aSEmmanuel Vadot				};
191*f126890aSEmmanuel Vadot			};
192*f126890aSEmmanuel Vadot		};
193*f126890aSEmmanuel Vadot
194*f126890aSEmmanuel Vadot		usb0: gadget@400000 {
195*f126890aSEmmanuel Vadot			atmel,vbus-gpio = <&pioE 31 GPIO_ACTIVE_HIGH>;
196*f126890aSEmmanuel Vadot			pinctrl-names = "default";
197*f126890aSEmmanuel Vadot			pinctrl-0 = <&pinctrl_usba_vbus>;
198*f126890aSEmmanuel Vadot			status = "okay";
199*f126890aSEmmanuel Vadot		};
200*f126890aSEmmanuel Vadot
201*f126890aSEmmanuel Vadot		usb1: ohci@500000 {
202*f126890aSEmmanuel Vadot			num-ports = <3>;
203*f126890aSEmmanuel Vadot			atmel,vbus-gpio = <0 /* &pioE 10 GPIO_ACTIVE_LOW */
204*f126890aSEmmanuel Vadot					   &pioE 11 GPIO_ACTIVE_LOW
205*f126890aSEmmanuel Vadot					   &pioE 12 GPIO_ACTIVE_LOW
206*f126890aSEmmanuel Vadot					  >;
207*f126890aSEmmanuel Vadot			status = "okay";
208*f126890aSEmmanuel Vadot		};
209*f126890aSEmmanuel Vadot
210*f126890aSEmmanuel Vadot		usb2: ehci@600000 {
211*f126890aSEmmanuel Vadot			status = "okay";
212*f126890aSEmmanuel Vadot		};
213*f126890aSEmmanuel Vadot
214*f126890aSEmmanuel Vadot		ebi: ebi@10000000 {
215*f126890aSEmmanuel Vadot			pinctrl-0 = <&pinctrl_ebi_cs3 &pinctrl_ebi_nrd_nandoe
216*f126890aSEmmanuel Vadot				     &pinctrl_ebi_nwe_nandwe &pinctrl_ebi_nandrdy
217*f126890aSEmmanuel Vadot				     &pinctrl_ebi_data_0_7 &pinctrl_ebi_nand_addr>;
218*f126890aSEmmanuel Vadot			pinctrl-names = "default";
219*f126890aSEmmanuel Vadot			status = "okay";
220*f126890aSEmmanuel Vadot
221*f126890aSEmmanuel Vadot			nand_controller: nand-controller {
222*f126890aSEmmanuel Vadot				status = "okay";
223*f126890aSEmmanuel Vadot
224*f126890aSEmmanuel Vadot				nand@3 {
225*f126890aSEmmanuel Vadot					reg = <0x3 0x0 0x2>;
226*f126890aSEmmanuel Vadot					atmel,rb = <0>;
227*f126890aSEmmanuel Vadot					nand-bus-width = <8>;
228*f126890aSEmmanuel Vadot					nand-ecc-mode = "hw";
229*f126890aSEmmanuel Vadot					nand-on-flash-bbt;
230*f126890aSEmmanuel Vadot					label = "atmel_nand";
231*f126890aSEmmanuel Vadot
232*f126890aSEmmanuel Vadot					partitions {
233*f126890aSEmmanuel Vadot						compatible = "fixed-partitions";
234*f126890aSEmmanuel Vadot						#address-cells = <1>;
235*f126890aSEmmanuel Vadot						#size-cells = <1>;
236*f126890aSEmmanuel Vadot
237*f126890aSEmmanuel Vadot						at91bootstrap@0 {
238*f126890aSEmmanuel Vadot							label = "at91bootstrap";
239*f126890aSEmmanuel Vadot							reg = <0x0 0x40000>;
240*f126890aSEmmanuel Vadot						};
241*f126890aSEmmanuel Vadot
242*f126890aSEmmanuel Vadot						bootloader@40000 {
243*f126890aSEmmanuel Vadot							label = "bootloader";
244*f126890aSEmmanuel Vadot							reg = <0x40000 0x80000>;
245*f126890aSEmmanuel Vadot						};
246*f126890aSEmmanuel Vadot
247*f126890aSEmmanuel Vadot						bootloaderenv@c0000 {
248*f126890aSEmmanuel Vadot							label = "bootloader env";
249*f126890aSEmmanuel Vadot							reg = <0xc0000 0xc0000>;
250*f126890aSEmmanuel Vadot						};
251*f126890aSEmmanuel Vadot
252*f126890aSEmmanuel Vadot						dtb@180000 {
253*f126890aSEmmanuel Vadot							label = "device tree";
254*f126890aSEmmanuel Vadot							reg = <0x180000 0x80000>;
255*f126890aSEmmanuel Vadot						};
256*f126890aSEmmanuel Vadot
257*f126890aSEmmanuel Vadot						kernel@200000 {
258*f126890aSEmmanuel Vadot							label = "kernel";
259*f126890aSEmmanuel Vadot							reg = <0x200000 0x600000>;
260*f126890aSEmmanuel Vadot						};
261*f126890aSEmmanuel Vadot
262*f126890aSEmmanuel Vadot						rootfs@800000 {
263*f126890aSEmmanuel Vadot							label = "rootfs";
264*f126890aSEmmanuel Vadot							reg = <0x800000 0x0f800000>;
265*f126890aSEmmanuel Vadot						};
266*f126890aSEmmanuel Vadot					};
267*f126890aSEmmanuel Vadot				};
268*f126890aSEmmanuel Vadot			};
269*f126890aSEmmanuel Vadot		};
270*f126890aSEmmanuel Vadot	};
271*f126890aSEmmanuel Vadot
272*f126890aSEmmanuel Vadot	gpio-keys {
273*f126890aSEmmanuel Vadot		compatible = "gpio-keys";
274*f126890aSEmmanuel Vadot
275*f126890aSEmmanuel Vadot		pinctrl-names = "default";
276*f126890aSEmmanuel Vadot		pinctrl-0 = <&pinctrl_key_gpio>;
277*f126890aSEmmanuel Vadot
278*f126890aSEmmanuel Vadot		button {
279*f126890aSEmmanuel Vadot			label = "pb_user1";
280*f126890aSEmmanuel Vadot			gpios = <&pioE 13 GPIO_ACTIVE_HIGH>;
281*f126890aSEmmanuel Vadot			linux,code = <0x100>;
282*f126890aSEmmanuel Vadot			wakeup-source;
283*f126890aSEmmanuel Vadot		};
284*f126890aSEmmanuel Vadot	};
285*f126890aSEmmanuel Vadot
286*f126890aSEmmanuel Vadot	leds {
287*f126890aSEmmanuel Vadot		compatible = "gpio-leds";
288*f126890aSEmmanuel Vadot		status = "okay";
289*f126890aSEmmanuel Vadot
290*f126890aSEmmanuel Vadot		led-d8 {
291*f126890aSEmmanuel Vadot			label = "d8";
292*f126890aSEmmanuel Vadot			/* PE28, conflicts with usart4 rts pin */
293*f126890aSEmmanuel Vadot			gpios = <&pioE 28 GPIO_ACTIVE_LOW>;
294*f126890aSEmmanuel Vadot		};
295*f126890aSEmmanuel Vadot
296*f126890aSEmmanuel Vadot		led-d9 {
297*f126890aSEmmanuel Vadot			label = "d9";
298*f126890aSEmmanuel Vadot			gpios = <&pioE 9 GPIO_ACTIVE_HIGH>;
299*f126890aSEmmanuel Vadot		};
300*f126890aSEmmanuel Vadot
301*f126890aSEmmanuel Vadot		led-d10 {
302*f126890aSEmmanuel Vadot			label = "d10";
303*f126890aSEmmanuel Vadot			gpios = <&pioE 8 GPIO_ACTIVE_LOW>;
304*f126890aSEmmanuel Vadot			linux,default-trigger = "heartbeat";
305*f126890aSEmmanuel Vadot		};
306*f126890aSEmmanuel Vadot	};
307*f126890aSEmmanuel Vadot
308*f126890aSEmmanuel Vadot	sound {
309*f126890aSEmmanuel Vadot		compatible = "atmel,asoc-wm8904";
310*f126890aSEmmanuel Vadot		pinctrl-names = "default";
311*f126890aSEmmanuel Vadot		pinctrl-0 = <&pinctrl_pck2_as_audio_mck>;
312*f126890aSEmmanuel Vadot
313*f126890aSEmmanuel Vadot		atmel,model = "wm8904 @ SAMA5D4EK";
314*f126890aSEmmanuel Vadot		atmel,audio-routing =
315*f126890aSEmmanuel Vadot			"Headphone Jack", "HPOUTL",
316*f126890aSEmmanuel Vadot			"Headphone Jack", "HPOUTR",
317*f126890aSEmmanuel Vadot			"IN1L", "Line In Jack",
318*f126890aSEmmanuel Vadot			"IN1R", "Line In Jack";
319*f126890aSEmmanuel Vadot
320*f126890aSEmmanuel Vadot		atmel,ssc-controller = <&ssc0>;
321*f126890aSEmmanuel Vadot		atmel,audio-codec = <&wm8904>;
322*f126890aSEmmanuel Vadot	};
323*f126890aSEmmanuel Vadot};
324