diff --git a/CODEOWNERS b/CODEOWNERS index e06147afb8cb..551110534d13 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -48,6 +48,7 @@ src/audio/google/* @thesofproject/google # platforms src/kernel/platform/imx8/** @dbaluta +src/platform/imx8/** @dbaluta src/kernel/platform/amd/** @bhiregoudar @sunilkumardommati src/kernel/platform/mtk/** @yaochunhung @kuanhsuncheng diff --git a/scripts/kernel_user_partition.txt b/scripts/kernel_user_partition.txt index 35229aecb7e7..94315f02ea51 100644 --- a/scripts/kernel_user_partition.txt +++ b/scripts/kernel_user_partition.txt @@ -27,7 +27,10 @@ src/audio/host-legacy.c # SOF headers that only kernel code may include. # Not listed on purpose: rtos/init.h, which only provides the -# SOF_MODULE_INIT() registration hook used by every module. +# SOF_MODULE_INIT() registration hook used by every module, and +# sof/lib/mailbox.h: the mailbox windows are mapped into the user-space +# LL and IPC threads, and their layout is in the user-space platform +# headers in src/platform. [kernel-headers] src/include/sof/drivers/* src/include/sof/platform.h @@ -35,7 +38,6 @@ src/include/sof/llext_manager.h src/include/sof/ipc/driver.h src/include/sof/lib/agent.h src/include/sof/lib/cpu-clk-manager.h -src/include/sof/lib/mailbox.h src/include/sof/lib/perf_cnt.h src/include/sof/lib/watchdog.h src/kernel/platform/* @@ -55,9 +57,12 @@ zephyr/include/sof/lib/vpage.h # Zephyr headers that only kernel code may include: kernel internals and # driver APIs that are not system calls. +# Not listed on purpose: zephyr/drivers/dma.h. Its types and constants are +# the arguments of the sof_dma_*() system calls in sof/lib/sof_dma.h, so +# user-space code needs them. User-space code must not call its dma_*() +# driver functions directly, which this include check cannot catch. [zephyr-kernel-headers] kernel/include/* -include/zephyr/drivers/dma.h include/zephyr/pm/device_runtime.h # User-space sources that still include kernel-only headers, removed one @@ -65,42 +70,25 @@ include/zephyr/pm/device_runtime.h # other user-space source is an error, so this list must only shrink. # It covers the CI build configurations and the user-space overlays. [leak-baseline] -src/audio/asrc/asrc.c -src/audio/chain_dma.c src/audio/component.c src/audio/copier/copier.c -src/audio/copier/copier_dai.c -src/audio/copier/copier_gain.c -src/audio/copier/copier_host.c -src/audio/copier/copier_ipcgtw.c src/audio/dai-zephyr.c -src/audio/data_blob.c -src/audio/host-zephyr.c -src/audio/intel_uaol.c src/audio/kpb.c src/audio/module_adapter/iadk/kpb_service.cpp src/audio/module_adapter/iadk/system_agent.cpp src/audio/module_adapter/iadk/timestamping_service_provider.cpp src/audio/module_adapter/library/native_system_service.c -src/audio/module_adapter/module_adapter_ipc4.c src/audio/pipeline/pipeline-graph.c src/audio/pipeline/pipeline-schedule.c src/audio/pipeline/pipeline-stream.c src/audio/pipeline/pipeline-xrun.c -src/audio/volume/volume.c -src/audio/volume/volume_ipc4.c src/debug/tester/tester_simple_dram_test.c -src/ipc/ipc-common.c src/ipc/ipc-helper.c src/ipc/ipc4/dai.c src/ipc/ipc4/handler-user.c src/ipc/ipc4/helper.c -src/lib/dai.c -src/lib/dma.c src/lib/notifier.c src/samples/audio/detect_test.c src/schedule/zephyr_domain.c src/schedule/zephyr_dp_schedule.c -src/schedule/zephyr_dp_schedule_application.c -src/schedule/zephyr_dp_schedule_thread.c src/schedule/zephyr_ll.c diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 40d0a9f4902a..2cbdfe998a2c 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/include/sof/lib/mailbox.h b/src/include/sof/lib/mailbox.h index ae667f0d0c4c..5dbf0160332c 100644 --- a/src/include/sof/lib/mailbox.h +++ b/src/include/sof/lib/mailbox.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/src/include/sof/schedule/ll_schedule_domain.h b/src/include/sof/schedule/ll_schedule_domain.h index 1ef47c005589..c86e37e8b1a5 100644 --- a/src/include/sof/schedule/ll_schedule_domain.h +++ b/src/include/sof/schedule/ll_schedule_domain.h @@ -18,7 +18,10 @@ #include #include #include +#ifndef __ZEPHYR__ +/* for clock_ms_to_ticks() in domain_init() */ #include +#endif #include #include #include diff --git a/src/kernel/arch/host/CMakeLists.txt b/src/kernel/arch/host/CMakeLists.txt index bc700f509094..4821aefb6019 100644 --- a/src/kernel/arch/host/CMakeLists.txt +++ b/src/kernel/arch/host/CMakeLists.txt @@ -3,6 +3,7 @@ # includes target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/src/kernel/arch/host/include) target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/src/kernel/platform/library/include) +target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/library/include) include(CheckCCompilerFlag) if (NOT CONFIG_SOF_ZEPHYR_STRICT_HEADERS) diff --git a/src/kernel/audio/base_fw.c b/src/kernel/audio/base_fw.c index 880306a4a03b..0ccf866b036e 100644 --- a/src/kernel/audio/base_fw.c +++ b/src/kernel/audio/base_fw.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/src/kernel/audio/base_fw_intel.c b/src/kernel/audio/base_fw_intel.c index 3d25f89dbd18..43ba7d0011dc 100644 --- a/src/kernel/audio/base_fw_intel.c +++ b/src/kernel/audio/base_fw_intel.c @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/src/kernel/ipc/ipc3/host-page-table.c b/src/kernel/ipc/ipc3/host-page-table.c index 4e42b21ac825..56b2335a3a76 100644 --- a/src/kernel/ipc/ipc3/host-page-table.c +++ b/src/kernel/ipc/ipc3/host-page-table.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/src/kernel/platform/README.md b/src/kernel/platform/README.md index b3aa7014290a..77112340a10e 100644 --- a/src/kernel/platform/README.md +++ b/src/kernel/platform/README.md @@ -1,7 +1,8 @@ # Platform Support (`src/kernel/platform`) -> **Runs in:** Kernel-only — platform bring-up, memory maps, interrupt wiring and IPC mailbox -> windows are supervisor-context concerns and never run in a user thread. See +> **Runs in:** Kernel-only — platform bring-up, memory maps and interrupt wiring are +> supervisor-context concerns and never run in a user thread. The mailbox headers, which +> user-space code uses, are in [`src/platform`](../../platform/README.md). See > [User/kernel split](../../include/sof/userspace/README.md). This directory contains SoC/platform-specific integration (e.g. Intel ACE, MediaTek, i.MX), diff --git a/src/kernel/platform/ace30/include/platform/lib/memory.h b/src/kernel/platform/ace30/include/platform/lib/memory.h index 5953d6309c57..a66c1aa0cbf1 100644 --- a/src/kernel/platform/ace30/include/platform/lib/memory.h +++ b/src/kernel/platform/ace30/include/platform/lib/memory.h @@ -17,29 +17,7 @@ #include #include -/* HP SRAM windows */ -#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) - -/* window 0 */ -#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) -#define SRAM_SW_REG_SIZE 0x1000 - -#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) -#define SRAM_OUTBOX_SIZE 0x1000 - -/* window 1 */ -#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) -#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) - -/* window 2 */ -#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) -#define SRAM_DEBUG_SIZE 0x800 - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 +#include /* Stack configuration */ #define SOF_STACK_SIZE 0x1000 diff --git a/src/kernel/platform/imx8/include/platform/lib/memory.h b/src/kernel/platform/imx8/include/platform/lib/memory.h index 0388e2481c6b..4127dfe160a2 100644 --- a/src/kernel/platform/imx8/include/platform/lib/memory.h +++ b/src/kernel/platform/imx8/include/platform/lib/memory.h @@ -26,7 +26,6 @@ #define SDRAM0_BASE 0x92400000 #define SDRAM0_SIZE 0x800000 -#define SDRAM1_BASE 0x92C00000 #define SDRAM1_SIZE 0x800000 #define XSHAL_MU13_SIDEB_BYPASS_PADDR 0x5D310000 @@ -72,30 +71,7 @@ * +---------------------+----------------+-----------------------------------+ */ -/* Mailbox configuration */ -#define SRAM_OUTBOX_BASE SDRAM1_BASE -#define SRAM_OUTBOX_SIZE 0x1000 -#define SRAM_OUTBOX_OFFSET 0 - -#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) -#define SRAM_INBOX_SIZE 0x1000 -#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE - -#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) -#define SRAM_DEBUG_SIZE 0x800 -#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 -#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 -#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) - -#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) -#define SRAM_TRACE_SIZE 0x1000 -#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) +#include #define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \ + SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \ diff --git a/src/kernel/platform/imx8m/include/platform/lib/memory.h b/src/kernel/platform/imx8m/include/platform/lib/memory.h index fd0034a7fba3..5408dd847a60 100644 --- a/src/kernel/platform/imx8m/include/platform/lib/memory.h +++ b/src/kernel/platform/imx8m/include/platform/lib/memory.h @@ -26,7 +26,6 @@ #define SDRAM0_BASE 0x92400000 #define SDRAM0_SIZE 0x800000 -#define SDRAM1_BASE 0x92C00000 #define SDRAM1_SIZE 0x800000 #define XSHAL_MU2_SIDEB_BYPASS_PADDR 0x30E70000 @@ -90,30 +89,7 @@ * +---------------------+----------------+-----------------------------------+ */ -/* Mailbox configuration */ -#define SRAM_OUTBOX_BASE SDRAM1_BASE -#define SRAM_OUTBOX_SIZE 0x1000 -#define SRAM_OUTBOX_OFFSET 0 - -#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) -#define SRAM_INBOX_SIZE 0x1000 -#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE - -#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) -#define SRAM_DEBUG_SIZE 0x800 -#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 -#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 -#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) - -#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) -#define SRAM_TRACE_SIZE 0x1000 -#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) +#include #define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \ + SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \ diff --git a/src/kernel/platform/imx8ulp/include/platform/lib/memory.h b/src/kernel/platform/imx8ulp/include/platform/lib/memory.h index e8c18b00c58c..55b8bdf2bd8d 100644 --- a/src/kernel/platform/imx8ulp/include/platform/lib/memory.h +++ b/src/kernel/platform/imx8ulp/include/platform/lib/memory.h @@ -23,7 +23,6 @@ #define SDRAM0_BASE 0x1a000000 #define SDRAM0_SIZE 0x800000 -#define SDRAM1_BASE 0x1a800000 #define SDRAM1_SIZE 0x800000 /* physical address in Arm side */ @@ -74,30 +73,7 @@ * +---------------------+----------------+-----------------------------------+ */ -/* Mailbox configuration */ -#define SRAM_OUTBOX_BASE SDRAM1_BASE -#define SRAM_OUTBOX_SIZE 0x1000 -#define SRAM_OUTBOX_OFFSET 0 - -#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) -#define SRAM_INBOX_SIZE 0x1000 -#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE - -#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) -#define SRAM_DEBUG_SIZE 0x2800 -#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 -#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 -#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) - -#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) -#define SRAM_TRACE_SIZE 0x1000 -#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) +#include #define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \ + SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \ diff --git a/src/kernel/platform/library/include/platform/lib/memory.h b/src/kernel/platform/library/include/platform/lib/memory.h index 512aa643e952..7342da638337 100644 --- a/src/kernel/platform/library/include/platform/lib/memory.h +++ b/src/kernel/platform/library/include/platform/lib/memory.h @@ -24,9 +24,7 @@ struct sof; #define SOF_STACK_SIZE (CONFIG_SOF_STACK_SIZE) -uint8_t *get_library_mailbox(void); - -#define MAILBOX_BASE get_library_mailbox() +#include #define PLATFORM_HEAP_SYSTEM 2 #define PLATFORM_HEAP_SYSTEM_RUNTIME CONFIG_CORE_COUNT diff --git a/src/kernel/platform/lunarlake/include/platform/lib/memory.h b/src/kernel/platform/lunarlake/include/platform/lib/memory.h index 0b954d856940..4cad09d0282c 100644 --- a/src/kernel/platform/lunarlake/include/platform/lib/memory.h +++ b/src/kernel/platform/lunarlake/include/platform/lib/memory.h @@ -19,29 +19,7 @@ #include #include -/* HP SRAM windows */ -#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) - -/* window 0 */ -#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) -#define SRAM_SW_REG_SIZE 0x1000 - -#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) -#define SRAM_OUTBOX_SIZE 0x1000 - -/* window 1 */ -#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) -#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) - -/* window 2 */ -#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) -#define SRAM_DEBUG_SIZE 0x800 - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 +#include /* Stack configuration */ #define SOF_STACK_SIZE 0x1000 diff --git a/src/kernel/platform/meteorlake/include/platform/lib/memory.h b/src/kernel/platform/meteorlake/include/platform/lib/memory.h index 0dad6d99acc0..e9671d8a0313 100644 --- a/src/kernel/platform/meteorlake/include/platform/lib/memory.h +++ b/src/kernel/platform/meteorlake/include/platform/lib/memory.h @@ -19,29 +19,7 @@ #include #include -/* HP SRAM windows */ -#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) - -/* window 0 */ -#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) -#define SRAM_SW_REG_SIZE 0x1000 - -#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) -#define SRAM_OUTBOX_SIZE 0x1000 - -/* window 1 */ -#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) -#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) - -/* window 2 */ -#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) -#define SRAM_DEBUG_SIZE 0x800 - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 +#include /* Stack configuration */ #define SOF_STACK_SIZE 0x1000 diff --git a/src/kernel/platform/novalake/include/platform/lib/memory.h b/src/kernel/platform/novalake/include/platform/lib/memory.h index 19ade62dfb2b..752eb0bc9527 100644 --- a/src/kernel/platform/novalake/include/platform/lib/memory.h +++ b/src/kernel/platform/novalake/include/platform/lib/memory.h @@ -17,29 +17,7 @@ #include #include -/* HP SRAM windows */ -#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) - -/* window 0 */ -#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) -#define SRAM_SW_REG_SIZE 0x1000 - -#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) -#define SRAM_OUTBOX_SIZE 0x1000 - -/* window 1 */ -#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) -#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) - -/* window 2 */ -#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) -#define SRAM_DEBUG_SIZE 0x800 - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 +#include /* Stack configuration */ #define SOF_STACK_SIZE (CONFIG_SOF_STACK_SIZE) diff --git a/src/kernel/platform/posix/include/platform/lib/memory.h b/src/kernel/platform/posix/include/platform/lib/memory.h index 398eeca822c7..9bfb5d9837a4 100644 --- a/src/kernel/platform/posix/include/platform/lib/memory.h +++ b/src/kernel/platform/posix/include/platform/lib/memory.h @@ -8,33 +8,7 @@ #include #include -/* - * Mailbox base macros must yield byte-pointer arithmetic so that the - * generic mailbox API in `sof/src/include/sof/lib/mailbox.h` - * (`MAILBOX_HOSTBOX_BASE + offset`, etc., where `offset` is a byte - * offset) addresses the intended byte. The backing storage is - * declared as `uint32_t[]` only for natural-alignment; addressing is - * done through a `uint8_t *` cast so byte offsets do not get scaled - * by `sizeof(uint32_t)`. Every other SOF platform defines these - * bases as plain byte addresses (integer literals or - * `SRAM_INBOX_BASE`), so the cast keeps POSIX consistent with that - * ABI. - */ -extern uint32_t posix_hostbox[]; -#define MAILBOX_HOSTBOX_SIZE SOF_IPC_MSG_MAX_SIZE -#define MAILBOX_HOSTBOX_BASE ((uint8_t *)&posix_hostbox[0]) - -extern uint32_t posix_dspbox[]; -#define MAILBOX_DSPBOX_SIZE 4096 -#define MAILBOX_DSPBOX_BASE ((uint8_t *)&posix_dspbox[0]) - -extern uint32_t posix_stream[]; -#define MAILBOX_STREAM_SIZE 4096 -#define MAILBOX_STREAM_BASE ((uint8_t *)&posix_stream[0]) - -extern uint32_t posix_trace[]; -#define MAILBOX_TRACE_BASE ((uint8_t *)&posix_trace[0]) -#define MAILBOX_TRACE_SIZE 4096 +#include #define PLATFORM_HEAP_SYSTEM 1 #define PLATFORM_HEAP_SYSTEM_RUNTIME 1 diff --git a/src/kernel/platform/posix/posix.c b/src/kernel/platform/posix/posix.c index cea923d91ef1..eb5a55274eb7 100644 --- a/src/kernel/platform/posix/posix.c +++ b/src/kernel/platform/posix/posix.c @@ -2,6 +2,7 @@ // Copyright(c) 2022 Google LLC. All rights reserved. // Author: Andy Ross #include +#include #include #include #include diff --git a/src/kernel/platform/tigerlake/include/platform/lib/memory.h b/src/kernel/platform/tigerlake/include/platform/lib/memory.h index bf82e2483b8f..9b81c2f2eb90 100644 --- a/src/kernel/platform/tigerlake/include/platform/lib/memory.h +++ b/src/kernel/platform/tigerlake/include/platform/lib/memory.h @@ -182,33 +182,7 @@ * +--------------------+-------------------------+-----------------------------+ */ -/* HP SRAM */ -#define HP_SRAM_BASE 0xBE000000 - -/* HP SRAM windows */ -/* window 0 */ -#define SRAM_SW_REG_BASE (HP_SRAM_BASE + 0x4000) -#define SRAM_SW_REG_SIZE 0x1000 - -#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) -#define SRAM_OUTBOX_SIZE 0x1000 - -/* window 1 */ -#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) -#define SRAM_INBOX_SIZE 0x2000 -/* window 2 */ -#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) -#define SRAM_DEBUG_SIZE 0x800 - -#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) -#define SRAM_EXCEPT_SIZE 0x800 - -#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) -#define SRAM_STREAM_SIZE 0x1000 - -/* window 3 */ -#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) -#define SRAM_TRACE_SIZE 0x0 +#include #define HP_SRAM_WIN0_BASE SRAM_SW_REG_BASE #define HP_SRAM_WIN0_SIZE (SRAM_SW_REG_SIZE + SRAM_OUTBOX_SIZE) diff --git a/src/platform/README.md b/src/platform/README.md new file mode 100644 index 000000000000..0edad3e9eca8 --- /dev/null +++ b/src/platform/README.md @@ -0,0 +1,21 @@ +# Platform Headers for User-Space Code (`src/platform`) + +> **Runs in:** User-space safe — headers only. The platform code is kernel code, in +> [`src/kernel/platform`](../kernel/platform/README.md). See +> [User/kernel split](../include/sof/userspace/README.md). + +This directory holds the parts of the platform headers that user-space code may include. It +has the same layout as `src/kernel/platform`, and both are on the include path, so the +headers keep their include names. + +Today it has the mailbox: + +- `platform/lib/mailbox.h`, and for Intel `ace/lib/mailbox.h` and `cavs/lib/mailbox.h`: the + mailbox window addresses and the software register accessors, used through + `sof/lib/mailbox.h`. The software register page and the host box (IPC4) or the stream + window (IPC3) are mapped into the user-space LL and IPC threads, see + `user_access_to_mailbox()`. +- `platform/lib/mailbox_layout.h`: the layout of the host memory windows. The platform + memory map in `src/kernel/platform`, which user-space code must not include, includes it. + +The AMD and MediaTek mailbox headers are still in `src/kernel/platform`. diff --git a/src/kernel/platform/ace30/include/platform/lib/mailbox.h b/src/platform/ace30/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/ace30/include/platform/lib/mailbox.h rename to src/platform/ace30/include/platform/lib/mailbox.h diff --git a/src/platform/ace30/include/platform/lib/mailbox_layout.h b/src/platform/ace30/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..8885666c4f19 --- /dev/null +++ b/src/platform/ace30/include/platform/lib/mailbox_layout.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022-2024 Intel Corporation. + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +#include +#include +#include + +/* HP SRAM windows */ +#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) + +/* window 0 */ +#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) +#define SRAM_SW_REG_SIZE 0x1000 + +#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) +#define SRAM_OUTBOX_SIZE 0x1000 + +/* window 1 */ +#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) +#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) + +/* window 2 */ +#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) +#define SRAM_DEBUG_SIZE 0x800 + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/imx8/include/platform/lib/mailbox.h b/src/platform/imx8/include/platform/lib/mailbox.h similarity index 98% rename from src/kernel/platform/imx8/include/platform/lib/mailbox.h rename to src/platform/imx8/include/platform/lib/mailbox.h index 1b7498cf08d6..2c5010b86710 100644 --- a/src/kernel/platform/imx8/include/platform/lib/mailbox.h +++ b/src/platform/imx8/include/platform/lib/mailbox.h @@ -10,7 +10,7 @@ #ifndef __PLATFORM_LIB_MAILBOX_H__ #define __PLATFORM_LIB_MAILBOX_H__ -#include +#include #include #include diff --git a/src/platform/imx8/include/platform/lib/mailbox_layout.h b/src/platform/imx8/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..bb8d235264b3 --- /dev/null +++ b/src/platform/imx8/include/platform/lib/mailbox_layout.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2019 NXP + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +/* the mailbox is at the start of SDRAM1 */ +#define SDRAM1_BASE 0x92C00000 + +/* Mailbox configuration */ +#define SRAM_OUTBOX_BASE SDRAM1_BASE +#define SRAM_OUTBOX_SIZE 0x1000 +#define SRAM_OUTBOX_OFFSET 0 + +#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) +#define SRAM_INBOX_SIZE 0x1000 +#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE + +#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) +#define SRAM_DEBUG_SIZE 0x800 +#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 +#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 +#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) + +#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) +#define SRAM_TRACE_SIZE 0x1000 +#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/imx8m/include/platform/lib/mailbox.h b/src/platform/imx8m/include/platform/lib/mailbox.h similarity index 98% rename from src/kernel/platform/imx8m/include/platform/lib/mailbox.h rename to src/platform/imx8m/include/platform/lib/mailbox.h index 7a7e0d643fd0..fee90e9b7ada 100644 --- a/src/kernel/platform/imx8m/include/platform/lib/mailbox.h +++ b/src/platform/imx8m/include/platform/lib/mailbox.h @@ -10,7 +10,7 @@ #ifndef __PLATFORM_LIB_MAILBOX_H__ #define __PLATFORM_LIB_MAILBOX_H__ -#include +#include #include #include diff --git a/src/platform/imx8m/include/platform/lib/mailbox_layout.h b/src/platform/imx8m/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..61fd3a6db001 --- /dev/null +++ b/src/platform/imx8m/include/platform/lib/mailbox_layout.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2020 NXP + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +/* the mailbox is at the start of SDRAM1 */ +#define SDRAM1_BASE 0x92C00000 + +/* Mailbox configuration */ +#define SRAM_OUTBOX_BASE SDRAM1_BASE +#define SRAM_OUTBOX_SIZE 0x1000 +#define SRAM_OUTBOX_OFFSET 0 + +#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) +#define SRAM_INBOX_SIZE 0x1000 +#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE + +#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) +#define SRAM_DEBUG_SIZE 0x800 +#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 +#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 +#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) + +#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) +#define SRAM_TRACE_SIZE 0x1000 +#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/imx8m_cm7/include/platform/lib/mailbox.h b/src/platform/imx8m_cm7/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/imx8m_cm7/include/platform/lib/mailbox.h rename to src/platform/imx8m_cm7/include/platform/lib/mailbox.h diff --git a/src/kernel/platform/imx8ulp/include/platform/lib/mailbox.h b/src/platform/imx8ulp/include/platform/lib/mailbox.h similarity index 98% rename from src/kernel/platform/imx8ulp/include/platform/lib/mailbox.h rename to src/platform/imx8ulp/include/platform/lib/mailbox.h index f06560ba41c1..bf6021d58b75 100644 --- a/src/kernel/platform/imx8ulp/include/platform/lib/mailbox.h +++ b/src/platform/imx8ulp/include/platform/lib/mailbox.h @@ -10,7 +10,7 @@ #ifndef __PLATFORM_LIB_MAILBOX_H__ #define __PLATFORM_LIB_MAILBOX_H__ -#include +#include #include #include diff --git a/src/platform/imx8ulp/include/platform/lib/mailbox_layout.h b/src/platform/imx8ulp/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..5d75a7c808eb --- /dev/null +++ b/src/platform/imx8ulp/include/platform/lib/mailbox_layout.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2021 NXP + * + * Zhang Peng + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +/* the mailbox is at the start of SDRAM1 */ +#define SDRAM1_BASE 0x1a800000 + +/* Mailbox configuration */ +#define SRAM_OUTBOX_BASE SDRAM1_BASE +#define SRAM_OUTBOX_SIZE 0x1000 +#define SRAM_OUTBOX_OFFSET 0 + +#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) +#define SRAM_INBOX_SIZE 0x1000 +#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE + +#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) +#define SRAM_DEBUG_SIZE 0x2800 +#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 +#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 +#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) + +#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) +#define SRAM_TRACE_SIZE 0x1000 +#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/imx93_a55/include/platform/lib/mailbox.h b/src/platform/imx93_a55/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/imx93_a55/include/platform/lib/mailbox.h rename to src/platform/imx93_a55/include/platform/lib/mailbox.h diff --git a/src/kernel/platform/imx95/include/platform/lib/mailbox.h b/src/platform/imx95/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/imx95/include/platform/lib/mailbox.h rename to src/platform/imx95/include/platform/lib/mailbox.h diff --git a/src/kernel/platform/intel/ace/include/ace/lib/mailbox.h b/src/platform/intel/ace/include/ace/lib/mailbox.h similarity index 97% rename from src/kernel/platform/intel/ace/include/ace/lib/mailbox.h rename to src/platform/intel/ace/include/ace/lib/mailbox.h index b3cccad8c85a..537f042cc57d 100644 --- a/src/kernel/platform/intel/ace/include/ace/lib/mailbox.h +++ b/src/platform/intel/ace/include/ace/lib/mailbox.h @@ -12,7 +12,8 @@ #define __ACE_LIB_MAILBOX_H__ #include -#include +#include +#include #include #include #include diff --git a/src/kernel/platform/intel/cavs/include/cavs/lib/mailbox.h b/src/platform/intel/cavs/include/cavs/lib/mailbox.h similarity index 98% rename from src/kernel/platform/intel/cavs/include/cavs/lib/mailbox.h rename to src/platform/intel/cavs/include/cavs/lib/mailbox.h index 063ccfcf6f3e..7cd18d14c9be 100644 --- a/src/kernel/platform/intel/cavs/include/cavs/lib/mailbox.h +++ b/src/platform/intel/cavs/include/cavs/lib/mailbox.h @@ -12,7 +12,8 @@ #define __CAVS_LIB_MAILBOX_H__ #include -#include +#include +#include #include #include #include diff --git a/src/kernel/platform/library/include/platform/lib/mailbox.h b/src/platform/library/include/platform/lib/mailbox.h similarity index 97% rename from src/kernel/platform/library/include/platform/lib/mailbox.h rename to src/platform/library/include/platform/lib/mailbox.h index daa858481149..149db9fbb97a 100644 --- a/src/kernel/platform/library/include/platform/lib/mailbox.h +++ b/src/platform/library/include/platform/lib/mailbox.h @@ -10,7 +10,7 @@ #ifndef __PLATFORM_LIB_MAILBOX_H__ #define __PLATFORM_LIB_MAILBOX_H__ -#include +#include #include #include diff --git a/src/platform/library/include/platform/lib/mailbox_layout.h b/src/platform/library/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..8d67ece97679 --- /dev/null +++ b/src/platform/library/include/platform/lib/mailbox_layout.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +#include + +uint8_t *get_library_mailbox(void); + +#define MAILBOX_BASE get_library_mailbox() + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/lunarlake/include/platform/lib/mailbox.h b/src/platform/lunarlake/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/lunarlake/include/platform/lib/mailbox.h rename to src/platform/lunarlake/include/platform/lib/mailbox.h diff --git a/src/platform/lunarlake/include/platform/lib/mailbox_layout.h b/src/platform/lunarlake/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..e4c7cbd253d7 --- /dev/null +++ b/src/platform/lunarlake/include/platform/lib/mailbox_layout.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +#include +#include +#include + +/* HP SRAM windows */ +#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) + +/* window 0 */ +#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) +#define SRAM_SW_REG_SIZE 0x1000 + +#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) +#define SRAM_OUTBOX_SIZE 0x1000 + +/* window 1 */ +#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) +#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) + +/* window 2 */ +#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) +#define SRAM_DEBUG_SIZE 0x800 + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/meteorlake/include/platform/lib/mailbox.h b/src/platform/meteorlake/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/meteorlake/include/platform/lib/mailbox.h rename to src/platform/meteorlake/include/platform/lib/mailbox.h diff --git a/src/platform/meteorlake/include/platform/lib/mailbox_layout.h b/src/platform/meteorlake/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..5ddba7288eb9 --- /dev/null +++ b/src/platform/meteorlake/include/platform/lib/mailbox_layout.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022 Intel Corporation. All rights reserved. + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +#include +#include +#include + +/* HP SRAM windows */ +#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) + +/* window 0 */ +#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) +#define SRAM_SW_REG_SIZE 0x1000 + +#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) +#define SRAM_OUTBOX_SIZE 0x1000 + +/* window 1 */ +#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) +#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) + +/* window 2 */ +#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) +#define SRAM_DEBUG_SIZE 0x800 + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/novalake/include/platform/lib/mailbox.h b/src/platform/novalake/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/novalake/include/platform/lib/mailbox.h rename to src/platform/novalake/include/platform/lib/mailbox.h diff --git a/src/platform/novalake/include/platform/lib/mailbox_layout.h b/src/platform/novalake/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..8885666c4f19 --- /dev/null +++ b/src/platform/novalake/include/platform/lib/mailbox_layout.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022-2024 Intel Corporation. + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +#include +#include +#include + +/* HP SRAM windows */ +#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory)) + +/* window 0 */ +#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET)) +#define SRAM_SW_REG_SIZE 0x1000 + +#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) +#define SRAM_OUTBOX_SIZE 0x1000 + +/* window 1 */ +#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET)) +#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1)) + +/* window 2 */ +#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET)) +#define SRAM_DEBUG_SIZE 0x800 + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/posix/include/platform/lib/mailbox.h b/src/platform/posix/include/platform/lib/mailbox.h similarity index 93% rename from src/kernel/platform/posix/include/platform/lib/mailbox.h rename to src/platform/posix/include/platform/lib/mailbox.h index 3a42e93f6ea2..e6a88aff0732 100644 --- a/src/kernel/platform/posix/include/platform/lib/mailbox.h +++ b/src/platform/posix/include/platform/lib/mailbox.h @@ -5,7 +5,7 @@ #ifndef PLATFORM_POSIX_LIB_MAILBOX_H #define PLATFORM_POSIX_LIB_MAILBOX_H -#include +#include static inline uint32_t mailbox_sw_reg_read(size_t offset) { diff --git a/src/platform/posix/include/platform/lib/mailbox_layout.h b/src/platform/posix/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..e0c54bd686f7 --- /dev/null +++ b/src/platform/posix/include/platform/lib/mailbox_layout.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2022 Google LLC. All rights reserved. + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +#include +#include + +/* + * Mailbox base macros must yield byte-pointer arithmetic so that the + * generic mailbox API in `sof/src/include/sof/lib/mailbox.h` + * (`MAILBOX_HOSTBOX_BASE + offset`, etc., where `offset` is a byte + * offset) addresses the intended byte. The backing storage is + * declared as `uint32_t[]` only for natural-alignment; addressing is + * done through a `uint8_t *` cast so byte offsets do not get scaled + * by `sizeof(uint32_t)`. Every other SOF platform defines these + * bases as plain byte addresses (integer literals or + * `SRAM_INBOX_BASE`), so the cast keeps POSIX consistent with that + * ABI. + */ +extern uint32_t posix_hostbox[]; +#define MAILBOX_HOSTBOX_SIZE SOF_IPC_MSG_MAX_SIZE +#define MAILBOX_HOSTBOX_BASE ((uint8_t *)&posix_hostbox[0]) + +extern uint32_t posix_dspbox[]; +#define MAILBOX_DSPBOX_SIZE 4096 +#define MAILBOX_DSPBOX_BASE ((uint8_t *)&posix_dspbox[0]) + +extern uint32_t posix_stream[]; +#define MAILBOX_STREAM_SIZE 4096 +#define MAILBOX_STREAM_BASE ((uint8_t *)&posix_stream[0]) + +extern uint32_t posix_trace[]; +#define MAILBOX_TRACE_BASE ((uint8_t *)&posix_trace[0]) +#define MAILBOX_TRACE_SIZE 4096 + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/src/kernel/platform/qemu_xtensa/include/platform/lib/mailbox.h b/src/platform/qemu_xtensa/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/qemu_xtensa/include/platform/lib/mailbox.h rename to src/platform/qemu_xtensa/include/platform/lib/mailbox.h diff --git a/src/kernel/platform/tigerlake/include/platform/lib/mailbox.h b/src/platform/tigerlake/include/platform/lib/mailbox.h similarity index 100% rename from src/kernel/platform/tigerlake/include/platform/lib/mailbox.h rename to src/platform/tigerlake/include/platform/lib/mailbox.h diff --git a/src/platform/tigerlake/include/platform/lib/mailbox_layout.h b/src/platform/tigerlake/include/platform/lib/mailbox_layout.h new file mode 100644 index 000000000000..e45946210e1e --- /dev/null +++ b/src/platform/tigerlake/include/platform/lib/mailbox_layout.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * Keyon Jie + * Rander Wang + */ + +/** + * \file platform/lib/mailbox_layout.h + * \brief Layout of the host memory windows used by the mailbox + * + * User-space code can include this, through sof/lib/mailbox.h. The rest + * of the platform memory map is in platform/lib/memory.h. + */ + +#ifndef __PLATFORM_LIB_MAILBOX_LAYOUT_H__ +#define __PLATFORM_LIB_MAILBOX_LAYOUT_H__ + +/* HP SRAM */ +#define HP_SRAM_BASE 0xBE000000 + +/* HP SRAM windows */ +/* window 0 */ +#define SRAM_SW_REG_BASE (HP_SRAM_BASE + 0x4000) +#define SRAM_SW_REG_SIZE 0x1000 + +#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE) +#define SRAM_OUTBOX_SIZE 0x1000 + +/* window 1 */ +#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) +#define SRAM_INBOX_SIZE 0x2000 +/* window 2 */ +#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) +#define SRAM_DEBUG_SIZE 0x800 + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x800 + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x1000 + +/* window 3 */ +#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) +#define SRAM_TRACE_SIZE 0x0 + +#endif /* __PLATFORM_LIB_MAILBOX_LAYOUT_H__ */ diff --git a/test/cmocka/CMakeLists.txt b/test/cmocka/CMakeLists.txt index 98a64af7d584..c3b2dc0e88fc 100644 --- a/test/cmocka/CMakeLists.txt +++ b/test/cmocka/CMakeLists.txt @@ -43,8 +43,10 @@ endif() if(CONFIG_CAVS) target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/kernel/platform/intel/cavs/include) + target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/intel/cavs/include) elseif(CONFIG_ACE) target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/kernel/platform/intel/ace/include) + target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/intel/ace/include) endif() # linker script, just for log entries diff --git a/test/cmocka/src/lib/alloc/CMakeLists.txt b/test/cmocka/src/lib/alloc/CMakeLists.txt index 10bef8205b4b..5e899d3955af 100644 --- a/test/cmocka/src/lib/alloc/CMakeLists.txt +++ b/test/cmocka/src/lib/alloc/CMakeLists.txt @@ -7,3 +7,4 @@ cmocka_test(alloc ) target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/kernel/platform/intel/cavs/include) +target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/intel/cavs/include) diff --git a/test/ztest/unit/audio/crossover/CMakeLists.txt b/test/ztest/unit/audio/crossover/CMakeLists.txt index cc599bc4e512..71557a2256b1 100644 --- a/test/ztest/unit/audio/crossover/CMakeLists.txt +++ b/test/ztest/unit/audio/crossover/CMakeLists.txt @@ -13,6 +13,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/src/audio/crossover ${PROJECT_BINARY_DIR}/include/generated ) diff --git a/test/ztest/unit/audio/drc/CMakeLists.txt b/test/ztest/unit/audio/drc/CMakeLists.txt index 39691eefa371..225ab3fef4dc 100644 --- a/test/ztest/unit/audio/drc/CMakeLists.txt +++ b/test/ztest/unit/audio/drc/CMakeLists.txt @@ -18,6 +18,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/src/audio ${SOF_ROOT}/test/cmocka/include ${PROJECT_BINARY_DIR}/include/generated diff --git a/test/ztest/unit/dsrc/CMakeLists.txt b/test/ztest/unit/dsrc/CMakeLists.txt index db31f8a536d8..ef4ce93d443f 100644 --- a/test/ztest/unit/dsrc/CMakeLists.txt +++ b/test/ztest/unit/dsrc/CMakeLists.txt @@ -12,6 +12,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ) # Define SOF-specific configurations for unit testing diff --git a/test/ztest/unit/fast-get/CMakeLists.txt b/test/ztest/unit/fast-get/CMakeLists.txt index b58587e15794..4a6040911fff 100644 --- a/test/ztest/unit/fast-get/CMakeLists.txt +++ b/test/ztest/unit/fast-get/CMakeLists.txt @@ -16,6 +16,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${PROJECT_BINARY_DIR}/include/generated # For uuid-registry.h ) diff --git a/test/ztest/unit/math/advanced/functions/CMakeLists.txt b/test/ztest/unit/math/advanced/functions/CMakeLists.txt index 0afee53408b7..797133172e30 100644 --- a/test/ztest/unit/math/advanced/functions/CMakeLists.txt +++ b/test/ztest/unit/math/advanced/functions/CMakeLists.txt @@ -16,6 +16,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/test/cmocka/include ${PROJECT_BINARY_DIR}/include/generated # For uuid-registry.h ) diff --git a/test/ztest/unit/math/auditory/CMakeLists.txt b/test/ztest/unit/math/auditory/CMakeLists.txt index d09c724d80af..fc78e1c41845 100644 --- a/test/ztest/unit/math/auditory/CMakeLists.txt +++ b/test/ztest/unit/math/auditory/CMakeLists.txt @@ -17,6 +17,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/test/ztest/unit/common # Reference test vectors are #included in place from the CMocka tree # rather than copied, so both frameworks share identical data. diff --git a/test/ztest/unit/math/dct/CMakeLists.txt b/test/ztest/unit/math/dct/CMakeLists.txt index 3bddbf06e6ea..b0b4963eb202 100644 --- a/test/ztest/unit/math/dct/CMakeLists.txt +++ b/test/ztest/unit/math/dct/CMakeLists.txt @@ -17,6 +17,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/test/ztest/unit/common # Reference test vectors are #included in place from the CMocka tree # rather than copied, so both frameworks share identical data. diff --git a/test/ztest/unit/math/fft/CMakeLists.txt b/test/ztest/unit/math/fft/CMakeLists.txt index 0c7a8f13783f..825d918a92c2 100644 --- a/test/ztest/unit/math/fft/CMakeLists.txt +++ b/test/ztest/unit/math/fft/CMakeLists.txt @@ -17,6 +17,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/src/audio ${SOF_ROOT}/test/ztest/unit/common ${SOF_ROOT}/test/cmocka/include diff --git a/test/ztest/unit/math/fft_multi/CMakeLists.txt b/test/ztest/unit/math/fft_multi/CMakeLists.txt index 3287559f3050..f7e38b1b5c04 100644 --- a/test/ztest/unit/math/fft_multi/CMakeLists.txt +++ b/test/ztest/unit/math/fft_multi/CMakeLists.txt @@ -17,6 +17,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/test/ztest/unit/common ${SOF_ROOT}/test/cmocka/include # Reference test vectors are #included in place from the CMocka tree diff --git a/test/ztest/unit/math/matrix/CMakeLists.txt b/test/ztest/unit/math/matrix/CMakeLists.txt index 1dbfea88a08a..5b29b752752f 100644 --- a/test/ztest/unit/math/matrix/CMakeLists.txt +++ b/test/ztest/unit/math/matrix/CMakeLists.txt @@ -17,6 +17,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ${SOF_ROOT}/test/ztest/unit/common # Reference test vectors are #included in place from the CMocka tree # rather than copied, so both frameworks share identical data. diff --git a/test/ztest/unit/objpool/CMakeLists.txt b/test/ztest/unit/objpool/CMakeLists.txt index f19b8a3e926c..544ce203618b 100644 --- a/test/ztest/unit/objpool/CMakeLists.txt +++ b/test/ztest/unit/objpool/CMakeLists.txt @@ -12,6 +12,7 @@ target_include_directories(app PRIVATE ${SOF_ROOT}/zephyr/include ${SOF_ROOT}/src/include ${SOF_ROOT}/src/kernel/platform/posix/include + ${SOF_ROOT}/src/platform/posix/include ) # Define SOF-specific configurations for unit testing diff --git a/tools/testbench/CMakeLists.txt b/tools/testbench/CMakeLists.txt index ec949fc6ed14..fd1ca8ffbc2f 100644 --- a/tools/testbench/CMakeLists.txt +++ b/tools/testbench/CMakeLists.txt @@ -40,6 +40,7 @@ set(sof_binary_directory "${PROJECT_BINARY_DIR}/sof_ep/build") set(config_h ${sof_binary_directory}/library_autoconfig.h) target_include_directories(${testbench} PRIVATE "${sof_source_directory}/src/kernel/platform/library/include") +target_include_directories(${testbench} PRIVATE "${sof_source_directory}/src/platform/library/include") target_include_directories(${testbench} PRIVATE "${sof_source_directory}/src/audio") # Configuration time, make copy diff --git a/tools/tplg_parser/CMakeLists.txt b/tools/tplg_parser/CMakeLists.txt index 353808a3ef15..9a4d19f3ba64 100644 --- a/tools/tplg_parser/CMakeLists.txt +++ b/tools/tplg_parser/CMakeLists.txt @@ -44,6 +44,7 @@ target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/i target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/kernel/arch/host/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/kernel/platform/library/include) +target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/platform/library/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/posix/include) # Configuration time, make copy diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 026f64a8679b..9e4f19b15d86 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -157,6 +157,8 @@ cmake_path(SET sof_top_dir NORMALIZE "${CMAKE_CURRENT_SOURCE_DIR}/..") set(SOF_SRC_PATH "${sof_top_dir}/src") set(SOF_PLATFORM_PATH "${SOF_SRC_PATH}/kernel/platform") +# platform headers that user-space code may include +set(SOF_USER_PLATFORM_PATH "${SOF_SRC_PATH}/platform") set(SOF_DRIVERS_PATH "${SOF_SRC_PATH}/kernel/drivers") set(RIMAGE_TOP ${sof_top_dir}/tools/rimage) @@ -256,6 +258,7 @@ if (CONFIG_SOC_SERIES_INTEL_CAVS_V25) set(PLATFORM "tigerlake") zephyr_include_directories(${SOF_PLATFORM_PATH}/intel/cavs/include) + zephyr_include_directories(${SOF_USER_PLATFORM_PATH}/intel/cavs/include) endif() # Intel ACE 1.5 and newer platforms @@ -308,6 +311,7 @@ if (CONFIG_SOC_SERIES_INTEL_ADSP_ACE) endif() zephyr_include_directories(${SOF_PLATFORM_PATH}/intel/ace/include) + zephyr_include_directories(${SOF_USER_PLATFORM_PATH}/intel/ace/include) zephyr_include_directories(${SOF_PLATFORM_PATH}/${PLATFORM}/include) endif() @@ -564,6 +568,8 @@ if(NOT DEFINED PLATFORM) message(FATAL_ERROR "PLATFORM is not defined, check your Kconfiguration?") endif() zephyr_include_directories(${SOF_PLATFORM_PATH}/${PLATFORM}/include) +# not every platform has one yet, the compiler skips missing directories +zephyr_include_directories(${SOF_USER_PLATFORM_PATH}/${PLATFORM}/include) if(CONFIG_SOF_USERSPACE_INTERFACE_DMA) zephyr_library_sources(syscall/sof_dma.c) diff --git a/zephyr/include/rtos/timer.h b/zephyr/include/rtos/timer.h index fef53389faac..c430859823bb 100644 --- a/zephyr/include/rtos/timer.h +++ b/zephyr/include/rtos/timer.h @@ -16,7 +16,6 @@ #include #include #include -#include struct comp_dev; struct sof_ipc_stream_posn; diff --git a/zephyr/include/sof/lib/dma-legacy.h b/zephyr/include/sof/lib/dma-legacy.h index cb381ce03363..592ffc87b665 100644 --- a/zephyr/include/sof/lib/dma-legacy.h +++ b/zephyr/include/sof/lib/dma-legacy.h @@ -6,6 +6,8 @@ #ifndef __SOF_LIB_DMA_LEGACY_H__ #define __SOF_LIB_DMA_LEGACY_H__ +#include + /* DMA attributes */ #define DMA_ATTR_BUFFER_ALIGNMENT 0 #define DMA_ATTR_COPY_ALIGNMENT 1 diff --git a/zephyr/include/sof/lib/dma.h b/zephyr/include/sof/lib/dma.h index 261abe8cacea..145478db30f3 100644 --- a/zephyr/include/sof/lib/dma.h +++ b/zephyr/include/sof/lib/dma.h @@ -21,8 +21,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/zephyr/lib/alloc.c b/zephyr/lib/alloc.c index 87d0fa9d945d..f1148a0e6771 100644 --- a/zephyr/lib/alloc.c +++ b/zephyr/lib/alloc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include /* for zephyr_ll_user_heap() */ diff --git a/zephyr/lib/cpu.c b/zephyr/lib/cpu.c index ea407a45a554..ec5217823f8a 100644 --- a/zephyr/lib/cpu.c +++ b/zephyr/lib/cpu.c @@ -19,7 +19,9 @@ static uint32_t mic_disable_status; #endif /* CONFIG_INTEL_ADSP_MIC_PRIVACY */ #include #include +#include #include +#include #include #include #include diff --git a/zephyr/wrapper.c b/zephyr/wrapper.c index afdc5b54a2e9..d866c7305824 100644 --- a/zephyr/wrapper.c +++ b/zephyr/wrapper.c @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include #include #include #include