Skip to content
Draft
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 app/boards/acp_6_0_adsp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CONFIG_DYNAMIC_INTERRUPTS=y
CONFIG_SHARED_INTERRUPTS=n
CONFIG_ZEPHYR_LOG=n
CONFIG_DMA=y
CONFIG_DMA_DOMAIN=y
CONFIG_ZEPHYR_NATIVE_DRIVERS=n
CONFIG_AMS=n
CONFIG_COMP_SRC=n
Expand Down
13 changes: 0 additions & 13 deletions posix/include/rtos/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@

struct timer;

#define CLOCK_NOTIFY_PRE 0
#define CLOCK_NOTIFY_POST 1

struct clock_notify_data {
uint32_t old_freq;
uint32_t old_ticks_per_msec;
uint32_t freq;
uint32_t ticks_per_msec;
uint32_t message;
};

struct freq_table {
uint32_t freq;
uint32_t ticks_per_msec;
Expand All @@ -39,8 +28,6 @@ struct clock_info {
uint32_t default_freq_idx;
uint32_t current_freq_idx;
uint32_t lowest_freq_idx; /* lowest possible clock */
uint32_t notification_id;
uint32_t notification_mask;

/* persistent change clock value in active state, caller must hold clk_lock */
int (*set_freq)(int clock, int freq_idx);
Expand Down
1 change: 0 additions & 1 deletion scripts/kernel_user_partition.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ src/audio/dai-legacy.c
src/audio/host-legacy.c
src/schedule/dma_multi_chan_domain.c
src/schedule/dma_single_chan_domain.c
src/schedule/ll_schedule_xtos.c
src/schedule/zephyr_dma_domain.c

# Headers that user-space code may include, checked with --sources: they
Expand Down
9 changes: 0 additions & 9 deletions src/include/sof/lib/notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#define NOTIFIER_TARGET_CORE_ALL_MASK 0xFFFFFFFF

enum notify_id {
NOTIFIER_ID_CPU_FREQ = 0, /* struct clock_notify_data * */
NOTIFIER_ID_SSP_FREQ, /* struct clock_notify_data * */
NOTIFIER_ID_KPB_CLIENT_EVT, /* struct kpb_event_data * */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note (LLEXT symbol ABI): All in-tree callers use symbolic NOTIFIER_ID_* constants, so renumbering from 0 is completely safe for in-tree builds. Just noting that since notifier_register and notifier_unregister are exported via EXPORT_SYMBOL() (src/lib/notifier.c:70,107), any cached/standalone .llext binaries (copier, kpb) compiled against pre-#11513 headers must be rebuilt (expected, especially as notifier is internal and being removed in Phase 5).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I added an "LLEXT modules" section to the description: LLEXT modules that use the notifier must be rebuilt against the new headers, and the in-tree modules are rebuilt with the firmware.

NOTIFIER_ID_DMA_DOMAIN_CHANGE, /* struct dma_chan_data * */
NOTIFIER_ID_DMA_COPY, /* struct dma_cb_data* */
Expand All @@ -44,13 +42,6 @@ struct notify_data {
void *data;
};

#ifdef CLK_SSP
#define NOTIFIER_CLK_CHANGE_ID(clk) \
((clk) == CLK_SSP ? NOTIFIER_ID_SSP_FREQ : NOTIFIER_ID_CPU_FREQ)
#else
#define NOTIFIER_CLK_CHANGE_ID(clk) NOTIFIER_ID_CPU_FREQ
#endif

struct notify **arch_notify_get(void);

typedef void (*notifier_callback_t)(void *receiver_data, enum notify_id event_type,
Expand Down
1 change: 0 additions & 1 deletion src/kernel/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <rtos/timer.h>
#include <rtos/clk.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <sof/lib/uuid.h>
#include <sof/kernel/platform.h>
#include <rtos/spinlock.h>
Expand Down
4 changes: 0 additions & 4 deletions src/kernel/platform/amd/acp_7_0/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <rtos/clk.h>
#include <sof/lib/cpu.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <rtos/sof.h>
#include <rtos/atomic.h>
#include <sof/audio/component.h>
Expand All @@ -25,7 +24,6 @@
#include <sof/lib/dma.h>
#include <sof/lib/io.h>
#include <sof/lib/pm_runtime.h>
#include <sof/lib/notifier.h>
#include <sof/kernel/platform.h>
#include <sof/schedule/schedule.h>
#include <rtos/spinlock.h>
Expand Down Expand Up @@ -477,8 +475,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
4 changes: 0 additions & 4 deletions src/kernel/platform/amd/acp_7_x/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <rtos/clk.h>
#include <sof/lib/cpu.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <rtos/sof.h>
#include <rtos/atomic.h>
#include <sof/audio/component.h>
Expand All @@ -26,7 +25,6 @@
#include <sof/lib/dma.h>
#include <sof/lib/io.h>
#include <sof/lib/pm_runtime.h>
#include <sof/lib/notifier.h>
#include <sof/kernel/platform.h>
#include <sof/schedule/schedule.h>
#include <rtos/spinlock.h>
Expand Down Expand Up @@ -175,8 +173,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/amd/rembrandt/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <rtos/clk.h>
#include <sof/lib/cpu.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <rtos/sof.h>
#include <platform/chip_registers.h>

Expand Down Expand Up @@ -134,8 +133,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/imx8/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <sof/common.h>
#include <rtos/clk.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <rtos/sof.h>

#include <zephyr/sys/util.h>
Expand Down Expand Up @@ -38,8 +37,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/imx8m/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <sof/common.h>
#include <rtos/clk.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <rtos/sof.h>

#include <zephyr/sys/util.h>
Expand All @@ -33,8 +32,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/imx8m_cm7/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

#include <rtos/clk.h>
#include <sof/lib/notifier.h>

static const struct freq_table platform_cpu_freq[] = {
{
Expand All @@ -27,8 +26,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/imx8ulp/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <sof/common.h>
#include <rtos/clk.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <rtos/sof.h>

#include <zephyr/sys/util.h>
Expand All @@ -33,8 +32,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/imx93_a55/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

#include <rtos/clk.h>
#include <sof/lib/notifier.h>

static const struct freq_table platform_cpu_freq[] = {
{ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,
Expand Down Expand Up @@ -38,8 +37,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/imx95/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

#include <rtos/clk.h>
#include <sof/lib/notifier.h>

static const struct freq_table platform_cpu_freq[] = {
{
Expand All @@ -27,8 +26,6 @@ void platform_clock_init(struct sof *sof)
.freqs = platform_cpu_freq,
.default_freq_idx = CPU_DEFAULT_IDX,
.current_freq_idx = CPU_DEFAULT_IDX,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i),
.set_freq = NULL,
};
}
Expand Down
3 changes: 0 additions & 3 deletions src/kernel/platform/mtk/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <sof/lib/agent.h>
#include <sof/lib/dma.h>
#include <sof/lib/mailbox.h>
#include <sof/lib/notifier.h>
#include <sof/lib/uuid.h>
#include <sof/schedule/ll_schedule_domain.h>
#include <sof/schedule/ll_schedule.h>
Expand Down Expand Up @@ -209,8 +208,6 @@ void clocks_init(struct sof *sof)
static struct clock_info clks[] = {
{ .freqs_num = ARRAY_SIZE(freqs),
.freqs = freqs,
.notification_id = NOTIFIER_ID_CPU_FREQ,
.notification_mask = NOTIFIER_TARGET_CORE_MASK(0),
.set_freq = set_cpuclk, },
};
sof->clocks = clks;
Expand Down
2 changes: 0 additions & 2 deletions src/kernel/platform/posix/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ static void posix_clk_init(struct sof *sof)
{
.freqs_num = ARRAY_SIZE(cpu_freq),
.freqs = cpu_freq,
.notification_id = 0,
.notification_mask = 1,
},
};

Expand Down
8 changes: 1 addition & 7 deletions src/kernel/schedule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ if(zephyr)
zephyr_library_sources(
schedule-kernel.c
zephyr_domain-kernel.c
zephyr_ll-kernel.c
)

# The kernel part of zephyr_ll.c, built with it, see src/schedule/CMakeLists.txt
if(NOT CONFIG_SOC_ACP_6_0 OR CONFIG_DMA_DOMAIN)
zephyr_library_sources(
zephyr_ll-kernel.c
)
endif()

zephyr_library_sources_ifdef(CONFIG_SOF_USERSPACE_LL
zephyr_ll_user.c
)
Expand Down
8 changes: 4 additions & 4 deletions src/lib/notifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int notifier_register(void *receiver, void *caller, enum notify_id type,
k_spinlock_key_t key;
int ret = 0;

assert(type >= NOTIFIER_ID_CPU_FREQ && type < NOTIFIER_ID_COUNT);
assert((unsigned int)type < NOTIFIER_ID_COUNT);

key = k_spin_lock(&notify->lock);

Expand Down Expand Up @@ -77,7 +77,7 @@ void notifier_unregister(void *receiver, void *caller, enum notify_id type)
struct callback_handle *handle;
k_spinlock_key_t key;

assert(type >= NOTIFIER_ID_CPU_FREQ && type < NOTIFIER_ID_COUNT);
assert((unsigned int)type < NOTIFIER_ID_COUNT);

key = k_spin_lock(&notify->lock);

Expand Down Expand Up @@ -110,7 +110,7 @@ void notifier_unregister_all(void *receiver, void *caller)
{
int i;

for (i = NOTIFIER_ID_CPU_FREQ; i < NOTIFIER_ID_COUNT; i++)
for (i = 0; i < NOTIFIER_ID_COUNT; i++)
notifier_unregister(receiver, caller, i);
}

Expand Down Expand Up @@ -193,7 +193,7 @@ __cold void init_system_notify(struct sof *sof)
}

k_spinlock_init(&(*notify)->lock);
for (i = NOTIFIER_ID_CPU_FREQ; i < NOTIFIER_ID_COUNT; i++)
for (i = 0; i < NOTIFIER_ID_COUNT; i++)
list_init(&(*notify)->list[i]);

if (cpu_get_id() == PLATFORM_PRIMARY_CORE_ID)
Expand Down
21 changes: 4 additions & 17 deletions src/schedule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,12 @@ if(zephyr) ### Zephyr ###
zephyr_library_sources(
${base_files}
zephyr_domain.c
zephyr_ll.c
)

if (CONFIG_SOC_ACP_6_0)
# Zephyr DMA domain should only be used with zephyr_ll
if (CONFIG_DMA_DOMAIN)
zephyr_library_sources(
zephyr_ll.c
zephyr_dma_domain.c
)
else()
zephyr_library_sources(
ll_schedule_xtos.c
)
endif()
else()
zephyr_library_sources(
zephyr_ll.c
)
endif()
zephyr_library_sources_ifdef(CONFIG_DMA_DOMAIN
zephyr_dma_domain.c
)

if (CONFIG_SOF_USERSPACE_APPLICATION)
zephyr_library_sources_ifdef(CONFIG_ZEPHYR_DP_SCHEDULER
Expand Down
Loading
Loading