1*724ba675SRob Herring/*
2*724ba675SRob Herring * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@gmail.com>
3*724ba675SRob Herring *
4*724ba675SRob Herring * This file is dual-licensed: you can use it either under the terms
5*724ba675SRob Herring * of the GPL or the X11 license, at your option. Note that this dual
6*724ba675SRob Herring * licensing only applies to this file, and not this project as a
7*724ba675SRob Herring * whole.
8*724ba675SRob Herring *
9*724ba675SRob Herring *  a) This file is free software; you can redistribute it and/or
10*724ba675SRob Herring *     modify it under the terms of the GNU General Public License as
11*724ba675SRob Herring *     published by the Free Software Foundation; either version 2 of the
12*724ba675SRob Herring *     License, or (at your option) any later version.
13*724ba675SRob Herring *
14*724ba675SRob Herring *     This file is distributed in the hope that it will be useful,
15*724ba675SRob Herring *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16*724ba675SRob Herring *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*724ba675SRob Herring *     GNU General Public License for more details.
18*724ba675SRob Herring *
19*724ba675SRob Herring *     You should have received a copy of the GNU General Public
20*724ba675SRob Herring *     License along with this file; if not, write to the Free
21*724ba675SRob Herring *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22*724ba675SRob Herring *     MA 02110-1301 USA
23*724ba675SRob Herring *
24*724ba675SRob Herring * Or, alternatively,
25*724ba675SRob Herring *
26*724ba675SRob Herring *  b) Permission is hereby granted, free of charge, to any person
27*724ba675SRob Herring *     obtaining a copy of this software and associated documentation
28*724ba675SRob Herring *     files (the "Software"), to deal in the Software without
29*724ba675SRob Herring *     restriction, including without limitation the rights to use,
30*724ba675SRob Herring *     copy, modify, merge, publish, distribute, sublicense, and/or
31*724ba675SRob Herring *     sell copies of the Software, and to permit persons to whom the
32*724ba675SRob Herring *     Software is furnished to do so, subject to the following
33*724ba675SRob Herring *     conditions:
34*724ba675SRob Herring *
35*724ba675SRob Herring *     The above copyright notice and this permission notice shall be
36*724ba675SRob Herring *     included in all copies or substantial portions of the Software.
37*724ba675SRob Herring *
38*724ba675SRob Herring *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39*724ba675SRob Herring *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40*724ba675SRob Herring *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41*724ba675SRob Herring *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42*724ba675SRob Herring *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43*724ba675SRob Herring *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44*724ba675SRob Herring *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45*724ba675SRob Herring *     OTHER DEALINGS IN THE SOFTWARE.
46*724ba675SRob Herring */
47*724ba675SRob Herring
48*724ba675SRob Herring/dts-v1/;
49*724ba675SRob Herring#include "stm32f429.dtsi"
50*724ba675SRob Herring#include "stm32f429-pinctrl.dtsi"
51*724ba675SRob Herring#include <dt-bindings/input/input.h>
52*724ba675SRob Herring#include <dt-bindings/interrupt-controller/irq.h>
53*724ba675SRob Herring#include <dt-bindings/gpio/gpio.h>
54*724ba675SRob Herring
55*724ba675SRob Herring/ {
56*724ba675SRob Herring	model = "STMicroelectronics STM32F429i-DISCO board";
57*724ba675SRob Herring	compatible = "st,stm32f429i-disco", "st,stm32f429";
58*724ba675SRob Herring
59*724ba675SRob Herring	chosen {
60*724ba675SRob Herring		bootargs = "root=/dev/ram";
61*724ba675SRob Herring		stdout-path = "serial0:115200n8";
62*724ba675SRob Herring	};
63*724ba675SRob Herring
64*724ba675SRob Herring	memory@90000000 {
65*724ba675SRob Herring		device_type = "memory";
66*724ba675SRob Herring		reg = <0x90000000 0x800000>;
67*724ba675SRob Herring	};
68*724ba675SRob Herring
69*724ba675SRob Herring	aliases {
70*724ba675SRob Herring		serial0 = &usart1;
71*724ba675SRob Herring	};
72*724ba675SRob Herring
73*724ba675SRob Herring	leds {
74*724ba675SRob Herring		compatible = "gpio-leds";
75*724ba675SRob Herring		led-red {
76*724ba675SRob Herring			gpios = <&gpiog 14 0>;
77*724ba675SRob Herring		};
78*724ba675SRob Herring		led-green {
79*724ba675SRob Herring			gpios = <&gpiog 13 0>;
80*724ba675SRob Herring			linux,default-trigger = "heartbeat";
81*724ba675SRob Herring		};
82*724ba675SRob Herring	};
83*724ba675SRob Herring
84*724ba675SRob Herring	gpio-keys {
85*724ba675SRob Herring		compatible = "gpio-keys";
86*724ba675SRob Herring		autorepeat;
87*724ba675SRob Herring		button-0 {
88*724ba675SRob Herring			label = "User";
89*724ba675SRob Herring			linux,code = <KEY_HOME>;
90*724ba675SRob Herring			gpios = <&gpioa 0 0>;
91*724ba675SRob Herring		};
92*724ba675SRob Herring	};
93*724ba675SRob Herring
94*724ba675SRob Herring	/* This turns on vbus for otg for host mode (dwc2) */
95*724ba675SRob Herring	vcc5v_otg: vcc5v-otg-regulator {
96*724ba675SRob Herring		compatible = "regulator-fixed";
97*724ba675SRob Herring		gpio = <&gpioc 4 0>;
98*724ba675SRob Herring		regulator-name = "vcc5_host1";
99*724ba675SRob Herring		regulator-always-on;
100*724ba675SRob Herring	};
101*724ba675SRob Herring};
102*724ba675SRob Herring
103*724ba675SRob Herring&clk_hse {
104*724ba675SRob Herring	clock-frequency = <8000000>;
105*724ba675SRob Herring};
106*724ba675SRob Herring
107*724ba675SRob Herring&crc {
108*724ba675SRob Herring	status = "okay";
109*724ba675SRob Herring};
110*724ba675SRob Herring
111*724ba675SRob Herring&i2c3 {
112*724ba675SRob Herring	pinctrl-names = "default";
113*724ba675SRob Herring	pinctrl-0 = <&i2c3_pins>;
114*724ba675SRob Herring	clock-frequency = <100000>;
115*724ba675SRob Herring	status = "okay";
116*724ba675SRob Herring
117*724ba675SRob Herring	stmpe811@41 {
118*724ba675SRob Herring		compatible = "st,stmpe811";
119*724ba675SRob Herring		reg = <0x41>;
120*724ba675SRob Herring		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
121*724ba675SRob Herring		interrupt-parent = <&gpioa>;
122*724ba675SRob Herring		/* 3.25 MHz ADC clock speed */
123*724ba675SRob Herring		st,adc-freq = <1>;
124*724ba675SRob Herring		/* 12-bit ADC */
125*724ba675SRob Herring		st,mod-12b = <1>;
126*724ba675SRob Herring		/* internal ADC reference */
127*724ba675SRob Herring		st,ref-sel = <0>;
128*724ba675SRob Herring		/* ADC converstion time: 80 clocks */
129*724ba675SRob Herring		st,sample-time = <4>;
130*724ba675SRob Herring
131*724ba675SRob Herring		stmpe_touchscreen {
132*724ba675SRob Herring			compatible = "st,stmpe-ts";
133*724ba675SRob Herring			/* 8 sample average control */
134*724ba675SRob Herring			st,ave-ctrl = <3>;
135*724ba675SRob Herring			/* 7 length fractional part in z */
136*724ba675SRob Herring			st,fraction-z = <7>;
137*724ba675SRob Herring			/*
138*724ba675SRob Herring			 * 50 mA typical 80 mA max touchscreen drivers
139*724ba675SRob Herring			 * current limit value
140*724ba675SRob Herring			 */
141*724ba675SRob Herring			st,i-drive = <1>;
142*724ba675SRob Herring			/* 1 ms panel driver settling time */
143*724ba675SRob Herring			st,settling = <3>;
144*724ba675SRob Herring			/* 5 ms touch detect interrupt delay */
145*724ba675SRob Herring			st,touch-det-delay = <5>;
146*724ba675SRob Herring		};
147*724ba675SRob Herring
148*724ba675SRob Herring		stmpe_adc {
149*724ba675SRob Herring			compatible = "st,stmpe-adc";
150*724ba675SRob Herring			/* forbid to use ADC channels 3-0 (touch) */
151*724ba675SRob Herring			st,norequest-mask = <0x0F>;
152*724ba675SRob Herring		};
153*724ba675SRob Herring	};
154*724ba675SRob Herring};
155*724ba675SRob Herring
156*724ba675SRob Herring&ltdc {
157*724ba675SRob Herring	status = "okay";
158*724ba675SRob Herring	pinctrl-0 = <&ltdc_pins_b>;
159*724ba675SRob Herring	pinctrl-names = "default";
160*724ba675SRob Herring
161*724ba675SRob Herring	port {
162*724ba675SRob Herring		ltdc_out_rgb: endpoint {
163*724ba675SRob Herring			remote-endpoint = <&panel_in_rgb>;
164*724ba675SRob Herring		};
165*724ba675SRob Herring	};
166*724ba675SRob Herring};
167*724ba675SRob Herring
168*724ba675SRob Herring&rtc {
169*724ba675SRob Herring	assigned-clocks = <&rcc 1 CLK_RTC>;
170*724ba675SRob Herring	assigned-clock-parents = <&rcc 1 CLK_LSI>;
171*724ba675SRob Herring	status = "okay";
172*724ba675SRob Herring};
173*724ba675SRob Herring
174*724ba675SRob Herring&spi5 {
175*724ba675SRob Herring	status = "okay";
176*724ba675SRob Herring	pinctrl-0 = <&spi5_pins>;
177*724ba675SRob Herring	pinctrl-names = "default";
178*724ba675SRob Herring	#address-cells = <1>;
179*724ba675SRob Herring	#size-cells = <0>;
180*724ba675SRob Herring	cs-gpios = <&gpioc 1 GPIO_ACTIVE_LOW>, <&gpioc 2 GPIO_ACTIVE_LOW>;
181*724ba675SRob Herring
182*724ba675SRob Herring	l3gd20: l3gd20@0 {
183*724ba675SRob Herring		compatible = "st,l3gd20-gyro";
184*724ba675SRob Herring		spi-max-frequency = <10000000>;
185*724ba675SRob Herring		st,drdy-int-pin = <2>;
186*724ba675SRob Herring		interrupt-parent = <&gpioa>;
187*724ba675SRob Herring		interrupts = <1 IRQ_TYPE_EDGE_RISING>,
188*724ba675SRob Herring				<2 IRQ_TYPE_EDGE_RISING>;
189*724ba675SRob Herring		reg = <0>;
190*724ba675SRob Herring		status = "okay";
191*724ba675SRob Herring	};
192*724ba675SRob Herring
193*724ba675SRob Herring	display: display@1{
194*724ba675SRob Herring		/* Connect panel-ilitek-9341 to ltdc */
195*724ba675SRob Herring		compatible = "st,sf-tc240t-9370-t", "ilitek,ili9341";
196*724ba675SRob Herring		reg = <1>;
197*724ba675SRob Herring		spi-3wire;
198*724ba675SRob Herring		spi-max-frequency = <10000000>;
199*724ba675SRob Herring		dc-gpios = <&gpiod 13 0>;
200*724ba675SRob Herring		port {
201*724ba675SRob Herring			panel_in_rgb: endpoint {
202*724ba675SRob Herring			remote-endpoint = <&ltdc_out_rgb>;
203*724ba675SRob Herring			};
204*724ba675SRob Herring		};
205*724ba675SRob Herring	};
206*724ba675SRob Herring};
207*724ba675SRob Herring
208*724ba675SRob Herring&timers5 {
209*724ba675SRob Herring	/* Override timer5 to act as clockevent */
210*724ba675SRob Herring	compatible = "st,stm32-timer";
211*724ba675SRob Herring	interrupts = <50>;
212*724ba675SRob Herring	status = "okay";
213*724ba675SRob Herring	/delete-property/#address-cells;
214*724ba675SRob Herring	/delete-property/#size-cells;
215*724ba675SRob Herring	/delete-property/clock-names;
216*724ba675SRob Herring	/delete-node/pwm;
217*724ba675SRob Herring	/delete-node/timer@4;
218*724ba675SRob Herring};
219*724ba675SRob Herring
220*724ba675SRob Herring&usart1 {
221*724ba675SRob Herring	pinctrl-0 = <&usart1_pins_a>;
222*724ba675SRob Herring	pinctrl-names = "default";
223*724ba675SRob Herring	status = "okay";
224*724ba675SRob Herring};
225*724ba675SRob Herring
226*724ba675SRob Herring&usbotg_hs {
227*724ba675SRob Herring	compatible = "st,stm32f4x9-fsotg";
228*724ba675SRob Herring	dr_mode = "host";
229*724ba675SRob Herring	pinctrl-0 = <&usbotg_fs_pins_b>;
230*724ba675SRob Herring	pinctrl-names = "default";
231*724ba675SRob Herring	status = "okay";
232*724ba675SRob Herring};
233