Skip to content

Commit 9bff797

Browse files
author
Jyri Sarha
committed
ASoC: ipc4: Add SOF_IPC4_GLB_CREATE_PIPELINE payload macros and structs
Adds SOF_IPC4_GLB_PIPE_EXT_OBJ_ARRAY macros to set extension bit in SOF_IPC4_GLB_CREATE_PIPELINE indicating presence of the payload, and all necessary macros and structs to create the payload. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 617f177 commit 9bff797

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

include/sound/sof/ipc4/header.h

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ enum sof_ipc4_pipeline_state {
188188
#define SOF_IPC4_GLB_PIPE_EXT_CORE_ID_MASK GENMASK(23, 20)
189189
#define SOF_IPC4_GLB_PIPE_EXT_CORE_ID(x) ((x) << SOF_IPC4_GLB_PIPE_EXT_CORE_ID_SHIFT)
190190

191+
#define SOF_IPC4_GLB_PIPE_PAYLOAD_SHIFT 29
192+
#define SOF_IPC4_GLB_PIPE_PAYLOAD_MASK BIT(29)
193+
#define SOF_IPC4_GLB_PIPE_PAYLOAD(x) ((x) << SOF_IPC4_GLB_PIPE_PAYLOAD_SHIFT)
194+
191195
/* pipeline set state ipc msg */
192196
#define SOF_IPC4_GLB_PIPE_STATE_ID_SHIFT 16
193197
#define SOF_IPC4_GLB_PIPE_STATE_ID_MASK GENMASK(23, 16)
@@ -691,6 +695,77 @@ struct sof_ipc4_mod_init_ext_memory_data {
691695
u32 heap_bytes; /* stack size in bytes, 0 means default size */
692696
} __packed __aligned(4);
693697

698+
699+
/*
700+
* This set of macros are very similar to the set above, but these are
701+
* for building payload to SOF_IPC4_GLB_CREATE_PIPELINE message.
702+
*
703+
* Macros for creating struct sof_ipc4_glb_pipe_payload payload with
704+
* its associated data. ext_init payload should be the first piece of
705+
* payload following SOF_IPC4_GLB_CREATE_PIPELINE msg, and its
706+
* existence is indicated with SOF_IPC4_GLB_PIPE_PAYLOAD bit.
707+
*
708+
* The macros below apply to sof_ipc4_glb_pipe_payload.word0
709+
*/
710+
#define SOF_IPC4_GLB_PIPE_PAYLOAD_WORDS_SHIFT 0
711+
#define SOF_IPC4_GLB_PIPE_PAYLOAD_WORDS_MASK GENMASK(23, 0)
712+
#define SOF_IPC4_GLB_PIPE_PAYLOAD_WORDS(x) ((x) << SOF_IPC4_GLB_PIPE_PAYLOAD_WORDS_SHIFT)
713+
714+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_ARRAY_SHIFT 24
715+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_ARRAY_MASK BIT(24)
716+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_ARRAY(x) ((x) << SOF_IPC4_GLB_PIPE_EXT_OBJ_ARRAY_SHIFT)
717+
718+
struct sof_ipc4_glb_pipe_payload {
719+
u32 word0;
720+
u32 rsvd1;
721+
u32 rsvd2;
722+
} __packed __aligned(4);
723+
724+
/*
725+
* SOF_IPC4_GLB_CREATE_PIPELINE payload may be followed by arbitrary
726+
* number of object array objects. SOF_IPC4_GLB_PIPE_EXT_OBJ_ARRAY-bit
727+
* indicates that an array object follows struct
728+
* sof_ipc4_glb_pipe_payload.
729+
*
730+
* The object header's SOF_IPC4_GLB_PIPE_EXT_OBJ_LAST-bit in struct
731+
* sof_ipc4_module_init_ext_object indicates if the array is continued
732+
* with another object. The header has also fields to identify the
733+
* object, SOF_IPC4_GLB_PIPE_EXT_OBJ_ID, and to indicate the object's
734+
* size in 32-bit words, SOF_IPC4_GLB_PIPE_EXT_OBJ_WORDS, not
735+
* including the header itself.
736+
*
737+
* The macros below apply to sof_ipc4_glb_pipe_ext_object.header
738+
*/
739+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_LAST_SHIFT 0
740+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_LAST_MASK BIT(0)
741+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_LAST(x) ((x) << SOF_IPC4_GLB_PIPE_EXT_OBJ_LAST_SHIFT)
742+
743+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_ID_SHIFT 1
744+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_ID_MASK GENMASK(15, 1)
745+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_ID(x) ((x) << SOF_IPC4_GLB_PIPE_EXT_OBJ_ID_SHIFT)
746+
747+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_WORDS_SHIFT 16
748+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_WORDS_MASK GENMASK(31, 16)
749+
#define SOF_IPC4_GLB_PIPE_EXT_OBJ_WORDS(x) ((x) << SOF_IPC4_GLB_PIPE_EXT_OBJ_WORDS_SHIFT)
750+
751+
struct sof_ipc4_glb_pipe_ext_object {
752+
u32 header;
753+
u32 data[];
754+
} __packed __aligned(4);
755+
756+
enum sof_ipc4_glb_pipe_ext_obj_id {
757+
SOF_IPC4_GLB_PIPE_DATA_ID_INVALID = 0,
758+
SOF_IPC4_GLB_PIPE_DATA_ID_MEM_DATA,
759+
SOF_IPC4_GLB_PIPE_DATA_ID_MAX = SOF_IPC4_GLB_PIPE_DATA_ID_MEM_DATA,
760+
};
761+
762+
/* DP module memory configuration data object for ext_init object array */
763+
struct sof_ipc4_glb_pipe_ext_obj_memory_data {
764+
u32 domain_id; /* userspace domain ID */
765+
u32 stack_bytes; /* stack size in bytes, 0 means default size */
766+
u32 heap_bytes; /* stack size in bytes, 0 means default size */
767+
} __packed __aligned(4);
768+
694769
/** @}*/
695770

696771
#endif

0 commit comments

Comments
 (0)