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