Skip to content
Permalink
Browse files

soc: arm: nordic_nrf: force platform-specific initialization

This commit enforces platform-specific initialization
for nRF SoC family. The specific platform initialization
hook is invoked directly after reset and calls the nRFx
SystemInit() function.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information...
ioannisg authored and nashif committed May 22, 2019
1 parent 1ba8c34 commit 8d6346ef650ef952eaec3f651361cd97040ad0e5
@@ -7,6 +7,7 @@

config SOC_FAMILY_NRF
select SOC_COMPATIBLE_NRF
select PLATFORM_SPECIFIC_INIT
bool
# omit prompt to signify a "hidden" option

@@ -47,8 +47,6 @@ static int nordicsemi_nrf51_init(struct device *arg)

key = irq_lock();

SystemInit();

/* Install default handler that simply resets the CPU
* if configured in the kernel, NOP otherwise
*/
@@ -71,4 +69,9 @@ void z_arch_busy_wait(u32_t time_us)
nrfx_coredep_delay_us(time_us);
}

void z_platform_init(void)
{
SystemInit();
}

SYS_INIT(nordicsemi_nrf51_init, PRE_KERNEL_1, 0);
@@ -60,8 +60,6 @@ static int nordicsemi_nrf52_init(struct device *arg)

key = irq_lock();

SystemInit();

#ifdef CONFIG_NRF_ENABLE_ICACHE
/* Enable the instruction cache */
NRF_NVMC->ICACHECNF = NVMC_ICACHECNF_CACHEEN_Msk;
@@ -86,4 +84,9 @@ void z_arch_busy_wait(u32_t time_us)
nrfx_coredep_delay_us(time_us);
}

void z_platform_init(void)
{
SystemInit();
}

SYS_INIT(nordicsemi_nrf52_init, PRE_KERNEL_1, 0);
@@ -43,8 +43,6 @@ static int nordicsemi_nrf91_init(struct device *arg)

key = irq_lock();

SystemInit();

#ifdef CONFIG_NRF_ENABLE_ICACHE
/* Enable the instruction cache */
NRF_NVMC->ICACHECNF = NVMC_ICACHECNF_CACHEEN_Msk;
@@ -65,5 +63,10 @@ void z_arch_busy_wait(u32_t time_us)
nrfx_coredep_delay_us(time_us);
}

void z_platform_init(void)
{
SystemInit();
}


SYS_INIT(nordicsemi_nrf91_init, PRE_KERNEL_1, 0);

0 comments on commit 8d6346e

Please sign in to comment.
You can’t perform that action at this time.