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 <youssef.zini@savoirfairelinux.com>
This commit is contained in:
Youssef Zini 2025-03-28 13:43:08 +01:00 committed by Benjamin Cabé
commit e3953f10ad
8 changed files with 102 additions and 0 deletions

View file

@ -193,6 +193,11 @@ family:
- name: stm32mp13x
socs:
- name: stm32mp135fxx
- name: stm32mp2x
socs:
- name: stm32mp257fxx
cpuclusters:
- name: m33
- name: stm32n6x
socs:
- name: stm32n657xx

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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(.)

View file

@ -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 <stm32mp2xx.h>
#endif /* !_ASMLANGUAGE */
#endif /* !_STM32MP2_M33_SOC_H_ */