Skip to content

Commit

Permalink
zephyr: lib/cpu.h: remove dependency to platform layer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kv2019i committed Nov 12, 2024
1 parent 7303db2 commit 198c718
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion zephyr/include/sof/lib/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@
#ifndef __SOF_LIB_CPU_H__
#define __SOF_LIB_CPU_H__

#include <platform/lib/cpu.h>
/**
* \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)

Expand Down

0 comments on commit 198c718

Please sign in to comment.