[PATCH RESEND 6/9] ARM: stm32: add STM32H7R7 platform support
From: Liu Changjie
Date: Sun Jul 26 2026 - 12:16:47 EST
Enable STM32H7R7 in the STM32 machine selection and compatible table.
Add low-level UART4 debug output using the register layout shared by
the STM32F7 and STM32H7 USART block.
Signed-off-by: Liu Changjie <liucj1228@xxxxxxxxxxx>
---
arch/arm/Kconfig.debug | 12 ++++++++++++
arch/arm/include/debug/stm32.S | 2 +-
arch/arm/mach-stm32/Kconfig | 8 ++++++++
arch/arm/mach-stm32/board-dt.c | 1 +
4 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 366f162e1..e76750d9e 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1202,6 +1202,17 @@ choice
If unsure, say N.
+ config STM32H7RS_DEBUG_UART
+ bool "Use STM32H7RS UART for low-level debug"
+ depends on MACH_STM32H7R7
+ select DEBUG_STM32_UART
+ help
+ Say Y here if you want kernel low-level debugging support on
+ STM32H7RS platforms. The ART-Pi2 debug console is UART4 at
+ physical address 0x40004c00.
+
+ If unsure, say N.
+
config STM32MP1_DEBUG_UART
bool "Use STM32MP1 UART for low-level debug"
depends on MACH_STM32MP157
@@ -1582,6 +1593,7 @@ config DEBUG_UART_PHYS
default 0x20201000 if DEBUG_BCM2835
default 0x3e000000 if DEBUG_BCM_KONA_UART
default 0x3f201000 if DEBUG_BCM2836
+ default 0x40004c00 if STM32H7RS_DEBUG_UART
default 0x40010000 if STM32MP1_DEBUG_UART
default 0x40011000 if STM32F4_DEBUG_UART || STM32F7_DEBUG_UART || \
STM32H7_DEBUG_UART
diff --git a/arch/arm/include/debug/stm32.S b/arch/arm/include/debug/stm32.S
index b6d9df30e..2a8c25ede 100644
--- a/arch/arm/include/debug/stm32.S
+++ b/arch/arm/include/debug/stm32.S
@@ -10,7 +10,7 @@
#endif
#if defined(CONFIG_STM32F7_DEBUG_UART) || defined(CONFIG_STM32H7_DEBUG_UART) || \
- defined(CONFIG_STM32MP1_DEBUG_UART)
+ defined(CONFIG_STM32H7RS_DEBUG_UART) || defined(CONFIG_STM32MP1_DEBUG_UART)
#define STM32_USART_SR_OFF 0x1C
#define STM32_USART_TDR_OFF 0x28
#endif
diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 630b992f3..ebf9fb637 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -40,6 +40,14 @@ config MACH_STM32H743
bool "STMicroelectronics STM32H743"
default y
+config MACH_STM32H7R7
+ bool "STMicroelectronics STM32H7R7"
+ default y
+ help
+ Support for STMicroelectronics STM32H7R7 Cortex-M7
+ microcontrollers. This enables support for boards based on the
+ STM32H7R7 SoC, such as the RT-Thread ART-Pi2.
+
endif # ARMv7-M
if ARCH_MULTI_V7
diff --git a/arch/arm/mach-stm32/board-dt.c b/arch/arm/mach-stm32/board-dt.c
index e6233c872..d1207b84a 100644
--- a/arch/arm/mach-stm32/board-dt.c
+++ b/arch/arm/mach-stm32/board-dt.c
@@ -19,6 +19,7 @@ static const char *const stm32_compat[] __initconst = {
"st,stm32h743",
"st,stm32h747",
"st,stm32h750",
+ "st,stm32h7r7",
"st,stm32mp131",
"st,stm32mp133",
"st,stm32mp135",
--
2.55.0