dts: arm: stm32f4: Add pinctrl node and uart pin information
Add needed uart pinctrl configuration in pinmux node. This is done thanks to <soc>-pinctrl.dtsi file matching the <soc>.dtsi files Populate stm32 f4 based boards dts files with references to uart pinctrl nodes. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
72d2960741
commit
e514554cd1
17 changed files with 191 additions and 0 deletions
|
@ -20,11 +20,15 @@
|
||||||
|
|
||||||
&usart1 {
|
&usart1 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart1_pins_b>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usart2 {
|
&usart2 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart2_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,15 @@
|
||||||
|
|
||||||
&usart1 {
|
&usart1 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart1_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usart2 {
|
&usart2 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart2_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,14 @@
|
||||||
|
|
||||||
&usart1 {
|
&usart1 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart1_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usart2 {
|
&usart2 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart2_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,5 +20,7 @@
|
||||||
|
|
||||||
&usart3 {
|
&usart3 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart3_pins_b>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,5 +20,7 @@
|
||||||
|
|
||||||
&usart3 {
|
&usart3 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart3_pins_b>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
62
dts/arm/st/stm32f4-pinctrl.dtsi
Normal file
62
dts/arm/st/stm32f4-pinctrl.dtsi
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Linaro Limited
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pinctrl/stm32-pinctrl.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
soc {
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
usart1_pins_a: usart1@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PB6 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PB7 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart1_pins_b: usart1@1 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PA10 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PA9 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart1_pins_c: usart1@2 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PG10 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PB6 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart2_pins_a: usart2@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PA3 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PA2 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart2_pins_b: usart2@1 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PA15 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PA2 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart2_pins_c: usart2@2 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PD6 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PA2 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart3_pins_a: usart3@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PB11 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PB10 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart3_pins_b: usart3@1 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PD9 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_NO_PULL)>;
|
||||||
|
tx = <STM32_PIN_PD8 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arm/armv7-m.dtsi>
|
#include <arm/armv7-m.dtsi>
|
||||||
|
#include <st/stm32f4-pinctrl.dtsi>
|
||||||
#include <st/mem.h>
|
#include <st/mem.h>
|
||||||
#include <dt-bindings/clock/stm32_clock.h>
|
#include <dt-bindings/clock/stm32_clock.h>
|
||||||
|
|
||||||
|
@ -39,6 +40,14 @@
|
||||||
label = "STM32_CLK_RCC";
|
label = "STM32_CLK_RCC";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
compatible = "st,stm32-pinmux";
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
reg = <0x40020000 0x1C00>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
usart1: serial@40011000 {
|
usart1: serial@40011000 {
|
||||||
compatible = "st,stm32-usart", "st,stm32-uart";
|
compatible = "st,stm32-usart", "st,stm32-uart";
|
||||||
reg = <0x40011000 0x400>;
|
reg = <0x40011000 0x400>;
|
||||||
|
|
32
dts/arm/st/stm32f407-pinctrl.dtsi
Normal file
32
dts/arm/st/stm32f407-pinctrl.dtsi
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Linaro Limited
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pinctrl/stm32-pinctrl.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
soc {
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
usart3_pins_a: usart3@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PB11 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PB10 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart3_pins_b: usart3@1 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PD9 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PD8 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart6_pins_a: usart6@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PG14 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PG9 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -4,10 +4,15 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <st/stm32f407-pinctrl.dtsi>
|
||||||
#include <st/stm32f411.dtsi>
|
#include <st/stm32f411.dtsi>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
soc {
|
soc {
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
reg = <0x40020000 0x2800>;
|
||||||
|
};
|
||||||
|
|
||||||
usart3: serial@40004800 {
|
usart3: serial@40004800 {
|
||||||
compatible = "st,stm32-usart", "st,stm32-uart";
|
compatible = "st,stm32-usart", "st,stm32-uart";
|
||||||
reg = <0x40004800 0x400>;
|
reg = <0x40004800 0x400>;
|
||||||
|
|
26
dts/arm/st/stm32f412-pinctrl.dtsi
Normal file
26
dts/arm/st/stm32f412-pinctrl.dtsi
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Linaro Limited
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pinctrl/stm32-pinctrl.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
soc {
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
usart3_pins_a: usart3@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PB11 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PB10 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart3_pins_b: usart3@1 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PD9 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PD8 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <st/stm32f412-pinctrl.dtsi>
|
||||||
#include <st/stm32f411.dtsi>
|
#include <st/stm32f411.dtsi>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
|
|
26
dts/arm/st/stm32f413-pinctrl.dtsi
Normal file
26
dts/arm/st/stm32f413-pinctrl.dtsi
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Florian Vaussard, HEIG-VD
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <dt-bindings/pinctrl/stm32-pinctrl.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
soc {
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
usart3_pins_a: usart3@0 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PB11 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PB10 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
usart3_pins_b: usart3@1 {
|
||||||
|
rx_tx {
|
||||||
|
rx = <STM32_PIN_PD9 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
tx = <STM32_PIN_PD8 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP)>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <st/stm32f413-pinctrl.dtsi>
|
||||||
#include <st/stm32f411.dtsi>
|
#include <st/stm32f411.dtsi>
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
soc {
|
soc {
|
||||||
|
pinctrl: pin-controller {
|
||||||
|
reg = <0x40020000 0x2800>;
|
||||||
|
};
|
||||||
|
|
||||||
uart7: serial@40007800 {
|
uart7: serial@40007800 {
|
||||||
compatible = "st,stm32-uart";
|
compatible = "st,stm32-uart";
|
||||||
reg = <0x40007800 0x400>;
|
reg = <0x40007800 0x400>;
|
||||||
|
|
|
@ -20,10 +20,14 @@
|
||||||
|
|
||||||
&usart3 {
|
&usart3 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart3_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usart6 {
|
&usart6 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart6_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,10 +20,14 @@
|
||||||
|
|
||||||
&usart1 {
|
&usart1 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart1_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
||||||
&usart2 {
|
&usart2 {
|
||||||
current-speed = <115200>;
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&usart2_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
status = "ok";
|
status = "ok";
|
||||||
};
|
};
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
/* Usefull definitions */
|
/* Usefull definitions */
|
||||||
#define STM32_PUSHPULL_NOPULL (STM32_OTYPER_PUSH_PULL | STM32_PUPDR_NO_PULL)
|
#define STM32_PUSHPULL_NOPULL (STM32_OTYPER_PUSH_PULL | STM32_PUPDR_NO_PULL)
|
||||||
#define STM32_OPENDRAIN_PULLUP (STM32_OTYPER_OPEN_DRAIN | STM32_PUPDR_PULL_UP)
|
#define STM32_OPENDRAIN_PULLUP (STM32_OTYPER_OPEN_DRAIN | STM32_PUPDR_PULL_UP)
|
||||||
|
#define STM32_PUSHPULL_PULLUP (STM32_OTYPER_PUSH_PULL | STM32_PUPDR_PULL_UP)
|
||||||
|
|
||||||
/* Alternate functions numbers*/
|
/* Alternate functions numbers*/
|
||||||
#define STM32_FUNC_ALT_0 0
|
#define STM32_FUNC_ALT_0 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue