File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 101101#define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004)
102102#define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005)
103103#define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006)
104+ #define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007)
104105
105106/* component runtime config - multiple different types */
106107#define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001)
@@ -817,6 +818,12 @@ struct sof_ipc_pm_ctx {
817818 struct sof_ipc_pm_ctx_elem elems [];
818819};
819820
821+ /* enable or disable cores - SOF_IPC_PM_CORE_ENABLE */
822+ struct sof_ipc_pm_core_config {
823+ struct sof_ipc_hdr hdr ;
824+ uint32_t enable_mask ;
825+ };
826+
820827/*
821828 * Firmware boot and version
822829 */
Original file line number Diff line number Diff line change 5858#include <uapi/ipc.h>
5959#include <sof/intel-ipc.h>
6060#include <sof/dma-trace.h>
61+ #include <sof/cpu.h>
6162#include <config.h>
6263
6364#define iGS (x ) ((x >> SOF_GLB_TYPE_SHIFT) & 0xf)
@@ -588,6 +589,25 @@ static int ipc_pm_context_restore(uint32_t header)
588589 return 0 ;
589590}
590591
592+ static int ipc_pm_core_enable (uint32_t header )
593+ {
594+ struct sof_ipc_pm_core_config * pm_core_config = _ipc -> comp_data ;
595+ int i = 0 ;
596+
597+ trace_ipc ("PMc" );
598+
599+ for (i = 0 ; i < PLATFORM_CORE_COUNT ; i ++ ) {
600+ if (i != PLATFORM_MASTER_CORE_ID ) {
601+ if (pm_core_config -> enable_mask & (1 << i ))
602+ cpu_enable_core (i );
603+ else
604+ cpu_disable_core (i );
605+ }
606+ }
607+
608+ return 0 ;
609+ }
610+
591611static int ipc_glb_pm_message (uint32_t header )
592612{
593613 uint32_t cmd = (header & SOF_CMD_TYPE_MASK ) >> SOF_CMD_TYPE_SHIFT ;
@@ -599,6 +619,8 @@ static int ipc_glb_pm_message(uint32_t header)
599619 return ipc_pm_context_restore (header );
600620 case iCS (SOF_IPC_PM_CTX_SIZE ):
601621 return ipc_pm_context_size (header );
622+ case iCS (SOF_IPC_PM_CORE_ENABLE ):
623+ return ipc_pm_core_enable (header );
602624 case iCS (SOF_IPC_PM_CLK_SET ):
603625 case iCS (SOF_IPC_PM_CLK_GET ):
604626 case iCS (SOF_IPC_PM_CLK_REQ ):
You can’t perform that action at this time.
0 commit comments