Skip to content

Commit a5f1d58

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 4ab1b09 commit a5f1d58

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

include/sound/sof/ipc4/header.h

Lines changed: 76 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,78 @@ struct sof_ipc4_mod_init_ext_dp_memory_data {
691695
u32 heap_bytes; /* stack size in bytes, 0 means default size */
692696
} __packed __aligned(4);
693697

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

696772
#endif

0 commit comments

Comments
 (0)