-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pinmux: Add stm32mp157c_dk2 board support
Implementation of pinmux for the stm32mp157c_dk2 board. Some UART pin mux definition has been added (mainly for UART console and UART/SPI Arduino shield support). This can be completed with pin mux for other stm32mp157c UART. Signed-off-by: Yaël Boutreux <yael.boutreux@st.com> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
- Loading branch information
Showing
9 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2019 STMicroelectronics | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <kernel.h> | ||
#include <device.h> | ||
#include <init.h> | ||
#include <pinmux.h> | ||
#include <sys_io.h> | ||
|
||
#include <pinmux/stm32/pinmux_stm32.h> | ||
|
||
/* pin assignments for STM32MP157c_dk2 board */ | ||
static const struct pin_config pinconf[] = { | ||
#ifdef CONFIG_UART_3 | ||
{ STM32_PIN_PB10, STM32MP1X_PINMUX_FUNC_PB10_USART3_TX }, | ||
{ STM32_PIN_PB12, STM32MP1X_PINMUX_FUNC_PB12_USART3_RX }, | ||
#endif /* CONFIG_UART_3 */ | ||
#ifdef CONFIG_UART_7 | ||
{ STM32_PIN_PE7, STM32MP1X_PINMUX_FUNC_PE7_UART7_RX }, | ||
{ STM32_PIN_PE8, STM32MP1X_PINMUX_FUNC_PE8_UART7_TX }, | ||
#endif /* CONFIG_UART_7 */ | ||
|
||
}; | ||
|
||
static int pinmux_stm32_init(struct device *port) | ||
{ | ||
ARG_UNUSED(port); | ||
|
||
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf)); | ||
|
||
return 0; | ||
} | ||
|
||
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, | ||
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2019 STMicroelectronics | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_DRIVERS_PINMUX_STM32_PINMUX_STM32MP1X_H_ | ||
#define ZEPHYR_DRIVERS_PINMUX_STM32_PINMUX_STM32MP1X_H_ | ||
|
||
/** | ||
* @file Header for STM32MP1X pin multiplexing helper | ||
*/ | ||
|
||
/* Port B */ | ||
#define STM32MP1X_PINMUX_FUNC_PB10_USART3_TX \ | ||
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP) | ||
#define STM32MP1X_PINMUX_FUNC_PB12_USART3_RX \ | ||
(STM32_PINMUX_ALT_FUNC_8 | STM32_PUPDR_PULL_DOWN) | ||
|
||
/* Port E */ | ||
#define STM32MP1X_PINMUX_FUNC_PE7_UART7_RX \ | ||
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUPDR_PULL_DOWN) | ||
#define STM32MP1X_PINMUX_FUNC_PE8_UART7_TX \ | ||
(STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_PULLUP) | ||
|
||
#endif /* ZEPHYR_DRIVERS_PINMUX_STM32_PINMUX_STM32MP1X_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2019 STMicroelectronics | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <dt-bindings/pinctrl/stm32-pinctrl.h> | ||
|
||
/ { | ||
soc { | ||
pinctrl: pin-controller@50002000 { | ||
usart3_pins_a: usart3_a { | ||
rx_tx { | ||
rx = <STM32_PIN_PB12 | ||
(STM32_PINMUX_ALT_FUNC_8 | | ||
STM32_PUPDR_PULL_DOWN)>; | ||
tx = <STM32_PIN_PB10 | ||
(STM32_PINMUX_ALT_FUNC_7 | | ||
STM32_PUSHPULL_PULLUP)>; | ||
}; | ||
}; | ||
uart7_pins_a: uart7_a { | ||
rx_tx { | ||
rx = <STM32_PIN_PE7 | ||
(STM32_PINMUX_ALT_FUNC_7 | | ||
STM32_PUPDR_PULL_DOWN)>; | ||
tx = <STM32_PIN_PE8 | ||
(STM32_PINMUX_ALT_FUNC_7 | | ||
STM32_PUSHPULL_PULLUP)>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters