soc: brcm: move init code from SYS_INIT to hooks

Replace SYS_INIT with SoC hooks and adapt SoC init code

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2024-09-10 09:42:29 -04:00 committed by Henrik Brix Andersen
parent 51c771ecb2
commit 5c541ffd30
3 changed files with 4 additions and 16 deletions

View File

@ -6,8 +6,10 @@ config SOC_BCM58402_M7
select CPU_CORTEX_M7
select CPU_CORTEX_M_HAS_SYSTICK
select CPU_HAS_ARM_MPU
select SOC_EARLY_INIT_HOOK
config SOC_BCM58402_A72
select ARM64
select CPU_CORTEX_A72
select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS
select SOC_EARLY_INIT_HOOK

View File

@ -13,11 +13,8 @@
* @brief Perform basic hardware initialization at boot.
*
* This needs to be run from the very beginning.
* So the init priority has to be 0 (zero).
*
* @return 0
*/
static int viper_init(void)
void soc_early_init_hook(void)
{
uint32_t key;
uint32_t data;
@ -35,8 +32,4 @@ static int viper_init(void)
sys_write32(data, LS_ICFG_PMON_LITE_SW_RESETN);
irq_unlock(key);
return 0;
}
SYS_INIT(viper_init, PRE_KERNEL_1, 0);

View File

@ -13,11 +13,8 @@
* @brief Perform basic hardware initialization at boot.
*
* This needs to be run from the very beginning.
* So the init priority has to be 0 (zero).
*
* @return 0
*/
static int viper_init(void)
void soc_early_init_hook(void)
{
uint32_t data;
@ -29,8 +26,4 @@ static int viper_init(void)
data = sys_read32(LS_ICFG_PMON_LITE_SW_RESETN);
data |= PCIE_PMON_LITE_SW_RESETN;
sys_write32(data, LS_ICFG_PMON_LITE_SW_RESETN);
return 0;
}
SYS_INIT(viper_init, PRE_KERNEL_1, 0);