1/*
2 * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@gmail.com>
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 *  a) This file is free software; you can redistribute it and/or
10 *     modify it under the terms of the GNU General Public License as
11 *     published by the Free Software Foundation; either version 2 of the
12 *     License, or (at your option) any later version.
13 *
14 *     This file is distributed in the hope that it will be useful,
15 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *     GNU General Public License for more details.
18 *
19 *     You should have received a copy of the GNU General Public
20 *     License along with this file; if not, write to the Free
21 *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22 *     MA 02110-1301 USA
23 *
24 * Or, alternatively,
25 *
26 *  b) Permission is hereby granted, free of charge, to any person
27 *     obtaining a copy of this software and associated documentation
28 *     files (the "Software"), to deal in the Software without
29 *     restriction, including without limitation the rights to use,
30 *     copy, modify, merge, publish, distribute, sublicense, and/or
31 *     sell copies of the Software, and to permit persons to whom the
32 *     Software is furnished to do so, subject to the following
33 *     conditions:
34 *
35 *     The above copyright notice and this permission notice shall be
36 *     included in all copies or substantial portions of the Software.
37 *
38 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45 *     OTHER DEALINGS IN THE SOFTWARE.
46 */
47
48/dts-v1/;
49#include "stm32f429.dtsi"
50#include "stm32f429-pinctrl.dtsi"
51#include <dt-bindings/input/input.h>
52#include <dt-bindings/gpio/gpio.h>
53#include <dt-bindings/media/video-interfaces.h>
54
55/ {
56	model = "STMicroelectronics STM32429i-EVAL board";
57	compatible = "st,stm32429i-eval", "st,stm32f429";
58
59	chosen {
60		bootargs = "root=/dev/ram";
61		stdout-path = "serial0:115200n8";
62	};
63
64	memory@0 {
65		device_type = "memory";
66		reg = <0x00000000 0x2000000>;
67	};
68
69	aliases {
70		serial0 = &usart1;
71	};
72
73	clocks {
74		clk_ext_camera: clk-ext-camera {
75			#clock-cells = <0>;
76			compatible = "fixed-clock";
77			clock-frequency = <24000000>;
78		};
79	};
80
81	soc {
82		dma-ranges = <0xc0000000 0x0 0x10000000>;
83	};
84
85	vdda: regulator-vdda {
86		compatible = "regulator-fixed";
87		regulator-name = "vdda";
88		regulator-min-microvolt = <3300000>;
89		regulator-max-microvolt = <3300000>;
90	};
91
92	vref: regulator-vref {
93		compatible = "regulator-fixed";
94		regulator-name = "vref";
95		regulator-min-microvolt = <3300000>;
96		regulator-max-microvolt = <3300000>;
97	};
98
99	vdd_panel: vdd-panel {
100		compatible = "regulator-fixed";
101		regulator-name = "vdd_panel";
102		regulator-min-microvolt = <3300000>;
103		regulator-max-microvolt = <3300000>;
104	};
105
106	leds {
107		compatible = "gpio-leds";
108		led-green {
109			gpios = <&gpiog 6 1>;
110			linux,default-trigger = "heartbeat";
111		};
112		led-orange {
113			gpios = <&gpiog 7 1>;
114		};
115		led-red {
116			gpios = <&gpiog 10 1>;
117		};
118		led-blue {
119			gpios = <&gpiog 12 1>;
120		};
121	};
122
123	gpio-keys {
124		compatible = "gpio-keys";
125		autorepeat;
126		button-0 {
127			label = "Wake up";
128			linux,code = <KEY_WAKEUP>;
129			gpios = <&gpioa 0 0>;
130		};
131		button-1 {
132			label = "Tamper";
133			linux,code = <KEY_RESTART>;
134			gpios = <&gpioc 13 0>;
135		};
136	};
137
138	usbotg_hs_phy: usbphy {
139		#phy-cells = <0>;
140		compatible = "usb-nop-xceiv";
141		clocks = <&rcc 0 STM32F4_AHB1_CLOCK(OTGHSULPI)>;
142		clock-names = "main_clk";
143	};
144
145	panel_rgb: panel-rgb {
146		compatible = "ampire,am-480272h3tmqw-t01h";
147		power-supply = <&vdd_panel>;
148		status = "okay";
149		port {
150			panel_in_rgb: endpoint {
151				remote-endpoint = <&ltdc_out_rgb>;
152			};
153		};
154	};
155
156	mmc_vcard: mmc_vcard {
157		compatible = "regulator-fixed";
158		regulator-name = "mmc_vcard";
159		regulator-min-microvolt = <3300000>;
160		regulator-max-microvolt = <3300000>;
161	};
162};
163
164&adc {
165	pinctrl-names = "default";
166	pinctrl-0 = <&adc3_in8_pin>;
167	vdda-supply = <&vdda>;
168	vref-supply = <&vref>;
169	status = "okay";
170	adc3: adc@200 {
171		st,adc-channels = <8>;
172		status = "okay";
173	};
174};
175
176&clk_hse {
177	clock-frequency = <25000000>;
178};
179
180&crc {
181	status = "okay";
182};
183
184&dcmi {
185	status = "okay";
186
187	port {
188		dcmi_0: endpoint {
189			remote-endpoint = <&ov2640_0>;
190			bus-type = <MEDIA_BUS_TYPE_PARALLEL>;
191			bus-width = <8>;
192			hsync-active = <0>;
193			vsync-active = <0>;
194			pclk-sample = <1>;
195		};
196	};
197};
198
199&i2c1 {
200	pinctrl-0 = <&i2c1_pins>;
201	pinctrl-names = "default";
202	status = "okay";
203
204	ov2640: camera@30 {
205		compatible = "ovti,ov2640";
206		reg = <0x30>;
207		resetb-gpios = <&stmpegpio 2 GPIO_ACTIVE_HIGH>;
208		pwdn-gpios = <&stmpegpio 0 GPIO_ACTIVE_LOW>;
209		clocks = <&clk_ext_camera>;
210		clock-names = "xvclk";
211		status = "okay";
212
213		port {
214			ov2640_0: endpoint {
215				remote-endpoint = <&dcmi_0>;
216			};
217		};
218	};
219
220	stmpe1600: stmpe1600@42 {
221		compatible = "st,stmpe1600";
222		reg = <0x42>;
223		interrupts = <8 3>;
224		interrupt-parent = <&gpioi>;
225		interrupt-controller;
226		wakeup-source;
227
228		stmpegpio: stmpe_gpio {
229			compatible = "st,stmpe-gpio";
230			gpio-controller;
231			#gpio-cells = <2>;
232		};
233	};
234};
235
236&iwdg {
237	status = "okay";
238	timeout-sec = <32>;
239};
240
241&ltdc {
242	status = "okay";
243	pinctrl-0 = <&ltdc_pins_a>;
244	pinctrl-names = "default";
245
246	port {
247		ltdc_out_rgb: endpoint {
248			remote-endpoint = <&panel_in_rgb>;
249		};
250	};
251};
252
253&mac {
254	status = "okay";
255	pinctrl-0 = <&ethernet_mii>;
256	pinctrl-names = "default";
257	phy-mode = "mii";
258	phy-handle = <&phy1>;
259	mdio0 {
260		#address-cells = <1>;
261		#size-cells = <0>;
262		compatible = "snps,dwmac-mdio";
263		phy1: ethernet-phy@1 {
264			reg = <1>;
265		};
266	};
267};
268
269&rtc {
270	status = "okay";
271};
272
273&sdio {
274	status = "okay";
275	vmmc-supply = <&mmc_vcard>;
276	cd-gpios = <&stmpegpio 15 GPIO_ACTIVE_LOW>;
277	pinctrl-names = "default", "opendrain";
278	pinctrl-0 = <&sdio_pins>;
279	pinctrl-1 = <&sdio_pins_od>;
280	bus-width = <4>;
281	max-frequency = <12500000>;
282};
283
284&timers1 {
285	status = "okay";
286
287	pwm {
288		pinctrl-0 = <&pwm1_pins>;
289		pinctrl-names = "default";
290		status = "okay";
291	};
292
293	timer@0 {
294		status = "okay";
295	};
296};
297
298&timers3 {
299	status = "okay";
300
301	pwm {
302		pinctrl-0 = <&pwm3_pins>;
303		pinctrl-names = "default";
304		status = "okay";
305	};
306
307	timer@2 {
308		status = "okay";
309	};
310};
311
312&timers5 {
313	/* Override timer5 to act as clockevent */
314	compatible = "st,stm32-timer";
315	interrupts = <50>;
316	status = "okay";
317	/delete-property/#address-cells;
318	/delete-property/#size-cells;
319	/delete-property/clock-names;
320	/delete-node/pwm;
321	/delete-node/timer@4;
322};
323
324&usart1 {
325	pinctrl-0 = <&usart1_pins_a>;
326	pinctrl-names = "default";
327	status = "okay";
328};
329
330&usbotg_hs {
331	dr_mode = "host";
332	phys = <&usbotg_hs_phy>;
333	phy-names = "usb2-phy";
334	pinctrl-0 = <&usbotg_hs_pins_a>;
335	pinctrl-names = "default";
336	status = "okay";
337};
338