Skip to content

Commit e3953f1

Browse files
youssefz24kartben
authored andcommitted
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>
1 parent 898eaa9 commit e3953f1

File tree

8 files changed

+102
-0
lines changed

8 files changed

+102
-0
lines changed

soc/st/stm32/soc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ family:
193193
- name: stm32mp13x
194194
socs:
195195
- name: stm32mp135fxx
196+
- name: stm32mp2x
197+
socs:
198+
- name: stm32mp257fxx
199+
cpuclusters:
200+
- name: m33
196201
- name: stm32n6x
197202
socs:
198203
- name: stm32n657xx

soc/st/stm32/stm32mp2x/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright (C) 2025 Savoir-faire Linux, Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_include_directories(.)
6+
7+
if(CONFIG_CPU_CORTEX_M33)
8+
add_subdirectory(m33)
9+
endif()

soc/st/stm32/stm32mp2x/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# STMicroelectronics STM32MP2 MPU series
2+
#
3+
# Copyright (C) 2025 Savoir-faire Linux, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config SOC_SERIES_STM32MP2X
7+
select ARM
8+
select CPU_HAS_FPU
9+
select HAS_STM32CUBE
10+
11+
config SOC_STM32MP2X_M33
12+
select ARMV8_M_DSP
13+
select ARM_TRUSTZONE_M
14+
select CPU_CORTEX_M33
15+
select CPU_CORTEX_M_HAS_DWT
16+
select CPU_HAS_ARM_MPU
17+
select CPU_HAS_ARM_SAU
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# STMicroelectronics STM32MP2 MPU series
2+
#
3+
# Copyright (C) 2025 Savoir-faire Linux, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if SOC_SERIES_STM32MP2X
7+
8+
rsource "Kconfig.defconfig.stm32mp2*"
9+
10+
endif # SOC_SERIES_STM32MP2X
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# STMicroelectronics STM32MP2 MPU series
2+
#
3+
# Copyright (C) 2025 Savoir-faire Linux, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if SOC_STM32MP2X_M33
7+
8+
config NUM_IRQS
9+
default 320
10+
11+
endif # SOC_STM32MP2X_M33

soc/st/stm32/stm32mp2x/Kconfig.soc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# STMicroelectronics STM32MP2 MPU series
2+
#
3+
# Copyright (C) 2025 Savoir-faire Linux, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config SOC_SERIES_STM32MP2X
7+
bool
8+
select SOC_FAMILY_STM32
9+
10+
config SOC_SERIES
11+
default "stm32mp2x" if SOC_SERIES_STM32MP2X
12+
13+
config SOC_STM32MP2X_M33
14+
bool
15+
select SOC_SERIES_STM32MP2X
16+
17+
config SOC
18+
default "stm32mp257fxx" if SOC_STM32MP2X_M33
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (C) 2025 Savoir-faire Linux, Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_include_directories(${ZEPHYR_BASE}/drivers)
6+
7+
zephyr_include_directories(.)

soc/st/stm32/stm32mp2x/m33/soc.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) 2025 Savoir-faire Linux, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file SoC configuration macros for the STM32MP2 family processors.
9+
*
10+
* Based on reference manual:
11+
* STM32MP23/25xx advanced ARM(r)-based 32/64-bit MPUs
12+
*
13+
* Chapter 2.4.2: Memory map and register boundary addresses
14+
*/
15+
16+
#ifndef _STM32MP2_M33_SOC_H_
17+
#define _STM32MP2_M33_SOC_H_
18+
19+
#ifndef _ASMLANGUAGE
20+
21+
#include <stm32mp2xx.h>
22+
23+
#endif /* !_ASMLANGUAGE */
24+
25+
#endif /* !_STM32MP2_M33_SOC_H_ */

0 commit comments

Comments
 (0)