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
2 changes: 1 addition & 1 deletion src/arch/xtensa/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void arch_cpu_disable_core(int id)
IDC_MSG_POWER_DOWN, IDC_MSG_POWER_DOWN_EXT, id };

if (arch_cpu_is_core_enabled(id)) {
idc_send_msg(&power_down, IDC_NON_BLOCKING);
idc_send_msg(&power_down, IDC_POWER_DOWN);

active_cores_mask ^= (1 << id);
#if CONFIG_NO_SECONDARY_CORE_ROM
Expand Down
18 changes: 18 additions & 0 deletions src/drivers/intel/cavs/idc.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ static bool idc_is_powered_up(int target_core)
TRACE_BOOT_PLATFORM;
}

/**
* \brief Checks core status register.
* \param[in] target_core Id of the core powering up.
* \return True if core powered up, false otherwise.
*/
static bool idc_is_powered_down(int target_core)
{
return mailbox_sw_reg_read(PLATFORM_TRACEP_SECONDARY_CORE(target_core)) == 0;
}

/**
* \brief Sends IDC message.
* \param[in,out] msg Pointer to IDC message.
Expand Down Expand Up @@ -150,6 +160,14 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode)
mailbox_sw_reg_read(PLATFORM_TRACEP_SECONDARY_CORE(msg->core)));
}
break;
case IDC_POWER_DOWN:
ret = idc_wait_in_blocking_mode(msg->core, idc_is_powered_down);
if (ret < 0) {
tr_err(&idc_tr, "idc_send_msg(), power down core %d failed, reason 0x%x",
msg->core,
mailbox_sw_reg_read(PLATFORM_TRACEP_SECONDARY_CORE(msg->core)));
}
break;
}

return ret;
Expand Down
3 changes: 3 additions & 0 deletions src/include/sof/drivers/idc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
/** \brief IDC send core power up flag. */
#define IDC_POWER_UP 2

/** \brief IDC send core power down flag. */
#define IDC_POWER_DOWN 3

/** \brief IDC send timeout in microseconds. */
#define IDC_TIMEOUT 10000

Expand Down