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