Commit d590c186 authored by Anas Nashif's avatar Anas Nashif Committed by Carles Cufi
Browse files

intel_adsp: ace: call soc_num_cpus_init early



Restore order of execution. Code that was run in EARLY init level is now
too late.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent c79bbfad
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@

extern FUNC_NORETURN void z_cstart(void);

/* defined by the SoC in case of CONFIG_SOC_HAS_RUNTIME_NUM_CPUS=y */
extern void soc_num_cpus_init(void);

/**
 *
 * @brief Prepare to and run C code
@@ -17,6 +20,10 @@ extern FUNC_NORETURN void z_cstart(void);
 */
void z_prep_c(void)
{
#if CONFIG_SOC_HAS_RUNTIME_NUM_CPUS
	soc_num_cpus_init();
#endif

	_cpu_t *cpu0 = &_kernel.cpus[0];

#ifdef CONFIG_KERNEL_COHERENCE
+1 −3
Original line number Diff line number Diff line
@@ -73,15 +73,13 @@ static void ipc_isr(void *arg)

unsigned int soc_num_cpus;

static __imr int soc_num_cpus_init(void)
__imr void soc_num_cpus_init(void)
{
	/* Need to set soc_num_cpus early to arch_num_cpus() works properly */
	soc_num_cpus = ((sys_read32(DFIDCCP) >> CAP_INST_SHIFT) & CAP_INST_MASK) + 1;
	soc_num_cpus = MIN(CONFIG_MP_MAX_NUM_CPUS, soc_num_cpus);

	return 0;
}
SYS_INIT(soc_num_cpus_init, EARLY, 1);

void soc_mp_init(void)
{