1/*
2 * sama5d3xmb_cmp.dts - Device Tree file for SAMA5D3x CMP mother board
3 *
4 *  Copyright (C) 2016 Atmel,
5 *
6 * Licensed under GPLv2 or later.
7 */
8#include "sama5d3xcm_cmp.dtsi"
9
10/ {
11	compatible = "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d3", "atmel,sama5";
12
13	chosen {
14		u-boot,dm-pre-reloc;
15		stdout-path = &dbgu;
16	};
17
18	ahb {
19		apb {
20			mmc0: mmc@f0000000 {
21				pinctrl-names = "default";
22				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>;
23				status = "okay";
24				slot@0 {
25					reg = <0>;
26					bus-width = <4>;
27					cd-gpios = <&pioD 17 GPIO_ACTIVE_HIGH>;
28				};
29			};
30
31			spi0: spi@f0004000 {
32				dmas = <0>, <0>;	/*  Do not use DMA for spi0 */
33
34				spi_flash@0 {
35					compatible = "spi-flash";
36					spi-max-frequency = <50000000>;
37					reg = <0>;
38				};
39			};
40
41			ssc0: ssc@f0008000 {
42				atmel,clk-from-rk-pin;
43			};
44
45			/*
46			 * i2c0 conflicts with ISI:
47			 * disable it to allow the use of ISI
48			 * can not enable audio when i2c0 disabled
49			 */
50			i2c0: i2c@f0014000 {
51				wm8904: wm8904@1a {
52					compatible = "wlf,wm8904";
53					reg = <0x1a>;
54					clocks = <&pck0>;
55					clock-names = "mclk";
56				};
57			};
58
59			i2c1: i2c@f0018000 {
60				ov2640: camera@0x30 {
61					compatible = "ovti,ov2640";
62					reg = <0x30>;
63					pinctrl-names = "default";
64					pinctrl-0 = <&pinctrl_pck1_as_isi_mck &pinctrl_sensor_power &pinctrl_sensor_reset>;
65					resetb-gpios = <&pioE 24 GPIO_ACTIVE_LOW>;
66					pwdn-gpios = <&pioE 29 GPIO_ACTIVE_HIGH>;
67					/* use pck1 for the master clock of ov2640 */
68					clocks = <&pck1>;
69					clock-names = "xvclk";
70					assigned-clocks = <&pck1>;
71					assigned-clock-rates = <25000000>;
72
73					port {
74						ov2640_0: endpoint {
75							remote-endpoint = <&isi_0>;
76							bus-width = <8>;
77						};
78					};
79				};
80			};
81
82			usart1: serial@f0020000 {
83				dmas = <0>, <0>;	/*  Do not use DMA for usart1 */
84				pinctrl-names = "default";
85				pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
86				status = "okay";
87			};
88
89			isi: isi@f0034000 {
90				port {
91					isi_0: endpoint {
92						remote-endpoint = <&ov2640_0>;
93						bus-width = <8>;
94						vsync-active = <1>;
95						hsync-active = <1>;
96					};
97				};
98			};
99
100			mmc1: mmc@f8000000 {
101				pinctrl-names = "default";
102				pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
103				status = "okay";
104				slot@0 {
105					reg = <0>;
106					bus-width = <4>;
107					cd-gpios = <&pioD 18 GPIO_ACTIVE_HIGH>;
108				};
109			};
110
111			adc0: adc@f8018000 {
112				pinctrl-names = "default";
113				pinctrl-0 = <
114					&pinctrl_adc0_adtrg
115					&pinctrl_adc0_ad0
116					&pinctrl_adc0_ad1
117					&pinctrl_adc0_ad2
118					&pinctrl_adc0_ad3
119					&pinctrl_adc0_ad4
120					>;
121				status = "okay";
122			};
123
124			macb1: ethernet@f802c000 {
125				phy-mode = "rmii";
126
127				#address-cells = <1>;
128				#size-cells = <0>;
129				phy0: ethernet-phy@1 {
130					/*interrupt-parent = <&pioE>;*/
131					/*interrupts = <30 IRQ_TYPE_EDGE_FALLING>;*/
132					reg = <1>;
133				};
134			};
135
136			pinctrl@fffff200 {
137				board {
138					pinctrl_gpio_keys: gpio_keys {
139						atmel,pins =
140							<AT91_PIOE 27 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
141					};
142
143					pinctrl_mmc0_cd: mmc0_cd {
144						atmel,pins =
145							<AT91_PIOD 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PD17 GPIO with pullup deglitch */
146					};
147
148					pinctrl_mmc1_cd: mmc1_cd {
149						atmel,pins =
150							<AT91_PIOD 18 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PD18 GPIO with pullup deglitch */
151					};
152
153					pinctrl_pck0_as_audio_mck: pck0_as_audio_mck {
154						atmel,pins =
155							<AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PD30 periph B */
156					};
157
158					pinctrl_pck1_as_isi_mck: pck1_as_isi_mck-0 {
159						atmel,pins =
160							<AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>;	/* PD31 periph B ISI_MCK */
161					};
162
163					pinctrl_sensor_reset: sensor_reset-0 {
164						atmel,pins =
165							<AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;   /* PE24 gpio */
166					};
167
168					pinctrl_sensor_power: sensor_power-0 {
169						atmel,pins =
170							<AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE29 gpio */
171					};
172
173					pinctrl_usba_vbus: usba_vbus {
174						atmel,pins =
175							<AT91_PIOD 29 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PD29 GPIO with deglitch */
176					};
177				};
178			};
179
180			dbgu: serial@ffffee00 {
181				dmas = <0>, <0>;	/*  Do not use DMA for dbgu */
182				status = "okay";
183				u-boot,dm-pre-reloc;
184			};
185
186			watchdog@fffffe40 {
187				status = "okay";
188			};
189		};
190
191		usb0: gadget@00500000 {
192			atmel,vbus-gpio = <&pioD 29 GPIO_ACTIVE_HIGH>;
193			pinctrl-names = "default";
194			pinctrl-0 = <&pinctrl_usba_vbus>;
195			status = "okay";
196		};
197	};
198
199	sound {
200		compatible = "atmel,asoc-wm8904";
201		pinctrl-names = "default";
202		pinctrl-0 = <&pinctrl_pck0_as_audio_mck>;
203
204		atmel,model = "wm8904 @ SAMA5D3EK";
205		atmel,audio-routing =
206			"Headphone Jack", "HPOUTL",
207			"Headphone Jack", "HPOUTR",
208			"IN2L", "Line In Jack",
209			"IN2R", "Line In Jack",
210			"Mic", "MICBIAS",
211			"IN1L", "Mic";
212
213		atmel,ssc-controller = <&ssc0>;
214		atmel,audio-codec = <&wm8904>;
215
216		status = "disabled";
217	};
218
219	/* Conflict with LCD pins */
220	gpio_keys {
221		compatible = "gpio-keys";
222		status = "okay";
223
224		#address-cells = <1>;
225		#size-cells = <0>;
226		pinctrl-names = "default";
227		pinctrl-0 = <&pinctrl_gpio_keys>;
228
229		pb_user1 {
230			label = "pb_user1";
231			gpios = <&pioE 27 GPIO_ACTIVE_HIGH>;
232			linux,code = <0x100>;
233			gpio-key,wakeup;
234		};
235	};
236};
237