1/*
2 * at91sam9m10g45ek.dts - Device Tree file for AT91SAM9M10G45-EK board
3 *
4 *  Copyright (C) 2011 Atmel,
5 *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9/dts-v1/;
10#include "at91sam9g45.dtsi"
11#include <dt-bindings/pwm/pwm.h>
12
13/ {
14	model = "Atmel AT91SAM9M10G45-EK";
15	compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9";
16
17	chosen {
18		bootargs = "mem=64M root=/dev/mtdblock1 rw rootfstype=jffs2";
19		stdout-path = "serial0:115200n8";
20		u-boot,dm-pre-reloc;
21	};
22
23	memory {
24		reg = <0x70000000 0x4000000>;
25	};
26
27	clocks {
28		slow_xtal {
29		      clock-frequency = <32768>;
30		};
31
32		main_xtal {
33		      clock-frequency = <12000000>;
34		};
35	};
36
37	ahb {
38		apb {
39			dbgu: serial@ffffee00 {
40				status = "okay";
41				u-boot,dm-pre-reloc;
42			};
43
44			usart1: serial@fff90000 {
45				pinctrl-0 =
46					<&pinctrl_usart1
47					 &pinctrl_usart1_rts
48					 &pinctrl_usart1_cts>;
49				status = "okay";
50			};
51
52			macb0: ethernet@fffbc000 {
53				phy-mode = "rmii";
54				status = "okay";
55			};
56
57			i2c0: i2c@fff84000 {
58				status = "okay";
59				ov2640: camera@30 {
60					compatible = "ovti,ov2640";
61					reg = <0x30>;
62					pinctrl-names = "default";
63					pinctrl-0 = <&pinctrl_pck1_as_isi_mck &pinctrl_sensor_power &pinctrl_sensor_reset>;
64					resetb-gpios = <&pioD 12 GPIO_ACTIVE_LOW>;
65					pwdn-gpios = <&pioD 13 GPIO_ACTIVE_HIGH>;
66					clocks = <&pck1>;
67					clock-names = "xvclk";
68					assigned-clocks = <&pck1>;
69					assigned-clock-rates = <25000000>;
70
71					port {
72						ov2640_0: endpoint {
73							remote-endpoint = <&isi_0>;
74							bus-width = <8>;
75						};
76					};
77				};
78			};
79
80			i2c1: i2c@fff88000 {
81				status = "okay";
82			};
83
84			watchdog@fffffd40 {
85				status = "okay";
86			};
87
88			mmc0: mmc@fff80000 {
89				pinctrl-0 = <
90					&pinctrl_board_mmc0
91					&pinctrl_mmc0_slot0_clk_cmd_dat0
92					&pinctrl_mmc0_slot0_dat1_3>;
93				status = "okay";
94				slot@0 {
95					reg = <0>;
96					bus-width = <4>;
97					cd-gpios = <&pioD 10 GPIO_ACTIVE_HIGH>;
98				};
99			};
100
101			mmc1: mmc@fffd0000 {
102				pinctrl-0 = <
103					&pinctrl_board_mmc1
104					&pinctrl_mmc1_slot0_clk_cmd_dat0
105					&pinctrl_mmc1_slot0_dat1_3>;
106				status = "okay";
107				slot@0 {
108					reg = <0>;
109					bus-width = <4>;
110					cd-gpios = <&pioD 11 GPIO_ACTIVE_HIGH>;
111					wp-gpios = <&pioD 29 GPIO_ACTIVE_HIGH>;
112				};
113			};
114
115			pinctrl@fffff200 {
116				camera_sensor {
117					pinctrl_pck1_as_isi_mck: pck1_as_isi_mck-0 {
118						atmel,pins =
119							<AT91_PIOB 31 AT91_PERIPH_B AT91_PINCTRL_NONE>;
120					};
121
122					pinctrl_sensor_reset: sensor_reset-0 {
123						atmel,pins =
124							<AT91_PIOD 12 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
125					};
126
127					pinctrl_sensor_power: sensor_power-0 {
128						atmel,pins =
129							<AT91_PIOD 13 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
130					};
131				};
132				mmc0 {
133					pinctrl_board_mmc0: mmc0-board {
134						atmel,pins =
135							<AT91_PIOD 10 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PD10 gpio CD pin pull up and deglitch */
136					};
137				};
138
139				mmc1 {
140					pinctrl_board_mmc1: mmc1-board {
141						atmel,pins =
142							<AT91_PIOD 11 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH	/* PD11 gpio CD pin pull up and deglitch */
143							 AT91_PIOD 29 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;	/* PD29 gpio WP pin pull up */
144					};
145				};
146
147				pwm0 {
148					pinctrl_pwm_leds: pwm-led {
149						atmel,pins =
150							<AT91_PIOD 0  AT91_PERIPH_B AT91_PINCTRL_PULL_UP	/* PD0 periph B */
151							 AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;	/* PD31 periph B */
152					};
153				};
154			};
155
156			spi0: spi@fffa4000{
157				status = "okay";
158				cs-gpios = <&pioB 3 0>, <0>, <0>, <0>;
159				mtd_dataflash@0 {
160					compatible = "atmel,at45", "atmel,dataflash";
161					spi-max-frequency = <13000000>;
162					reg = <0>;
163				};
164			};
165
166			usb2: gadget@fff78000 {
167				atmel,vbus-gpio = <&pioB 19 GPIO_ACTIVE_HIGH>;
168				status = "okay";
169			};
170
171			adc0: adc@fffb0000 {
172				pinctrl-names = "default";
173				pinctrl-0 = <
174					&pinctrl_adc0_ad0
175					&pinctrl_adc0_ad1
176					&pinctrl_adc0_ad2
177					&pinctrl_adc0_ad3
178					&pinctrl_adc0_ad4
179					&pinctrl_adc0_ad5
180					&pinctrl_adc0_ad6
181					&pinctrl_adc0_ad7>;
182				atmel,adc-ts-wires = <4>;
183				status = "okay";
184			};
185
186			isi@fffb4000 {
187				pinctrl-names = "default";
188				pinctrl-0 = <&pinctrl_isi_data_0_7>;
189				status = "okay";
190				port {
191					isi_0: endpoint {
192						remote-endpoint = <&ov2640_0>;
193						bus-width = <8>;
194						vsync-active = <1>;
195						hsync-active = <1>;
196					};
197				};
198			};
199
200			pwm0: pwm@fffb8000 {
201				status = "okay";
202
203				pinctrl-names = "default";
204				pinctrl-0 = <&pinctrl_pwm_leds>;
205			};
206
207			rtc@fffffd20 {
208				atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
209				status = "okay";
210			};
211
212			gpbr: syscon@fffffd60 {
213				status = "okay";
214			};
215
216			rtc@fffffdb0 {
217				status = "okay";
218			};
219		};
220
221		fb0: fb@0x00500000 {
222			display = <&display0>;
223			status = "okay";
224
225			display0: display {
226				bits-per-pixel = <32>;
227				atmel,lcdcon-backlight;
228				atmel,dmacon = <0x1>;
229				atmel,lcdcon2 = <0x80008002>;
230				atmel,guard-time = <9>;
231				atmel,lcd-wiring-mode = "RGB";
232
233				display-timings {
234					native-mode = <&timing0>;
235					timing0: timing0 {
236						clock-frequency = <9000000>;
237						hactive = <480>;
238						vactive = <272>;
239						hback-porch = <1>;
240						hfront-porch = <1>;
241						vback-porch = <40>;
242						vfront-porch = <1>;
243						hsync-len = <45>;
244						vsync-len = <1>;
245					};
246				};
247			};
248		};
249
250		nand0: nand@40000000 {
251			nand-bus-width = <8>;
252			nand-ecc-mode = "soft";
253			nand-on-flash-bbt;
254			status = "okay";
255
256			boot@0 {
257				label = "bootstrap/uboot/kernel";
258				reg = <0x0 0x400000>;
259			};
260
261			rootfs@400000 {
262				label = "rootfs";
263				reg = <0x400000 0x3C00000>;
264			};
265
266			data@4000000 {
267				label = "data";
268				reg = <0x4000000 0xC000000>;
269			};
270		};
271
272		usb0: ohci@00700000 {
273			status = "okay";
274			num-ports = <2>;
275			atmel,vbus-gpio = <&pioD 1 GPIO_ACTIVE_LOW
276					   &pioD 3 GPIO_ACTIVE_LOW>;
277		};
278
279		usb1: ehci@00800000 {
280			status = "okay";
281		};
282	};
283
284	leds {
285		compatible = "gpio-leds";
286
287		d8 {
288			label = "d8";
289			gpios = <&pioD 30 GPIO_ACTIVE_HIGH>;
290			linux,default-trigger = "heartbeat";
291		};
292	};
293
294	pwmleds {
295		compatible = "pwm-leds";
296
297		d6 {
298			label = "d6";
299			pwms = <&pwm0 3 5000 PWM_POLARITY_INVERTED>;
300			max-brightness = <255>;
301			linux,default-trigger = "nand-disk";
302		};
303
304		d7 {
305			label = "d7";
306			pwms = <&pwm0 1 5000 PWM_POLARITY_INVERTED>;
307			max-brightness = <255>;
308			linux,default-trigger = "mmc0";
309		};
310	};
311
312	gpio_keys {
313		compatible = "gpio-keys";
314
315		left_click {
316			label = "left_click";
317			gpios = <&pioB 6 GPIO_ACTIVE_LOW>;
318			linux,code = <272>;
319			wakeup-source;
320		};
321
322		right_click {
323			label = "right_click";
324			gpios = <&pioB 7 GPIO_ACTIVE_LOW>;
325			linux,code = <273>;
326			wakeup-source;
327		};
328
329		left {
330			label = "Joystick Left";
331			gpios = <&pioB 14 GPIO_ACTIVE_LOW>;
332			linux,code = <105>;
333		};
334
335		right {
336			label = "Joystick Right";
337			gpios = <&pioB 15 GPIO_ACTIVE_LOW>;
338			linux,code = <106>;
339		};
340
341		up {
342			label = "Joystick Up";
343			gpios = <&pioB 16 GPIO_ACTIVE_LOW>;
344			linux,code = <103>;
345		};
346
347		down {
348			label = "Joystick Down";
349			gpios = <&pioB 17 GPIO_ACTIVE_LOW>;
350			linux,code = <108>;
351		};
352
353		enter {
354			label = "Joystick Press";
355			gpios = <&pioB 18 GPIO_ACTIVE_LOW>;
356			linux,code = <28>;
357		};
358	};
359};
360