1 /* 2 * Copyright (c) 2016 Open-RnD Sp. z o.o. 3 * Copyright (c) 2016 BayLibre, SAS 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 /** 9 * @file 10 * @brief System/hardware module for STM32L4 processor 11 */ 12 13 #include <zephyr/device.h> 14 #include <zephyr/init.h> 15 #include <zephyr/logging/log.h> 16 17 #include <cmsis_core.h> 18 19 #define LOG_LEVEL CONFIG_SOC_LOG_LEVEL 20 LOG_MODULE_REGISTER(soc); 21 22 23 /** 24 * @brief Perform basic hardware initialization at boot. 25 * 26 * This needs to be run from the very beginning. 27 * So the init priority has to be 0 (zero). 28 * 29 * @return 0 30 */ stm32l4_init(void)31static int stm32l4_init(void) 32 { 33 /* Update CMSIS SystemCoreClock variable (HCLK) */ 34 /* At reset, system core clock is set to 4 MHz from MSI */ 35 SystemCoreClock = 4000000; 36 37 return 0; 38 } 39 40 SYS_INIT(stm32l4_init, PRE_KERNEL_1, 0); 41