From 5ced8a4f6238eced868b7a5fe68ceab9fecaed72 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Tue, 12 Nov 2024 10:44:27 +0200 Subject: [PATCH] zephyr: lib/cpu.h: remove dependency to platform layer Remove dependency to platform cpu.h layer for Zephyr targets. The lib/cpu.h is now common to all SOF targets when building for Zephyr. Add a note to PLATFORM_PRIMARY_CORE_ID documentation that "primary core" is a SOF/application convention and not visible in Zephyr OS interfaces. Core 0 is the boot core in Zephyr, so use this definition as PLATFORM_PRIMARY_CORE_ID for all SOF targets. This was already the case in all platform definitions, so no functional change. In SOF, the primary/secondary distinction is primarily used in IPC code, together with Zephyr CONFIG_SMP_BOOT_DELAY=y. Signed-off-by: Kai Vehmanen --- zephyr/include/sof/lib/cpu.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zephyr/include/sof/lib/cpu.h b/zephyr/include/sof/lib/cpu.h index 349ad2af1..c23405e85 100644 --- a/zephyr/include/sof/lib/cpu.h +++ b/zephyr/include/sof/lib/cpu.h @@ -14,7 +14,15 @@ #ifndef __SOF_LIB_CPU_H__ #define __SOF_LIB_CPU_H__ -#include +/** + * \brief Id of primary DSP core + * + * SOF IPC protocols make a distinction between primary + * and secondary cores. In Zephyr, primary core id concept + * is not present in public OS interface, but in implementation + * zero is the boot core (see z_smp_init() in Zephyr). + */ +#define PLATFORM_PRIMARY_CORE_ID 0 #if !defined(__ASSEMBLER__) && !defined(LINKER)