Skip to content

Commit 93947f9

Browse files
tmlemankv2019i
authored andcommitted
platform: ace: notifying about idle thread readiness
Informing the primary core that the Idle thread on secondary core is ready. During the D3 exit flow thread is not initialize again, but restored from previously saved context. This patch includes also zephyr version update to aba3b12e31 (total 15 commits). Changes related to intel_adsp contain refactor and fixes for ACE secondary cores power flows. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent a048951 commit 93947f9

4 files changed

Lines changed: 33 additions & 4 deletions

File tree

src/platform/intel/ace/platform.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <ipc/info.h>
2525
#include <kernel/abi.h>
2626
#include <rtos/clk.h>
27+
#include <sof/lib/cpu.h>
2728

2829
#include <sof_versions.h>
2930
#include <stdint.h>
@@ -74,6 +75,11 @@ int platform_boot_complete(uint32_t boot_message)
7475
return ipc_platform_send_msg(&msg);
7576
}
7677

78+
static struct pm_notifier pm_state_notifier = {
79+
.state_entry = NULL,
80+
.state_exit = cpu_notify_state_exit,
81+
};
82+
7783
/* Runs on the primary core only */
7884
int platform_init(struct sof *sof)
7985
{
@@ -114,6 +120,9 @@ int platform_init(struct sof *sof)
114120
if (ret < 0)
115121
return ret;
116122

123+
/* register power states entry / exit notifiers */
124+
pm_notifier_register(&pm_state_notifier);
125+
117126
/* initialize the host IPC mechanisms */
118127
trace_point(TRACE_BOOT_PLATFORM_IPC);
119128
ipc_init(sof);

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ manifest:
4343

4444
- name: zephyr
4545
repo-path: zephyr
46-
revision: 3e02d48e4ead9978d10ee760c640bf55873f6e95
46+
revision: aba3b12e311b4779338406fe3e7c4c54f655d0cd
4747
remote: zephyrproject
4848

4949
# Import some projects listed in zephyr/west.yml@revision

zephyr/include/sof/lib/cpu.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@
2020

2121
#include <stdbool.h>
2222

23-
//#include <zephyr/sys/arch_interface.h>
24-
2523
#include <zephyr/arch/arch_inlines.h>
2624

25+
#if CONFIG_PM
26+
27+
#include <zephyr/pm/pm.h>
28+
29+
void cpu_notify_state_exit(enum pm_state state);
30+
31+
#endif /* CONFIG_PM */
32+
2733
/* let the compiler optimise when in single core mode */
2834
#if CONFIG_MULTICORE && CONFIG_SMP
2935

zephyr/lib/cpu.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,26 @@ static FUNC_NORETURN void secondary_init(void *arg)
5959
#if CONFIG_ZEPHYR_NATIVE_DRIVERS
6060
#include <sof/trace/trace.h>
6161
#include <rtos/wait.h>
62-
#include <zephyr/pm/pm.h>
6362

6463
LOG_MODULE_DECLARE(zephyr, CONFIG_SOF_LOG_LEVEL);
6564

6665
extern struct tr_ctx zephyr_tr;
6766

67+
/* notifier called after every power state transition */
68+
void cpu_notify_state_exit(enum pm_state state)
69+
{
70+
if (state == PM_STATE_SOFT_OFF) {
71+
#if CONFIG_MULTICORE
72+
if (!cpu_is_primary(arch_proc_id())) {
73+
/* Notifying primary core that secondary core successfully exit the D3
74+
* state and is back in the Idle thread.
75+
*/
76+
atomic_set(&ready_flag, 1);
77+
}
78+
#endif
79+
}
80+
}
81+
6882
int cpu_enable_core(int id)
6983
{
7084
/* only called from single core, no RMW lock */

0 commit comments

Comments
 (0)