Skip to content

Commit 5ee5af6

Browse files
tmlemannashif
authored andcommitted
soc: ace_v1x: stoping WDT during transiotion to D3
During transition into D3 state, watchdog timer have to be paused. FW can resume it when core is re-enabled. Signed-off-by: Tomasz Leman <[email protected]>
1 parent efcf640 commit 5ee5af6

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

soc/xtensa/intel_adsp/ace_v1x/include/ace_v1x-regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ struct dfdspbrcp {
4343
#define DFDSPBRCP_BATTR_LPSCTL_L1_MIN_WAY BIT(15)
4444
#define DFDSPBRCP_BATTR_LPSCTL_BATTR_SLAVE_CORE BIT(16)
4545

46+
#define DFDSPBRCP_WDT_RESUME BIT(8)
47+
#define DFDSPBRCP_WDT_RESTART_COMMAND 0x76
48+
4649
#define DFDSPBRCP (*(volatile struct dfdspbrcp *)DFDSPBRCP_REG)
4750

4851
/* Low priority interrupt indices */

soc/xtensa/intel_adsp/ace_v1x/multiprocessing.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ void soc_mp_startup(uint32_t cpu)
7676
/* Prevent idle from powering us off */
7777
DFDSPBRCP.bootctl[cpu].bctl |=
7878
DFDSPBRCP_BCTL_WAITIPCG | DFDSPBRCP_BCTL_WAITIPPG;
79+
/* checking if WDT was stopped during D3 transition */
80+
if (DFDSPBRCP.bootctl[cpu].wdtcs & DFDSPBRCP_WDT_RESUME) {
81+
DFDSPBRCP.bootctl[cpu].wdtcs = DFDSPBRCP_WDT_RESUME;
82+
/* TODO: delete this IF when FW starts using imr restore vector */
83+
}
7984
}
8085

8186
void arch_sched_ipi(void)

soc/xtensa/intel_adsp/ace_v1x/power.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ __weak void pm_state_set(enum pm_state state, uint8_t substate_id)
3737
if (state == PM_STATE_SOFT_OFF) {
3838
uint32_t cpu = arch_proc_id();
3939

40+
DFDSPBRCP.bootctl[cpu].wdtcs = DFDSPBRCP_WDT_RESTART_COMMAND;
4041
DFDSPBRCP.bootctl[cpu].bctl &= ~DFDSPBRCP_BCTL_WAITIPCG;
4142
soc_cpus_active[cpu] = false;
4243
z_xtensa_cache_flush_inv_all();
@@ -62,6 +63,7 @@ __weak void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
6263
if (state == PM_STATE_SOFT_OFF) {
6364
uint32_t cpu = arch_proc_id();
6465

66+
DFDSPBRCP.bootctl[cpu].wdtcs = DFDSPBRCP_WDT_RESUME;
6567
/* TODO: move clock gating prevent to imr restore vector when it will be ready. */
6668
DFDSPBRCP.bootctl[cpu].bctl |= DFDSPBRCP_BCTL_WAITIPCG;
6769
soc_cpus_active[cpu] = true;

0 commit comments

Comments
 (0)