summaryrefslogtreecommitdiff
path: root/board/st/stm32mp1/debug_uart.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-07-31 08:45:50 -0600
committerTom Rini <trini@konsulko.com>2025-07-31 10:04:32 -0600
commitf5e968a28e7cdc2c4365f5a382e02f074ee03fac (patch)
tree2f988c7102a977da562c28075e94e875ab5bcb94 /board/st/stm32mp1/debug_uart.c
parenteef444c38994aee9cd3c6e4df5791b5f7209c8d8 (diff)
parente064db5fe77caaddb21a7793f266119ad89dd79a (diff)
Merge tag 'u-boot-stm32-20250731' of https://source.denx.de/u-boot/custodians/u-boot-stm
CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/27236 - Add support for STM32 TIMERS and STM32 PWM on STM32MP25 - Add STM32MP13xx SPL and OpTee-OS start support - Fix header misuse in stm32 reset drivers - Fix STMicroelectronics spelling - Fix clk-stm32h7 wrong macros used in register read - Fix PRE_CON_BUF_ADDR on STM32MP13 - Fix clock identifier passed to struct scmi_clk_parent_set_in - Fix stm32 reset for STM32F4/F7 and H7 - Enable OF_UPSTREAM_BUILD_VENDOR for stm32mp13_defconfig - Add STM32MP23 SoC and stm32mp235f-dk board support
Diffstat (limited to 'board/st/stm32mp1/debug_uart.c')
-rw-r--r--board/st/stm32mp1/debug_uart.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/board/st/stm32mp1/debug_uart.c b/board/st/stm32mp1/debug_uart.c
index 24e3f9f2201..4c2149e0480 100644
--- a/board/st/stm32mp1/debug_uart.c
+++ b/board/st/stm32mp1/debug_uart.c
@@ -9,17 +9,32 @@
#include <asm/arch/stm32.h>
#include <linux/bitops.h>
+#if IS_ENABLED(CONFIG_STM32MP13X)
+#define RCC_MP_APB1ENSETR (STM32_RCC_BASE + 0x0700)
+#define RCC_MP_AHB4ENSETR (STM32_RCC_BASE + 0x0768)
+#elif IS_ENABLED(CONFIG_STM32MP15X)
#define RCC_MP_APB1ENSETR (STM32_RCC_BASE + 0x0A00)
#define RCC_MP_AHB4ENSETR (STM32_RCC_BASE + 0x0A28)
+#endif
+#define GPIOA_BASE 0x50002000
#define GPIOG_BASE 0x50008000
void board_debug_uart_init(void)
{
- if (CONFIG_DEBUG_UART_BASE == STM32_UART4_BASE) {
- /* UART4 clock enable */
- setbits_le32(RCC_MP_APB1ENSETR, BIT(16));
+ if (CONFIG_DEBUG_UART_BASE != STM32_UART4_BASE)
+ return;
+ /* UART4 clock enable */
+ setbits_le32(RCC_MP_APB1ENSETR, BIT(16));
+
+ if (IS_ENABLED(CONFIG_STM32MP13X)) {
+ /* GPIOA clock enable */
+ writel(BIT(0), RCC_MP_AHB4ENSETR);
+ /* GPIO configuration for DH boards: Uart4 TX = A9 */
+ writel(0xfffbffff, GPIOA_BASE + 0x00);
+ writel(0x00000080, GPIOA_BASE + 0x24);
+ } else if (IS_ENABLED(CONFIG_STM32MP15X)) {
/* GPIOG clock enable */
writel(BIT(6), RCC_MP_AHB4ENSETR);
/* GPIO configuration for ST boards: Uart4 TX = G11 */