Skip to content

Commit 819990b

Browse files
arnopofabiobaltieri
authored andcommitted
soc: stm32mp2x: m33: Add soc_early_init_hook to set system clock property
Add soc_early_init_hook() function to update the SystemCoreClock variable, which represents the reference clock. Signed-off-by: Arnaud Pouliquen <[email protected]>
1 parent 94a962e commit 819990b

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

soc/st/stm32/stm32mp2x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ config SOC_STM32MP2X_M33
1212
select ARMV8_M_DSP
1313
select ARM_TRUSTZONE_M
1414
select CPU_CORTEX_M33
15+
select SOC_EARLY_INIT_HOOK
1516
select CPU_CORTEX_M_HAS_DWT
1617
select CPU_HAS_ARM_MPU
1718
select CPU_HAS_ARM_SAU

soc/st/stm32/stm32mp2x/m33/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
zephyr_include_directories(${ZEPHYR_BASE}/drivers)
6+
zephyr_sources(
7+
soc.c
8+
)
69

710
zephyr_include_directories(.)
811

soc/st/stm32/stm32mp2x/m33/soc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief STM32MP25 Cortex-M33 initialization code
10+
*/
11+
12+
#include <soc.h>
13+
14+
/**
15+
* @brief Perform basic hardware initialization at boot.
16+
*
17+
* This needs to be run from the very beginning.
18+
*/
19+
void soc_early_init_hook(void)
20+
{
21+
/* Update CMSIS SystemCoreClock variable (HCLK) */
22+
SystemCoreClockUpdate();
23+
}

0 commit comments

Comments
 (0)