xref: /linux/include/uapi/sound/sof/header.h (revision 33e02dc69afbd8f1b85a51d74d72f139ba4ca623)
14483151eSLiam Girdwood /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
24483151eSLiam Girdwood /*
34483151eSLiam Girdwood  * This file is provided under a dual BSD/GPLv2 license.  When using or
44483151eSLiam Girdwood  * redistributing this file, you may do so under either license.
54483151eSLiam Girdwood  *
6*ea89a742SPierre-Louis Bossart  * Copyright(c) 2018 Intel Corporation
74483151eSLiam Girdwood  */
84483151eSLiam Girdwood 
94483151eSLiam Girdwood #ifndef __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
104483151eSLiam Girdwood #define __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
114483151eSLiam Girdwood 
1262ec3d13SMasahiro Yamada #include <linux/types.h>
1362ec3d13SMasahiro Yamada 
142e4ef6f4SPeter Ujfalusi /**
152e4ef6f4SPeter Ujfalusi  * struct sof_abi_hdr - Header for all non IPC ABI data.
16ea4a4e82SPeter Ujfalusi  * @magic: Magic number for validation
17ea4a4e82SPeter Ujfalusi  *	   for IPC3 data: 0x00464F53 ('S', 'O', 'F', '\0')
18ea4a4e82SPeter Ujfalusi  *	   for IPC4 data: 0x34464F53 ('S', 'O', 'F', '4')
19ea4a4e82SPeter Ujfalusi  * @type: module specific parameter
20ea4a4e82SPeter Ujfalusi  *	  for IPC3: Component specific type
21ea4a4e82SPeter Ujfalusi  *	  for IPC4: parameter ID (param_id) of the data
222e4ef6f4SPeter Ujfalusi  * @size: The size in bytes of the data, excluding this struct
23ea4a4e82SPeter Ujfalusi  * @abi: SOF ABI version. The version is valid in scope of the 'magic', IPC3 and
24ea4a4e82SPeter Ujfalusi  *	 IPC4 ABI version numbers have no relationship.
252e4ef6f4SPeter Ujfalusi  * @reserved: Reserved for future use
262e4ef6f4SPeter Ujfalusi  * @data: Component data - opaque to core
274483151eSLiam Girdwood  *
284483151eSLiam Girdwood  * Identifies data type, size and ABI.
294483151eSLiam Girdwood  * Used by any bespoke component data structures or binary blobs.
304483151eSLiam Girdwood  */
314483151eSLiam Girdwood struct sof_abi_hdr {
322e4ef6f4SPeter Ujfalusi 	__u32 magic;
332e4ef6f4SPeter Ujfalusi 	__u32 type;
342e4ef6f4SPeter Ujfalusi 	__u32 size;
352e4ef6f4SPeter Ujfalusi 	__u32 abi;
362e4ef6f4SPeter Ujfalusi 	__u32 reserved[4];
372e4ef6f4SPeter Ujfalusi 	__u32 data[];
384483151eSLiam Girdwood }  __packed;
394483151eSLiam Girdwood 
404453d24dSRanjani Sridharan #define SOF_MANIFEST_DATA_TYPE_NHLT 1
414453d24dSRanjani Sridharan 
424453d24dSRanjani Sridharan /**
434453d24dSRanjani Sridharan  * struct sof_manifest_tlv - SOF manifest TLV data
444453d24dSRanjani Sridharan  * @type: type of data
454453d24dSRanjani Sridharan  * @size: data size (not including the size of this struct)
464453d24dSRanjani Sridharan  * @data: payload data
474453d24dSRanjani Sridharan  */
484453d24dSRanjani Sridharan struct sof_manifest_tlv {
494453d24dSRanjani Sridharan 	__le32 type;
504453d24dSRanjani Sridharan 	__le32 size;
514453d24dSRanjani Sridharan 	__u8 data[];
524453d24dSRanjani Sridharan };
534453d24dSRanjani Sridharan 
544453d24dSRanjani Sridharan /**
554453d24dSRanjani Sridharan  * struct sof_manifest - SOF topology manifest
564453d24dSRanjani Sridharan  * @abi_major: Major ABI version
574453d24dSRanjani Sridharan  * @abi_minor: Minor ABI version
584453d24dSRanjani Sridharan  * @abi_patch: ABI patch
594453d24dSRanjani Sridharan  * @count: count of tlv items
604453d24dSRanjani Sridharan  * @items: consecutive variable size tlv items
614453d24dSRanjani Sridharan  */
624453d24dSRanjani Sridharan struct sof_manifest {
634453d24dSRanjani Sridharan 	__le16 abi_major;
644453d24dSRanjani Sridharan 	__le16 abi_minor;
654453d24dSRanjani Sridharan 	__le16 abi_patch;
664453d24dSRanjani Sridharan 	__le16 count;
674453d24dSRanjani Sridharan 	struct sof_manifest_tlv items[];
684453d24dSRanjani Sridharan };
694453d24dSRanjani Sridharan 
704483151eSLiam Girdwood #endif
71