1/*
2 * at91sam9n12ek.dts - Device Tree file for AT91SAM9N12-EK board
3 *
4 *  Copyright (C) 2012 Atmel,
5 *                2012 Hong Xu <hong.xu@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9/dts-v1/;
10#include "at91sam9n12.dtsi"
11
12/ {
13	model = "Atmel AT91SAM9N12-EK";
14	compatible = "atmel,at91sam9n12ek", "atmel,at91sam9n12", "atmel,at91sam9";
15
16	chosen {
17		bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
18	};
19
20	memory {
21		reg = <0x20000000 0x8000000>;
22	};
23
24	clocks {
25		#address-cells = <1>;
26		#size-cells = <1>;
27		ranges;
28
29		main_clock: clock@0 {
30			compatible = "atmel,osc", "fixed-clock";
31			clock-frequency = <16000000>;
32		};
33
34		slow_xtal {
35			clock-frequency = <32768>;
36		};
37
38		main_xtal {
39			clock-frequency = <16000000>;
40		};
41	};
42
43	ahb {
44		apb {
45			dbgu: serial@fffff200 {
46				status = "okay";
47			};
48
49			ssc0: ssc@f0010000 {
50				status = "okay";
51			};
52
53			i2c0: i2c@f8010000 {
54				status = "okay";
55
56				wm8904: codec@1a {
57					compatible = "wlf,wm8904";
58					reg = <0x1a>;
59					clocks = <&pck0>;
60					clock-names = "mclk";
61				};
62
63				qt1070: keyboard@1b {
64					compatible = "qt1070";
65					reg = <0x1b>;
66					interrupt-parent = <&pioA>;
67					interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
68					pinctrl-names = "default";
69					pinctrl-0 = <&pinctrl_qt1070_irq>;
70				};
71			};
72
73			i2c1: i2c@f8014000 {
74				status = "okay";
75			};
76
77			mmc0: mmc@f0008000 {
78				pinctrl-0 = <
79					&pinctrl_board_mmc0
80					&pinctrl_mmc0_slot0_clk_cmd_dat0
81					&pinctrl_mmc0_slot0_dat1_3>;
82				status = "okay";
83				slot@0 {
84					reg = <0>;
85					bus-width = <4>;
86					cd-gpios = <&pioA 7 GPIO_ACTIVE_HIGH>;
87				};
88			};
89
90			pinctrl@fffff400 {
91				mmc0 {
92					pinctrl_board_mmc0: mmc0-board {
93						atmel,pins =
94							<AT91_PIOA 7 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PA7 gpio CD pin pull up and deglitch */
95					};
96				};
97
98				qt1070 {
99					pinctrl_qt1070_irq: qt1070_irq {
100						atmel,pins =
101							<AT91_PIOA 2 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
102					};
103				};
104
105				sound {
106					pinctrl_pck0_as_audio_mck: pck0_as_audio_mck {
107						atmel,pins =
108							<AT91_PIOB 10 AT91_PERIPH_B AT91_PINCTRL_NONE>;
109					};
110				};
111			};
112
113			spi0: spi@f0000000 {
114				status = "okay";
115				cs-gpios = <&pioA 14 0>, <0>, <0>, <0>;
116				m25p80@0 {
117					compatible = "atmel,at25df321a";
118					spi-max-frequency = <50000000>;
119					reg = <0>;
120				};
121			};
122
123			watchdog@fffffe40 {
124				status = "okay";
125			};
126		};
127
128		nand0: nand@40000000 {
129			nand-bus-width = <8>;
130			nand-ecc-mode = "hw";
131			atmel,has-pmecc;
132			atmel,pmecc-cap = <2>;
133			atmel,pmecc-sector-size = <512>;
134			nand-on-flash-bbt;
135			status = "okay";
136		};
137
138		usb0: ohci@00500000 {
139			num-ports = <1>;
140			atmel,vbus-gpio = <&pioB 7 GPIO_ACTIVE_LOW>;
141			status = "okay";
142		};
143	};
144
145	leds {
146		compatible = "gpio-leds";
147
148		d8 {
149			label = "d8";
150			gpios = <&pioB 4 GPIO_ACTIVE_LOW>;
151			linux,default-trigger = "mmc0";
152		};
153
154		d9 {
155			label = "d6";
156			gpios = <&pioB 5 GPIO_ACTIVE_LOW>;
157			linux,default-trigger = "nand-disk";
158		};
159
160		d10 {
161			label = "d7";
162			gpios = <&pioB 6 GPIO_ACTIVE_HIGH>;
163			linux,default-trigger = "heartbeat";
164		};
165	};
166
167	gpio_keys {
168		compatible = "gpio-keys";
169
170		enter {
171			label = "Enter";
172			gpios = <&pioB 3 GPIO_ACTIVE_LOW>;
173			linux,code = <28>;
174			gpio-key,wakeup;
175		};
176	};
177
178	sound {
179		compatible = "atmel,asoc-wm8904";
180		pinctrl-names = "default";
181		pinctrl-0 = <&pinctrl_pck0_as_audio_mck>;
182
183		atmel,model = "wm8904 @ AT91SAM9N12";
184		atmel,audio-routing =
185			"Headphone Jack", "HPOUTL",
186			"Headphone Jack", "HPOUTR",
187			"IN2L", "Line In Jack",
188			"IN2R", "Line In Jack",
189			"Mic", "MICBIAS",
190			"IN1L", "Mic";
191
192		atmel,ssc-controller = <&ssc0>;
193		atmel,audio-codec = <&wm8904>;
194	};
195};
196