Skip to content
Merged
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
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 4 additions & 9 deletions scripts/kernel_user_partition.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ 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
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/*
Expand Down Expand Up @@ -70,23 +72,16 @@ include/zephyr/pm/device_runtime.h
[leak-baseline]
src/audio/component.c
src/audio/copier/copier.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/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-helper.c
src/ipc/ipc4/dai.c
Expand Down
1 change: 0 additions & 1 deletion src/include/sof/lib/mailbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <platform/lib/mailbox.h>
#include <rtos/panic.h>
#include <rtos/cache.h>
#include <sof/lib/memory.h>
#include <rtos/string.h>
#include <stddef.h>
#include <stdint.h>
Expand Down
1 change: 1 addition & 0 deletions src/kernel/arch/host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/kernel/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <sof/lib/cpu-clk-manager.h>
#include <sof/lib/cpu.h>
#include <sof/lib/mailbox.h>
#include <sof/lib/memory.h>
#include <sof/platform.h>
#include <sof/lib_manager.h>
#include <rtos/clk.h>
Expand Down
5 changes: 3 additions & 2 deletions src/kernel/platform/README.md
Original file line number Diff line number Diff line change
@@ -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),
Expand Down
24 changes: 1 addition & 23 deletions src/kernel/platform/ace30/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,7 @@
#include <mem_window.h>
#include <sof/lib/cpu.h>

/* 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 <platform/lib/mailbox_layout.h>

/* Stack configuration */
#define SOF_STACK_SIZE 0x1000
Expand Down
26 changes: 1 addition & 25 deletions src/kernel/platform/imx8/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <platform/lib/mailbox_layout.h>

#define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \
+ SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \
Expand Down
26 changes: 1 addition & 25 deletions src/kernel/platform/imx8m/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <platform/lib/mailbox_layout.h>

#define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \
+ SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \
Expand Down
26 changes: 1 addition & 25 deletions src/kernel/platform/imx8ulp/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 <platform/lib/mailbox_layout.h>

#define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \
+ SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \
Expand Down
4 changes: 1 addition & 3 deletions src/kernel/platform/library/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <platform/lib/mailbox_layout.h>

#define PLATFORM_HEAP_SYSTEM 2
#define PLATFORM_HEAP_SYSTEM_RUNTIME CONFIG_CORE_COUNT
Expand Down
24 changes: 1 addition & 23 deletions src/kernel/platform/lunarlake/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,7 @@
#include <mem_window.h>
#include <sof/lib/cpu.h>

/* 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 <platform/lib/mailbox_layout.h>

/* Stack configuration */
#define SOF_STACK_SIZE 0x1000
Expand Down
24 changes: 1 addition & 23 deletions src/kernel/platform/meteorlake/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,7 @@
#include <mem_window.h>
#include <sof/lib/cpu.h>

/* 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 <platform/lib/mailbox_layout.h>

/* Stack configuration */
#define SOF_STACK_SIZE 0x1000
Expand Down
24 changes: 1 addition & 23 deletions src/kernel/platform/novalake/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,7 @@
#include <mem_window.h>
#include <sof/lib/cpu.h>

/* 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 <platform/lib/mailbox_layout.h>

/* Stack configuration */
#define SOF_STACK_SIZE (CONFIG_SOF_STACK_SIZE)
Expand Down
28 changes: 1 addition & 27 deletions src/kernel/platform/posix/include/platform/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,7 @@
#include <stdint.h>
#include <ipc/header.h>

/*
* 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 <platform/lib/mailbox_layout.h>

#define PLATFORM_HEAP_SYSTEM 1
#define PLATFORM_HEAP_SYSTEM_RUNTIME 1
Expand Down
Loading
Loading