Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.21.0)
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(sample_sof)
Expand Down
23 changes: 14 additions & 9 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ tests:
tags: sof
build_only: true
platform_allow:
intel_adsp_cavs25 intel_adsp_ace15_mtpm intel_adsp_ace20_lnl
nxp_adsp_imx8 nxp_adsp_imx8x nxp_adsp_imx8m
- intel_adsp/cavs25
- intel_adsp/ace15_mtpm
- intel_adsp/ace20_lnl
- imx8qm_mek/mimx8qm6/adsp
- imx8qxp_mek/mimx8qx6/adsp
- imx8mp_evk/mimx8ml8/adsp
- imx8ulp_evk/mimx8ud7/adsp

integration_platforms:
- intel_adsp_cavs25 # TGL
- intel_adsp_ace15_mtpm # MTL
- intel_adsp_ace20_lnl
- nxp_adsp_imx8
- nxp_adsp_imx8x
- nxp_adsp_imx8m
- nxp_adsp_imx8ulp
- intel_adsp/cavs25 # TGL
- intel_adsp/ace15_mtpm # MTL
- intel_adsp/ace20_lnl
- imx8qm_mek/mimx8qm6/adsp
- imx8qxp_mek/mimx8qx6/adsp
- imx8mp_evk/mimx8ml8/adsp
- imx8ulp_evk/mimx8ud7/adsp
16 changes: 8 additions & 8 deletions scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,56 +90,56 @@ class PlatformConfig:
platform_configs_all = {
# Intel platforms
"tgl" : PlatformConfig(
"intel", "intel_adsp_cavs25",
"intel", "intel_adsp/cavs25",
f"RG-2017.8{xtensa_tools_version_postfix}",
"cavs2x_LX6HiFi3_2017_8",
"xcc",
aliases = ['adl', 'adl-n', 'ehl', 'rpl'],
ipc4 = True
),
"tgl-h" : PlatformConfig(
"intel", "intel_adsp_cavs25_tgph",
"intel", "intel_adsp/cavs25/tgph",
f"RG-2017.8{xtensa_tools_version_postfix}",
"cavs2x_LX6HiFi3_2017_8",
"xcc",
aliases = ['adl-s', 'rpl-s'],
ipc4 = True
),
"mtl" : PlatformConfig(
"intel", "intel_adsp_ace15_mtpm",
"intel", "intel_adsp/ace15_mtpm",
f"RI-2022.10{xtensa_tools_version_postfix}",
"ace10_LX7HiFi4_2022_10",
aliases = ['arl', 'arl-s'],
ipc4 = True
),
"lnl" : PlatformConfig(
"intel", "intel_adsp_ace20_lnl",
"intel", "intel_adsp/ace20_lnl",
f"RI-2022.10{xtensa_tools_version_postfix}",
"ace10_LX7HiFi4_2022_10",
ipc4 = True
),

# NXP platforms
"imx8" : PlatformConfig(
"imx", "nxp_adsp_imx8",
"imx", "imx8qm_mek/mimx8qm6/adsp",
f"RI-2023.11{xtensa_tools_version_postfix}",
"hifi4_nxp_v5_3_1_prod",
RIMAGE_KEY = "key param ignored by imx8",
),
"imx8x" : PlatformConfig(
"imx", "nxp_adsp_imx8x",
"imx", "imx8qxp_mek/mimx8qx6/adsp",
f"RI-2023.11{xtensa_tools_version_postfix}",
"hifi4_nxp_v5_3_1_prod",
RIMAGE_KEY = "key param ignored by imx8x"
),
"imx8m" : PlatformConfig(
"imx", "nxp_adsp_imx8m",
"imx", "imx8mp_evk/mimx8ml8/adsp",
f"RI-2023.11{xtensa_tools_version_postfix}",
"hifi4_mscale_v2_0_2_prod",
RIMAGE_KEY = "key param ignored by imx8m"
),
"imx8ulp" : PlatformConfig(
"imx", "nxp_adsp_imx8ulp",
"imx", "imx8ulp_evk/mimx8ud7/adsp",
f"RI-2023.11{xtensa_tools_version_postfix}",
"hifi4_nxp2_s7_v2_1a_prod",
RIMAGE_KEY = "key param ignored by imx8ulp"
Expand Down
6 changes: 3 additions & 3 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sof/lib/cpu.h>
#include <rtos/init.h>
#include <platform/lib/clk.h>
#if defined(CONFIG_SOC_SERIES_INTEL_ACE)
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
#include <intel_adsp_hda.h>
#endif

Expand All @@ -24,7 +24,7 @@
#include <zephyr/logging/log_ctrl.h>

/* TODO: Remove platform-specific code, see https://github.com/thesofproject/sof/issues/7549 */
#if defined(CONFIG_SOC_SERIES_INTEL_ACE) || defined(CONFIG_INTEL_ADSP_CAVS)
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) || defined(CONFIG_INTEL_ADSP_CAVS)
# define INTEL_ADSP 1
#endif

Expand Down Expand Up @@ -421,7 +421,7 @@ static int basefw_power_state_info_get(uint32_t *data_offset, char *data)

static int fw_config_set_force_l1_exit(const struct sof_tlv *tlv)
{
#if defined(CONFIG_SOC_SERIES_INTEL_ACE)
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
const uint32_t force = tlv->value[0];

if (force) {
Expand Down
2 changes: 1 addition & 1 deletion src/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <zephyr/logging/log_ctrl.h>
#include <user/abi_dbg.h>
#include <sof_versions.h>
#include <version.h>
#include <zephyr/version.h>
#endif
#include <sof/lib/ams.h>

Expand Down
2 changes: 1 addition & 1 deletion src/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zephyr_library_sources(
dma-copy.c
)

if (CONFIG_SOC_SERIES_INTEL_CAVS_V25 OR CONFIG_SOC_SERIES_INTEL_ACE)
if (CONFIG_SOC_SERIES_INTEL_CAVS_V25 OR CONFIG_SOC_SERIES_INTEL_ADSP_ACE)
zephyr_library_sources(
ipc-zephyr.c
)
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/ipc-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Andrey Borisovich <[email protected]>
// Adrian Warecki <[email protected]>

#include <autoconf.h>
#include <zephyr/autoconf.h>

#include <intel_adsp_ipc.h>
#include <sof/ipc/common.h>
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <rtos/wait.h>

/* TODO: Remove platform-specific code, see https://github.com/thesofproject/sof/issues/7549 */
#if defined(CONFIG_SOC_SERIES_INTEL_ACE) || defined(CONFIG_INTEL_ADSP_CAVS)
#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_ACE) || defined(CONFIG_INTEL_ADSP_CAVS)
#define RIMAGE_MANIFEST 1
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/trace/dma-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <sof_versions.h>

#ifdef __ZEPHYR__
#include <version.h>
#include <zephyr/version.h>
#endif

#include <errno.h>
Expand Down
10 changes: 5 additions & 5 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ if (CONFIG_SOC_SERIES_INTEL_CAVS_V25)
endif()

# Intel ACE 1.5 and newer platforms
if (CONFIG_SOC_SERIES_INTEL_ACE)
if (CONFIG_SOC_SERIES_INTEL_ADSP_ACE)

# Platform sources
zephyr_library_sources(
Expand Down Expand Up @@ -232,7 +232,7 @@ if (CONFIG_SOC_SERIES_INTEL_ACE)
endif()

# NXP IMX8 platforms
if (CONFIG_SOC_SERIES_NXP_IMX8)
if (CONFIG_SOC_MIMX8QM6_ADSP OR CONFIG_SOC_MIMX8QX6_ADSP)
zephyr_library_sources(
${SOF_DRIVERS_PATH}/generic/dummy-dma.c
${SOF_DRIVERS_PATH}/imx/edma.c
Expand Down Expand Up @@ -261,7 +261,7 @@ if (CONFIG_SOC_SERIES_NXP_IMX8)
set(PLATFORM "imx8")
endif()

if (CONFIG_SOC_SERIES_NXP_IMX8M)
if (CONFIG_SOC_MIMX8ML8_ADSP)
zephyr_library_sources(
${SOF_DRIVERS_PATH}/generic/dummy-dma.c
${SOF_DRIVERS_PATH}/imx/sdma.c
Expand Down Expand Up @@ -290,7 +290,7 @@ if (CONFIG_SOC_SERIES_NXP_IMX8M)
set(PLATFORM "imx8m")
endif()

if (CONFIG_SOC_SERIES_NXP_IMX8ULP)
if (CONFIG_SOC_MIMX8UD7_ADSP)
zephyr_library_sources(
${SOF_DRIVERS_PATH}/generic/dummy-dma.c
${SOF_DRIVERS_PATH}/imx/edma.c
Expand Down Expand Up @@ -318,7 +318,7 @@ if (CONFIG_SOC_SERIES_NXP_IMX8ULP)
set(PLATFORM "imx8ulp")
endif()

if (CONFIG_SOC_SERIES_MIMX9_A55)
if (CONFIG_SOC_MIMX9352_A55)
# Platform sources
zephyr_library_sources(
${SOF_PLATFORM_PATH}/imx93_a55/platform.c
Expand Down
10 changes: 5 additions & 5 deletions zephyr/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/policy.h>
#include <version.h>
#include <zephyr/version.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/cache.h>

Expand Down Expand Up @@ -116,7 +116,7 @@ static inline uintptr_t get_l3_heap_start(void)
* - main_fw_load_offset
* - main fw size in manifest
*/
return (uintptr_t)z_soc_uncached_ptr((__sparse_force void __sparse_cache *)
return (uintptr_t)sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)
ROUND_UP(IMR_L3_HEAP_BASE, L3_MEM_PAGE_SIZE));
}

Expand Down Expand Up @@ -146,7 +146,7 @@ static bool is_l3_heap_pointer(void *ptr)
uintptr_t l3_heap_end = l3_heap_start + get_l3_heap_size();

if (is_cached(ptr))
ptr = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)ptr);
ptr = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)ptr);

if ((POINTER_TO_UINT(ptr) >= l3_heap_start) && (POINTER_TO_UINT(ptr) < l3_heap_end))
return true;
Expand Down Expand Up @@ -199,7 +199,7 @@ static void __sparse_cache *heap_alloc_aligned_cached(struct k_heap *h,

#ifdef CONFIG_SOF_ZEPHYR_HEAP_CACHED
if (ptr)
ptr = z_soc_cached_ptr((__sparse_force void *)ptr);
ptr = sys_cache_cached_ptr_get((__sparse_force void *)ptr);
#endif

return ptr;
Expand All @@ -212,7 +212,7 @@ static void heap_free(struct k_heap *h, void *mem)
void *mem_uncached;

if (is_cached(mem)) {
mem_uncached = z_soc_uncached_ptr((__sparse_force void __sparse_cache *)mem);
mem_uncached = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)mem);
sys_cache_data_flush_and_invd_range(mem,
sys_heap_usable_size(&h->heap, mem_uncached));

Expand Down
57 changes: 11 additions & 46 deletions zephyr/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#include <rtos/alloc.h>

/* Zephyr includes */
#include <version.h>
#include <zephyr/version.h>
#include <zephyr/kernel.h>
#include <zephyr/kernel/smp.h>
#include <zephyr/device.h>
#include <zephyr/drivers/mm/mm_drv_intel_adsp_mtl_tlb.h>

Expand All @@ -27,37 +28,13 @@
extern K_KERNEL_STACK_ARRAY_DEFINE(z_interrupt_stacks, CONFIG_MP_MAX_NUM_CPUS,
CONFIG_ISR_STACK_SIZE);

static atomic_t start_flag;
static atomic_t ready_flag;

/* Zephyr kernel_internal.h interface */
extern void smp_timer_init(void);

static FUNC_NORETURN void secondary_init(void *arg)
static void secondary_init(void *arg)
{
struct k_thread dummy_thread;

/*
* This is an open-coded version of zephyr/kernel/smp.c
* smp_init_top(). We do this so that we can call SOF
* secondary_core_init() for each core.
*/

atomic_set(&ready_flag, 1);
z_smp_thread_init(arg, &dummy_thread);
smp_timer_init();

secondary_core_init(sof_get());

#ifdef CONFIG_THREAD_STACK_INFO
dummy_thread.stack_info.start = (uintptr_t)z_interrupt_stacks +
arch_curr_cpu()->id * Z_KERNEL_STACK_LEN(CONFIG_ISR_STACK_SIZE);
dummy_thread.stack_info.size = Z_KERNEL_STACK_LEN(CONFIG_ISR_STACK_SIZE);
#endif

z_smp_thread_swap();

CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
}

#if CONFIG_ZEPHYR_NATIVE_DRIVERS
Expand Down Expand Up @@ -131,13 +108,10 @@ void cpu_notify_state_exit(enum pm_state state)

int cpu_enable_core(int id)
{
bool cpu_resume = true;

/* only called from single core, no RMW lock */
__ASSERT_NO_MSG(cpu_is_primary(arch_proc_id()));
/*
* This is an open-coded version of zephyr/kernel/smp.c
* z_smp_start_cpu(). We do this, so we can use a customized
* secondary_init() for SOF.
*/

if (arch_cpu_active(id))
return 0;
Expand All @@ -149,20 +123,19 @@ int cpu_enable_core(int id)
* and the idle thread stack.
*/
if (pm_state_next_get(id)->state == PM_STATE_ACTIVE)
z_init_cpu(id);
cpu_resume = false;
#endif

atomic_clear(&start_flag);
atomic_clear(&ready_flag);

arch_start_cpu(id, z_interrupt_stacks[id], CONFIG_ISR_STACK_SIZE,
secondary_init, &start_flag);
if (cpu_resume)
k_smp_cpu_resume(id, secondary_init, NULL, true, false);
else
k_smp_cpu_start(id, secondary_init, NULL);

while (!atomic_get(&ready_flag))
k_busy_wait(100);

atomic_set(&start_flag, 1);

return 0;
}

Expand Down Expand Up @@ -248,21 +221,13 @@ int cpu_enable_secondary_core(int id)
if (arch_cpu_active(id))
return 0;

#if ZEPHYR_VERSION(3, 0, 99) <= ZEPHYR_VERSION_CODE
z_init_cpu(id);
#endif

atomic_clear(&start_flag);
atomic_clear(&ready_flag);

arch_start_cpu(id, z_interrupt_stacks[id], CONFIG_ISR_STACK_SIZE,
secondary_init, &start_flag);
k_smp_cpu_start(id, secondary_init, NULL);

while (!atomic_get(&ready_flag))
k_busy_wait(100);

atomic_set(&start_flag, 1);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion zephyr/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <zephyr/kernel_structs.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/policy.h>
#include <version.h>
#include <zephyr/version.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/logging/log.h>
Expand Down