1/*
2 * at91sam9rlek.dts - Device Tree file for Atmel at91sam9rl reference board
3 *
4 *  Copyright (C) 2014  Alexandre Belloni <alexandre.belloni@free-electrons.com>
5 *
6 * Licensed under GPLv2 only
7 */
8/dts-v1/;
9#include "at91sam9rl.dtsi"
10
11/ {
12	model = "Atmel at91sam9rlek";
13	compatible = "atmel,at91sam9rlek", "atmel,at91sam9rl", "atmel,at91sam9";
14
15	chosen {
16		bootargs = "console=ttyS0,115200 rootfstype=ubifs root=ubi0:rootfs ubi.mtd=5 rw";
17	};
18
19	memory {
20		reg = <0x20000000 0x4000000>;
21	};
22
23	clocks {
24		#address-cells = <1>;
25		#size-cells = <1>;
26		ranges;
27
28		main_clock: clock {
29			compatible = "atmel,osc", "fixed-clock";
30			clock-frequency = <12000000>;
31		};
32
33		slow_xtal {
34			clock-frequency = <32768>;
35		};
36
37		main_xtal {
38			clock-frequency = <12000000>;
39		};
40	};
41
42	ahb {
43		fb0: fb@00500000 {
44			display = <&display0>;
45			status = "okay";
46
47			display0: display {
48				bits-per-pixel = <16>;
49				atmel,lcdcon-backlight;
50				atmel,dmacon = <0x1>;
51				atmel,lcdcon2 = <0x80008002>;
52				atmel,guard-time = <1>;
53				atmel,lcd-wiring-mode = "RGB";
54
55				display-timings {
56					native-mode = <&timing0>;
57					timing0: timing0 {
58						clock-frequency = <4965000>;
59						hactive = <240>;
60						vactive = <320>;
61						hback-porch = <1>;
62						hfront-porch = <33>;
63						vback-porch = <1>;
64						vfront-porch = <0>;
65						hsync-len = <5>;
66						vsync-len = <1>;
67						hsync-active = <1>;
68						vsync-active = <1>;
69					};
70				};
71			};
72		};
73
74		nand0: nand@40000000 {
75			nand-bus-width = <8>;
76			nand-ecc-mode = "soft";
77			nand-on-flash-bbt = <1>;
78			status = "okay";
79
80			at91bootstrap@0 {
81				label = "at91bootstrap";
82				reg = <0x0 0x40000>;
83			};
84
85			bootloader@40000 {
86				label = "bootloader";
87				reg = <0x40000 0x80000>;
88			};
89
90			bootloaderenv@c0000 {
91				label = "bootloader env";
92				reg = <0xc0000 0xc0000>;
93			};
94
95			dtb@180000 {
96				label = "device tree";
97				reg = <0x180000 0x80000>;
98			};
99
100			kernel@200000 {
101				label = "kernel";
102				reg = <0x200000 0x600000>;
103			};
104
105			rootfs@800000 {
106				label = "rootfs";
107				reg = <0x800000 0x0f800000>;
108			};
109		};
110
111		apb {
112			mmc0: mmc@fffa4000 {
113				pinctrl-0 = <
114					&pinctrl_board_mmc0
115					&pinctrl_mmc0_clk
116					&pinctrl_mmc0_slot0_cmd_dat0
117					&pinctrl_mmc0_slot0_dat1_3>;
118				status = "okay";
119				slot@0 {
120					reg = <0>;
121					bus-width = <4>;
122					cd-gpios = <&pioA 15 GPIO_ACTIVE_HIGH>;
123				};
124			};
125
126			usart0: serial@fffb0000 {
127				pinctrl-0 = <
128					&pinctrl_usart0
129					&pinctrl_usart0_rts
130					&pinctrl_usart0_cts>;
131				status = "okay";
132			};
133
134			adc0: adc@fffd0000 {
135				pinctrl-names = "default";
136				pinctrl-0 = <
137					&pinctrl_adc0_ad0
138					&pinctrl_adc0_ad1
139					&pinctrl_adc0_ad2
140					&pinctrl_adc0_ad3
141					&pinctrl_adc0_ad4
142					&pinctrl_adc0_ad5
143					&pinctrl_adc0_adtrg>;
144				atmel,adc-ts-wires = <4>;
145				status = "okay";
146			};
147
148			usb0: gadget@fffd4000 {
149				atmel,vbus-gpio = <&pioA 8 GPIO_ACTIVE_HIGH>;
150				status = "okay";
151			};
152
153			spi0: spi@fffcc000 {
154				status = "okay";
155				cs-gpios = <&pioA 28 0>, <0>, <0>, <0>;
156				mtd_dataflash@0 {
157					compatible = "atmel,at45", "atmel,dataflash";
158					spi-max-frequency = <15000000>;
159					reg = <0>;
160				};
161			};
162
163			pwm0: pwm@fffc8000 {
164				status = "okay";
165
166				pinctrl-names = "default";
167				pinctrl-0 = <&pinctrl_pwm0_pwm1_2>,
168					<&pinctrl_pwm0_pwm2_2>;
169			};
170
171			dbgu: serial@fffff200 {
172				status = "okay";
173			};
174
175			pinctrl@fffff400 {
176				mmc0 {
177					pinctrl_board_mmc0: mmc0-board {
178						atmel,pins =
179							<AT91_PIOA 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
180					};
181				};
182			};
183
184			pmc: pmc@fffffc00 {
185				main: mainck {
186					clock-frequency = <12000000>;
187				};
188			};
189
190			watchdog@fffffd40 {
191				status = "okay";
192			};
193		};
194	};
195
196	pwmleds {
197		compatible = "pwm-leds";
198
199		ds1 {
200			label = "ds1";
201			pwms = <&pwm0 1 5000 PWM_POLARITY_INVERTED>;
202			max-brightness = <255>;
203		};
204
205		ds2 {
206			label = "ds2";
207			pwms = <&pwm0 2 5000 PWM_POLARITY_INVERTED>;
208			max-brightness = <255>;
209		};
210	};
211
212	leds {
213		compatible = "gpio-leds";
214
215		ds3 {
216			label = "ds3";
217			gpios = <&pioD 14 GPIO_ACTIVE_HIGH>;
218			linux,default-trigger = "heartbeat";
219		};
220	};
221
222	gpio_keys {
223		compatible = "gpio-keys";
224
225		right_click {
226			label = "right_click";
227			gpios = <&pioB 0 GPIO_ACTIVE_LOW>;
228			linux,code = <273>;
229			gpio-key,wakeup;
230		};
231
232		left_click {
233			label = "left_click";
234			gpios = <&pioB 1 GPIO_ACTIVE_LOW>;
235			linux,code = <272>;
236			gpio-key,wakeup;
237		};
238	};
239
240	i2c@0 {
241		status = "okay";
242	};
243
244	i2c@1 {
245		status = "okay";
246	};
247};
248