soc: snps: 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:
parent
a018f9d5ec
commit
49f7204530
4 changed files with 8 additions and 14 deletions
|
@ -6,3 +6,4 @@ config SOC_ARC_IOT
|
||||||
select ARC
|
select ARC
|
||||||
select CPU_HAS_MPU
|
select CPU_HAS_MPU
|
||||||
select CPU_HAS_FPU
|
select CPU_HAS_FPU
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -15,14 +15,7 @@
|
||||||
|
|
||||||
#define CPU_FREQ DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)
|
#define CPU_FREQ DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)
|
||||||
|
|
||||||
static int arc_iot_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
|
arc_iot_pll_fout_config(CPU_FREQ / 1000000);
|
||||||
if (arc_iot_pll_fout_config(CPU_FREQ / 1000000) < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(arc_iot_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -4,12 +4,16 @@
|
||||||
|
|
||||||
config SOC_EMSK
|
config SOC_EMSK
|
||||||
select ARC
|
select ARC
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
||||||
config SOC_EMSK_EM7D
|
config SOC_EMSK_EM7D
|
||||||
select CPU_HAS_MPU
|
select CPU_HAS_MPU
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
||||||
config SOC_EMSK_EM9D
|
config SOC_EMSK_EM9D
|
||||||
select CPU_HAS_FPU
|
select CPU_HAS_FPU
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
||||||
config SOC_EMSK_EM11D
|
config SOC_EMSK_EM11D
|
||||||
select CPU_HAS_FPU
|
select CPU_HAS_FPU
|
||||||
|
select SOC_EARLY_INIT_HOOK
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#ifdef CONFIG_UART_NS16550
|
#ifdef CONFIG_UART_NS16550
|
||||||
|
|
||||||
static int uart_ns16550_init(void)
|
void soc_early_init_hook(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* On ARC EM Starter kit board,
|
/* On ARC EM Starter kit board,
|
||||||
|
@ -25,10 +25,6 @@ static int uart_ns16550_init(void)
|
||||||
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x4);
|
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x4);
|
||||||
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x10);
|
sys_write32(0, DT_REG_ADDR(DT_INST(1, ns16550))+0x10);
|
||||||
#endif /* DT_NODE_HAS_STATUS(DT_INST(1, ns16550), okay) */
|
#endif /* DT_NODE_HAS_STATUS(DT_INST(1, ns16550), okay) */
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
||||||
#endif /* CONFIG_UART_NS16550 */
|
#endif /* CONFIG_UART_NS16550 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue