Skip to content

Commit b01ed57

Browse files
lrgirdwolgirdwood
authored andcommitted
test: ipc: Add FW testing IPC foundations.
Add a new IPC global class for FW testing alongside the first "test" IPC command for flooding the DSP with IPCs. Needs to have CONFIG_DEBUG enabled. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 261fef4 commit b01ed57

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/include/uapi/ipc/header.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U)
9494
#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U)
9595
#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU)
96+
#define SOF_IPC_GLB_TEST SOF_GLB_TYPE(0xBU)
9697

9798
/** @} */
9899

@@ -173,6 +174,14 @@
173174

174175
/** @} */
175176

177+
/** \name DSP Command: Test - Debug build only
178+
* @{
179+
*/
180+
181+
#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001)
182+
183+
/** @} */
184+
176185
/** \name IPC Message Definitions
177186
* @{
178187
*/

src/ipc/handler.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,21 @@ static int ipc_glb_tplg_message(uint32_t header)
11001100
}
11011101
}
11021102

1103+
#ifdef CONFIG_DEBUG
1104+
static int ipc_glb_test_message(uint32_t header)
1105+
{
1106+
uint32_t cmd = iCS(header);
1107+
1108+
switch (cmd) {
1109+
case SOF_IPC_TEST_IPC_FLOOD:
1110+
return 0; /* just return so next IPC can be sent */
1111+
default:
1112+
trace_ipc_error("ipc: unknown test header 0x%x", header);
1113+
return -EINVAL;
1114+
}
1115+
}
1116+
#endif
1117+
11031118
/*
11041119
* Global IPC Operations.
11051120
*/
@@ -1136,6 +1151,10 @@ int ipc_cmd(void)
11361151
return ipc_glb_debug_message(hdr->cmd);
11371152
case SOF_IPC_GLB_GDB_DEBUG:
11381153
return ipc_glb_gdb_debug(hdr->cmd);
1154+
#ifdef CONFIG_DEBUG
1155+
case SOF_IPC_GLB_TEST:
1156+
return ipc_glb_test_message(hdr->cmd);
1157+
#endif
11391158
default:
11401159
trace_ipc_error("ipc: unknown command type %u", type);
11411160
return -EINVAL;

0 commit comments

Comments
 (0)