1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * at91sam9g20ek_common.dtsi - Device Tree file for Atmel at91sam9g20ek board
4 *
5 * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
6 */
7#include "at91sam9g20.dtsi"
8#include <dt-bindings/input/input.h>
9
10/ {
11
12	chosen {
13		bootargs = "mem=64M root=/dev/mtdblock5 rw rootfstype=ubifs";
14		stdout-path = "serial0:115200n8";
15	};
16
17	memory@20000000 {
18		reg = <0x20000000 0x4000000>;
19	};
20
21	clocks {
22		slow_xtal {
23			clock-frequency = <32768>;
24		};
25
26		main_xtal {
27			clock-frequency = <18432000>;
28		};
29	};
30
31	ahb {
32		apb {
33			pinctrl@fffff400 {
34				board {
35					pinctrl_pck0_as_mck: pck0_as_mck {
36						atmel,pins =
37							<AT91_PIOC 1 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PC1 periph B */
38					};
39
40				};
41
42				mmc0_slot1 {
43					pinctrl_board_mmc0_slot1: mmc0_slot1-board {
44						atmel,pins =
45							<AT91_PIOC 9 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;	/* PC9 gpio CD pin pull up and deglitch */
46					};
47				};
48			};
49
50			dbgu: serial@fffff200 {
51				status = "okay";
52			};
53
54			tcb0: timer@fffa0000 {
55				timer@0 {
56					compatible = "atmel,tcb-timer";
57					reg = <0>, <1>;
58				};
59
60				timer@2 {
61					compatible = "atmel,tcb-timer";
62					reg = <2>;
63				};
64			};
65
66			usart0: serial@fffb0000 {
67				pinctrl-0 =
68					<&pinctrl_usart0
69					 &pinctrl_usart0_rts
70					 &pinctrl_usart0_cts
71					 &pinctrl_usart0_dtr_dsr
72					 &pinctrl_usart0_dcd
73					 &pinctrl_usart0_ri>;
74				status = "okay";
75			};
76
77			usart1: serial@fffb4000 {
78				status = "okay";
79			};
80
81			macb0: ethernet@fffc4000 {
82				phy-mode = "rmii";
83				status = "okay";
84			};
85
86			usb1: gadget@fffa4000 {
87				atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>;
88				status = "okay";
89			};
90
91			mmc0: mmc@fffa8000 {
92				pinctrl-0 = <
93					&pinctrl_board_mmc0_slot1
94					&pinctrl_mmc0_clk
95					&pinctrl_mmc0_slot1_cmd_dat0
96					&pinctrl_mmc0_slot1_dat1_3>;
97				pinctrl-names = "default";
98				status = "okay";
99				slot@1 {
100					reg = <1>;
101					bus-width = <4>;
102					cd-gpios = <&pioC 9 GPIO_ACTIVE_HIGH>;
103				};
104			};
105
106			ssc0: ssc@fffbc000 {
107				status = "okay";
108				pinctrl-0 = <&pinctrl_ssc0_tx>;
109			};
110
111			spi0: spi@fffc8000 {
112				cs-gpios = <0>, <&pioC 11 0>, <0>, <0>;
113				mtd_dataflash@1 {
114					compatible = "atmel,at45", "atmel,dataflash";
115					spi-max-frequency = <50000000>;
116					reg = <1>;
117				};
118			};
119
120			shdwc@fffffd10 {
121				atmel,wakeup-counter = <10>;
122				atmel,wakeup-rtt-timer;
123			};
124
125			rtc@fffffd20 {
126				atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
127				status = "okay";
128			};
129
130			watchdog@fffffd40 {
131				status = "okay";
132			};
133
134			gpbr: syscon@fffffd50 {
135				status = "okay";
136			};
137		};
138
139		ebi: ebi@10000000 {
140			status = "okay";
141
142			nand_controller: nand-controller {
143				status = "okay";
144				pinctrl-0 = <&pinctrl_nand_cs &pinctrl_nand_rb>;
145				pinctrl-names = "default";
146
147				nand@3 {
148					reg = <0x3 0x0 0x800000>;
149					rb-gpios = <&pioC 13 GPIO_ACTIVE_HIGH>;
150					cs-gpios = <&pioC 14 GPIO_ACTIVE_HIGH>;
151					nand-bus-width = <8>;
152					nand-ecc-mode = "soft";
153					nand-on-flash-bbt;
154					label = "atmel_nand";
155
156					partitions {
157						compatible = "fixed-partitions";
158						#address-cells = <1>;
159						#size-cells = <1>;
160
161						at91bootstrap@0 {
162							label = "at91bootstrap";
163							reg = <0x0 0x20000>;
164						};
165
166						barebox@20000 {
167							label = "barebox";
168							reg = <0x20000 0x40000>;
169						};
170
171						bareboxenv@60000 {
172							label = "bareboxenv";
173							reg = <0x60000 0x20000>;
174						};
175
176						bareboxenv2@80000 {
177							label = "bareboxenv2";
178							reg = <0x80000 0x20000>;
179						};
180
181						oftree@80000 {
182							label = "oftree";
183							reg = <0xa0000 0x20000>;
184						};
185
186						kernel@a0000 {
187							label = "kernel";
188							reg = <0xc0000 0x400000>;
189						};
190
191						rootfs@4a0000 {
192							label = "rootfs";
193							reg = <0x4c0000 0x7800000>;
194						};
195
196						data@7ca0000 {
197							label = "data";
198							reg = <0x7cc0000 0x8340000>;
199						};
200					};
201				};
202			};
203		};
204
205		usb0: ohci@500000 {
206			num-ports = <2>;
207			status = "okay";
208		};
209	};
210
211	i2c-gpio-0 {
212		status = "okay";
213
214		24c512@50 {
215			compatible = "atmel,24c512";
216			reg = <0x50>;
217		};
218
219		wm8731: wm8731@1b {
220			compatible = "wm8731";
221			reg = <0x1b>;
222		};
223	};
224
225	gpio_keys {
226		compatible = "gpio-keys";
227
228		btn3 {
229			label = "Button 3";
230			gpios = <&pioA 30 GPIO_ACTIVE_LOW>;
231			linux,code = <0x103>;
232			wakeup-source;
233		};
234
235		btn4 {
236			label = "Button 4";
237			gpios = <&pioA 31 GPIO_ACTIVE_LOW>;
238			linux,code = <KEY_PROG1>;
239			wakeup-source;
240		};
241	};
242
243	sound {
244		compatible = "atmel,at91sam9g20ek-wm8731-audio";
245		pinctrl-names = "default";
246		pinctrl-0 = <&pinctrl_pck0_as_mck>;
247
248		atmel,model = "wm8731 @ AT91SAMG20EK";
249
250		atmel,audio-routing =
251			"Ext Spk", "LHPOUT",
252			"Int Mic", "MICIN";
253
254		atmel,ssc-controller = <&ssc0>;
255		atmel,audio-codec = <&wm8731>;
256	};
257};
258