0001 /*
0002 * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@gmail.com>
0003 *
0004 * This file is dual-licensed: you can use it either under the terms
0005 * of the GPL or the X11 license, at your option. Note that this dual
0006 * licensing only applies to this file, and not this project as a
0007 * whole.
0008 *
0009 * a) This file is free software; you can redistribute it and/or
0010 * modify it under the terms of the GNU General Public License as
0011 * published by the Free Software Foundation; either version 2 of the
0012 * License, or (at your option) any later version.
0013 *
0014 * This file is distributed in the hope that it will be useful,
0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017 * GNU General Public License for more details.
0018 *
0019 * You should have received a copy of the GNU General Public
0020 * License along with this file; if not, write to the Free
0021 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
0022 * MA 02110-1301 USA
0023 *
0024 * Or, alternatively,
0025 *
0026 * b) Permission is hereby granted, free of charge, to any person
0027 * obtaining a copy of this software and associated documentation
0028 * files (the "Software"), to deal in the Software without
0029 * restriction, including without limitation the rights to use,
0030 * copy, modify, merge, publish, distribute, sublicense, and/or
0031 * sell copies of the Software, and to permit persons to whom the
0032 * Software is furnished to do so, subject to the following
0033 * conditions:
0034 *
0035 * The above copyright notice and this permission notice shall be
0036 * included in all copies or substantial portions of the Software.
0037 *
0038 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0039 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0040 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0041 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0042 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0043 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0044 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0045 * OTHER DEALINGS IN THE SOFTWARE.
0046 */
0047
0048 /dts-v1/;
0049 #include "stm32f429.dtsi"
0050 #include "stm32f429-pinctrl.dtsi"
0051 #include <dt-bindings/input/input.h>
0052 #include <dt-bindings/interrupt-controller/irq.h>
0053 #include <dt-bindings/gpio/gpio.h>
0054
0055 / {
0056 model = "STMicroelectronics STM32F429i-DISCO board";
0057 compatible = "st,stm32f429i-disco", "st,stm32f429";
0058
0059 chosen {
0060 bootargs = "root=/dev/ram";
0061 stdout-path = "serial0:115200n8";
0062 };
0063
0064 memory@90000000 {
0065 device_type = "memory";
0066 reg = <0x90000000 0x800000>;
0067 };
0068
0069 aliases {
0070 serial0 = &usart1;
0071 };
0072
0073 leds {
0074 compatible = "gpio-leds";
0075 led-red {
0076 gpios = <&gpiog 14 0>;
0077 };
0078 led-green {
0079 gpios = <&gpiog 13 0>;
0080 linux,default-trigger = "heartbeat";
0081 };
0082 };
0083
0084 gpio-keys {
0085 compatible = "gpio-keys";
0086 autorepeat;
0087 button-0 {
0088 label = "User";
0089 linux,code = <KEY_HOME>;
0090 gpios = <&gpioa 0 0>;
0091 };
0092 };
0093
0094 /* This turns on vbus for otg for host mode (dwc2) */
0095 vcc5v_otg: vcc5v-otg-regulator {
0096 compatible = "regulator-fixed";
0097 gpio = <&gpioc 4 0>;
0098 regulator-name = "vcc5_host1";
0099 regulator-always-on;
0100 };
0101 };
0102
0103 &clk_hse {
0104 clock-frequency = <8000000>;
0105 };
0106
0107 &crc {
0108 status = "okay";
0109 };
0110
0111 &i2c3 {
0112 pinctrl-names = "default";
0113 pinctrl-0 = <&i2c3_pins>;
0114 clock-frequency = <100000>;
0115 status = "okay";
0116
0117 stmpe811@41 {
0118 compatible = "st,stmpe811";
0119 reg = <0x41>;
0120 interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
0121 interrupt-parent = <&gpioa>;
0122 /* 3.25 MHz ADC clock speed */
0123 st,adc-freq = <1>;
0124 /* 12-bit ADC */
0125 st,mod-12b = <1>;
0126 /* internal ADC reference */
0127 st,ref-sel = <0>;
0128 /* ADC converstion time: 80 clocks */
0129 st,sample-time = <4>;
0130
0131 stmpe_touchscreen {
0132 compatible = "st,stmpe-ts";
0133 /* 8 sample average control */
0134 st,ave-ctrl = <3>;
0135 /* 7 length fractional part in z */
0136 st,fraction-z = <7>;
0137 /*
0138 * 50 mA typical 80 mA max touchscreen drivers
0139 * current limit value
0140 */
0141 st,i-drive = <1>;
0142 /* 1 ms panel driver settling time */
0143 st,settling = <3>;
0144 /* 5 ms touch detect interrupt delay */
0145 st,touch-det-delay = <5>;
0146 };
0147
0148 stmpe_adc {
0149 compatible = "st,stmpe-adc";
0150 /* forbid to use ADC channels 3-0 (touch) */
0151 st,norequest-mask = <0x0F>;
0152 };
0153 };
0154 };
0155
0156 <dc {
0157 status = "okay";
0158 pinctrl-0 = <<dc_pins_b>;
0159 pinctrl-names = "default";
0160
0161 port {
0162 ltdc_out_rgb: endpoint {
0163 remote-endpoint = <&panel_in_rgb>;
0164 };
0165 };
0166 };
0167
0168 &rtc {
0169 assigned-clocks = <&rcc 1 CLK_RTC>;
0170 assigned-clock-parents = <&rcc 1 CLK_LSI>;
0171 status = "okay";
0172 };
0173
0174 &spi5 {
0175 status = "okay";
0176 pinctrl-0 = <&spi5_pins>;
0177 pinctrl-names = "default";
0178 #address-cells = <1>;
0179 #size-cells = <0>;
0180 cs-gpios = <&gpioc 1 GPIO_ACTIVE_LOW>, <&gpioc 2 GPIO_ACTIVE_LOW>;
0181
0182 l3gd20: l3gd20@0 {
0183 compatible = "st,l3gd20-gyro";
0184 spi-max-frequency = <10000000>;
0185 st,drdy-int-pin = <2>;
0186 interrupt-parent = <&gpioa>;
0187 interrupts = <1 IRQ_TYPE_EDGE_RISING>,
0188 <2 IRQ_TYPE_EDGE_RISING>;
0189 reg = <0>;
0190 status = "okay";
0191 };
0192
0193 display: display@1{
0194 /* Connect panel-ilitek-9341 to ltdc */
0195 compatible = "st,sf-tc240t-9370-t", "ilitek,ili9341";
0196 reg = <1>;
0197 spi-3wire;
0198 spi-max-frequency = <10000000>;
0199 dc-gpios = <&gpiod 13 0>;
0200 port {
0201 panel_in_rgb: endpoint {
0202 remote-endpoint = <<dc_out_rgb>;
0203 };
0204 };
0205 };
0206 };
0207
0208 &timers5 {
0209 /* Override timer5 to act as clockevent */
0210 compatible = "st,stm32-timer";
0211 interrupts = <50>;
0212 status = "okay";
0213 /delete-property/#address-cells;
0214 /delete-property/#size-cells;
0215 /delete-property/clock-names;
0216 /delete-node/pwm;
0217 /delete-node/timer@4;
0218 };
0219
0220 &usart1 {
0221 pinctrl-0 = <&usart1_pins_a>;
0222 pinctrl-names = "default";
0223 status = "okay";
0224 };
0225
0226 &usbotg_hs {
0227 compatible = "st,stm32f4x9-fsotg";
0228 dr_mode = "host";
0229 pinctrl-0 = <&usbotg_fs_pins_b>;
0230 pinctrl-names = "default";
0231 status = "okay";
0232 };