| 1 |
/* |
| 2 |
* Copyright 2015 - Maxime Coquelin <[email protected]> |
| 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 |
* Or, alternatively, |
| 20 |
* |
| 21 |
* b) Permission is hereby granted, free of charge, to any person |
| 22 |
* obtaining a copy of this software and associated documentation |
| 23 |
* files (the "Software"), to deal in the Software without |
| 24 |
* restriction, including without limitation the rights to use, |
| 25 |
* copy, modify, merge, publish, distribute, sublicense, and/or |
| 26 |
* sell copies of the Software, and to permit persons to whom the |
| 27 |
* Software is furnished to do so, subject to the following |
| 28 |
* conditions: |
| 29 |
* |
| 30 |
* The above copyright notice and this permission notice shall be |
| 31 |
* included in all copies or substantial portions of the Software. |
| 32 |
* |
| 33 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 34 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 35 |
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 36 |
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 37 |
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 38 |
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 39 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 40 |
* OTHER DEALINGS IN THE SOFTWARE. |
| 41 |
*/ |
| 42 |
|
| 43 |
/dts-v1/; |
| 44 |
#include "stm32f746.dtsi" |
| 45 |
#include "stm32f746-pinctrl.dtsi" |
| 46 |
#include <dt-bindings/input/input.h> |
| 47 |
#include <dt-bindings/interrupt-controller/irq.h> |
| 48 |
#include <dt-bindings/leds/common.h> |
| 49 |
|
| 50 |
/ { |
| 51 |
model = "STMicroelectronics STM32746g-EVAL board"; |
| 52 |
compatible = "st,stm32746g-eval", "st,stm32f746"; |
| 53 |
|
| 54 |
chosen { |
| 55 |
bootargs = "root=/dev/ram"; |
| 56 |
stdout-path = "serial0:115200n8"; |
| 57 |
}; |
| 58 |
|
| 59 |
memory@c0000000 { |
| 60 |
device_type = "memory"; |
| 61 |
reg = <0xc0000000 0x2000000>; |
| 62 |
}; |
| 63 |
|
| 64 |
aliases { |
| 65 |
serial0 = &usart1; |
| 66 |
}; |
| 67 |
|
| 68 |
leds { |
| 69 |
compatible = "gpio-leds"; |
| 70 |
led_green: led-green { |
| 71 |
function = LED_FUNCTION_HEARTBEAT; |
| 72 |
color = <LED_COLOR_ID_GREEN>; |
| 73 |
gpios = <&gpiof 10 1>; |
| 74 |
linux,default-trigger = "heartbeat"; |
| 75 |
}; |
| 76 |
led-orange { |
| 77 |
color = <LED_COLOR_ID_ORANGE>; |
| 78 |
gpios = <&stmfx_pinctrl 17 1>; |
| 79 |
}; |
| 80 |
led-red { |
| 81 |
color = <LED_COLOR_ID_RED>; |
| 82 |
gpios = <&gpiob 7 1>; |
| 83 |
}; |
| 84 |
led-blue { |
| 85 |
color = <LED_COLOR_ID_BLUE>; |
| 86 |
gpios = <&stmfx_pinctrl 19 1>; |
| 87 |
}; |
| 88 |
}; |
| 89 |
|
| 90 |
gpio-keys { |
| 91 |
compatible = "gpio-keys"; |
| 92 |
autorepeat; |
| 93 |
button-0 { |
| 94 |
label = "Wake up"; |
| 95 |
linux,code = <KEY_WAKEUP>; |
| 96 |
gpios = <&gpioc 13 0>; |
| 97 |
}; |
| 98 |
}; |
| 99 |
|
| 100 |
joystick { |
| 101 |
compatible = "gpio-keys"; |
| 102 |
pinctrl-0 = <&joystick_pins>; |
| 103 |
pinctrl-names = "default"; |
| 104 |
button-0 { |
| 105 |
label = "JoySel"; |
| 106 |
linux,code = <KEY_ENTER>; |
| 107 |
interrupt-parent = <&stmfx_pinctrl>; |
| 108 |
interrupts = <0 IRQ_TYPE_EDGE_FALLING>; |
| 109 |
}; |
| 110 |
button-1 { |
| 111 |
label = "JoyDown"; |
| 112 |
linux,code = <KEY_DOWN>; |
| 113 |
interrupt-parent = <&stmfx_pinctrl>; |
| 114 |
interrupts = <1 IRQ_TYPE_EDGE_FALLING>; |
| 115 |
}; |
| 116 |
button-2 { |
| 117 |
label = "JoyLeft"; |
| 118 |
linux,code = <KEY_LEFT>; |
| 119 |
interrupt-parent = <&stmfx_pinctrl>; |
| 120 |
interrupts = <2 IRQ_TYPE_EDGE_FALLING>; |
| 121 |
}; |
| 122 |
button-3 { |
| 123 |
label = "JoyRight"; |
| 124 |
linux,code = <KEY_RIGHT>; |
| 125 |
interrupt-parent = <&stmfx_pinctrl>; |
| 126 |
interrupts = <3 IRQ_TYPE_EDGE_FALLING>; |
| 127 |
}; |
| 128 |
button-4 { |
| 129 |
label = "JoyUp"; |
| 130 |
linux,code = <KEY_UP>; |
| 131 |
interrupt-parent = <&stmfx_pinctrl>; |
| 132 |
interrupts = <4 IRQ_TYPE_EDGE_FALLING>; |
| 133 |
}; |
| 134 |
}; |
| 135 |
|
| 136 |
options { |
| 137 |
u-boot { |
| 138 |
compatible = "u-boot,config"; |
| 139 |
boot-led = <&led_green>; |
| 140 |
}; |
| 141 |
}; |
| 142 |
|
| 143 |
usbotg_hs_phy: usb-phy { |
| 144 |
#phy-cells = <0>; |
| 145 |
compatible = "usb-nop-xceiv"; |
| 146 |
clocks = <&rcc 0 STM32F7_AHB1_CLOCK(OTGHSULPI)>; |
| 147 |
clock-names = "main_clk"; |
| 148 |
}; |
| 149 |
|
| 150 |
mmc_vcard: mmc_vcard { |
| 151 |
compatible = "regulator-fixed"; |
| 152 |
regulator-name = "mmc_vcard"; |
| 153 |
regulator-min-microvolt = <3300000>; |
| 154 |
regulator-max-microvolt = <3300000>; |
| 155 |
}; |
| 156 |
}; |
| 157 |
|
| 158 |
&clk_hse { |
| 159 |
clock-frequency = <25000000>; |
| 160 |
}; |
| 161 |
|
| 162 |
&crc { |
| 163 |
status = "okay"; |
| 164 |
}; |
| 165 |
|
| 166 |
&i2c1 { |
| 167 |
pinctrl-0 = <&i2c1_pins_b>; |
| 168 |
pinctrl-names = "default"; |
| 169 |
i2c-scl-rising-time-ns = <185>; |
| 170 |
i2c-scl-falling-time-ns = <20>; |
| 171 |
status = "okay"; |
| 172 |
|
| 173 |
stmfx: stmfx@42 { |
| 174 |
compatible = "st,stmfx-0300"; |
| 175 |
reg = <0x42>; |
| 176 |
interrupts = <8 IRQ_TYPE_EDGE_RISING>; |
| 177 |
interrupt-parent = <&gpioi>; |
| 178 |
|
| 179 |
stmfx_pinctrl: pinctrl { |
| 180 |
compatible = "st,stmfx-0300-pinctrl"; |
| 181 |
gpio-controller; |
| 182 |
#gpio-cells = <2>; |
| 183 |
interrupt-controller; |
| 184 |
#interrupt-cells = <2>; |
| 185 |
gpio-ranges = <&stmfx_pinctrl 0 0 24>; |
| 186 |
|
| 187 |
joystick_pins: joystick { |
| 188 |
pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4"; |
| 189 |
drive-push-pull; |
| 190 |
bias-pull-up; |
| 191 |
}; |
| 192 |
}; |
| 193 |
}; |
| 194 |
}; |
| 195 |
|
| 196 |
&rtc { |
| 197 |
status = "okay"; |
| 198 |
}; |
| 199 |
|
| 200 |
&sdio1 { |
| 201 |
status = "okay"; |
| 202 |
vmmc-supply = <&mmc_vcard>; |
| 203 |
broken-cd; |
| 204 |
pinctrl-names = "default", "opendrain", "sleep"; |
| 205 |
pinctrl-0 = <&sdio_pins_a>; |
| 206 |
pinctrl-1 = <&sdio_pins_od_a>; |
| 207 |
pinctrl-2 = <&sdio_pins_sleep_a>; |
| 208 |
bus-width = <4>; |
| 209 |
}; |
| 210 |
|
| 211 |
&timers5 { |
| 212 |
/* Override timer5 to act as clockevent */ |
| 213 |
compatible = "st,stm32-timer"; |
| 214 |
interrupts = <50>; |
| 215 |
status = "okay"; |
| 216 |
/delete-property/#address-cells; |
| 217 |
/delete-property/#size-cells; |
| 218 |
/delete-property/clock-names; |
| 219 |
/delete-node/pwm; |
| 220 |
/delete-node/timer@4; |
| 221 |
}; |
| 222 |
|
| 223 |
&usart1 { |
| 224 |
pinctrl-0 = <&usart1_pins_a>; |
| 225 |
pinctrl-names = "default"; |
| 226 |
status = "okay"; |
| 227 |
}; |
| 228 |
|
| 229 |
&usbotg_hs { |
| 230 |
dr_mode = "otg"; |
| 231 |
phys = <&usbotg_hs_phy>; |
| 232 |
phy-names = "usb2-phy"; |
| 233 |
pinctrl-0 = <&usbotg_hs_pins_a>; |
| 234 |
pinctrl-names = "default"; |
| 235 |
status = "okay"; |
| 236 |
}; |