From e3953f10ad7787ae2bbe0d7e80cf5872fbd94c9a Mon Sep 17 00:00:00 2001 From: Youssef Zini Date: Fri, 28 Mar 2025 13:43:08 +0100 Subject: [PATCH] soc: stm32: add initial soc support for stm32mp2x Add initial soc support for the stm32mp2x series, including initial Kconfig entries and default configuration files. This enables Zephyr to recognize and build for the stm32mp2x series, taking the stm32mp257f_ev1 as a baseline. Includes: - Kconfig and defconfig files for SoC selection and defaults - soc.h for hal headers - CMakeLists.txt for build system integration - soc.yml update to register the new SoC System Clock is configured statically from DTS. So no initialization hook or soc.c needed. Signed-off-by: Youssef Zini --- soc/st/stm32/soc.yml | 5 ++++ soc/st/stm32/stm32mp2x/CMakeLists.txt | 9 +++++++ soc/st/stm32/stm32mp2x/Kconfig | 17 +++++++++++++ soc/st/stm32/stm32mp2x/Kconfig.defconfig | 10 ++++++++ .../stm32mp2x/Kconfig.defconfig.stm32mp257fxx | 11 ++++++++ soc/st/stm32/stm32mp2x/Kconfig.soc | 18 +++++++++++++ soc/st/stm32/stm32mp2x/m33/CMakeLists.txt | 7 ++++++ soc/st/stm32/stm32mp2x/m33/soc.h | 25 +++++++++++++++++++ 8 files changed, 102 insertions(+) create mode 100644 soc/st/stm32/stm32mp2x/CMakeLists.txt create mode 100644 soc/st/stm32/stm32mp2x/Kconfig create mode 100644 soc/st/stm32/stm32mp2x/Kconfig.defconfig create mode 100644 soc/st/stm32/stm32mp2x/Kconfig.defconfig.stm32mp257fxx create mode 100644 soc/st/stm32/stm32mp2x/Kconfig.soc create mode 100644 soc/st/stm32/stm32mp2x/m33/CMakeLists.txt create mode 100644 soc/st/stm32/stm32mp2x/m33/soc.h diff --git a/soc/st/stm32/soc.yml b/soc/st/stm32/soc.yml index 59d420ee09f..ce20e7d6f2f 100644 --- a/soc/st/stm32/soc.yml +++ b/soc/st/stm32/soc.yml @@ -193,6 +193,11 @@ family: - name: stm32mp13x socs: - name: stm32mp135fxx + - name: stm32mp2x + socs: + - name: stm32mp257fxx + cpuclusters: + - name: m33 - name: stm32n6x socs: - name: stm32n657xx diff --git a/soc/st/stm32/stm32mp2x/CMakeLists.txt b/soc/st/stm32/stm32mp2x/CMakeLists.txt new file mode 100644 index 00000000000..fdfdc3244a7 --- /dev/null +++ b/soc/st/stm32/stm32mp2x/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (C) 2025 Savoir-faire Linux, Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +zephyr_include_directories(.) + +if(CONFIG_CPU_CORTEX_M33) + add_subdirectory(m33) +endif() diff --git a/soc/st/stm32/stm32mp2x/Kconfig b/soc/st/stm32/stm32mp2x/Kconfig new file mode 100644 index 00000000000..016ee4ad207 --- /dev/null +++ b/soc/st/stm32/stm32mp2x/Kconfig @@ -0,0 +1,17 @@ +# STMicroelectronics STM32MP2 MPU series +# +# Copyright (C) 2025 Savoir-faire Linux, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_STM32MP2X + select ARM + select CPU_HAS_FPU + select HAS_STM32CUBE + +config SOC_STM32MP2X_M33 + select ARMV8_M_DSP + select ARM_TRUSTZONE_M + select CPU_CORTEX_M33 + select CPU_CORTEX_M_HAS_DWT + select CPU_HAS_ARM_MPU + select CPU_HAS_ARM_SAU diff --git a/soc/st/stm32/stm32mp2x/Kconfig.defconfig b/soc/st/stm32/stm32mp2x/Kconfig.defconfig new file mode 100644 index 00000000000..144368d8e1b --- /dev/null +++ b/soc/st/stm32/stm32mp2x/Kconfig.defconfig @@ -0,0 +1,10 @@ +# STMicroelectronics STM32MP2 MPU series +# +# Copyright (C) 2025 Savoir-faire Linux, Inc. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_SERIES_STM32MP2X + +rsource "Kconfig.defconfig.stm32mp2*" + +endif # SOC_SERIES_STM32MP2X diff --git a/soc/st/stm32/stm32mp2x/Kconfig.defconfig.stm32mp257fxx b/soc/st/stm32/stm32mp2x/Kconfig.defconfig.stm32mp257fxx new file mode 100644 index 00000000000..57a77780ee9 --- /dev/null +++ b/soc/st/stm32/stm32mp2x/Kconfig.defconfig.stm32mp257fxx @@ -0,0 +1,11 @@ +# STMicroelectronics STM32MP2 MPU series +# +# Copyright (C) 2025 Savoir-faire Linux, Inc. +# SPDX-License-Identifier: Apache-2.0 + +if SOC_STM32MP2X_M33 + +config NUM_IRQS + default 320 + +endif # SOC_STM32MP2X_M33 diff --git a/soc/st/stm32/stm32mp2x/Kconfig.soc b/soc/st/stm32/stm32mp2x/Kconfig.soc new file mode 100644 index 00000000000..92825e7a0c5 --- /dev/null +++ b/soc/st/stm32/stm32mp2x/Kconfig.soc @@ -0,0 +1,18 @@ +# STMicroelectronics STM32MP2 MPU series +# +# Copyright (C) 2025 Savoir-faire Linux, Inc. +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES_STM32MP2X + bool + select SOC_FAMILY_STM32 + +config SOC_SERIES + default "stm32mp2x" if SOC_SERIES_STM32MP2X + +config SOC_STM32MP2X_M33 + bool + select SOC_SERIES_STM32MP2X + +config SOC + default "stm32mp257fxx" if SOC_STM32MP2X_M33 diff --git a/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt b/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt new file mode 100644 index 00000000000..2ef552ce5ac --- /dev/null +++ b/soc/st/stm32/stm32mp2x/m33/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (C) 2025 Savoir-faire Linux, Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +zephyr_include_directories(${ZEPHYR_BASE}/drivers) + +zephyr_include_directories(.) diff --git a/soc/st/stm32/stm32mp2x/m33/soc.h b/soc/st/stm32/stm32mp2x/m33/soc.h new file mode 100644 index 00000000000..c517d443c67 --- /dev/null +++ b/soc/st/stm32/stm32mp2x/m33/soc.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2025 Savoir-faire Linux, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file SoC configuration macros for the STM32MP2 family processors. + * + * Based on reference manual: + * STM32MP23/25xx advanced ARM(r)-based 32/64-bit MPUs + * + * Chapter 2.4.2: Memory map and register boundary addresses + */ + +#ifndef _STM32MP2_M33_SOC_H_ +#define _STM32MP2_M33_SOC_H_ + +#ifndef _ASMLANGUAGE + +#include + +#endif /* !_ASMLANGUAGE */ + +#endif /* !_STM32MP2_M33_SOC_H_ */