linux/include/sound/sof/header.h

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/*
 * This file is provided under a dual BSD/GPLv2 license.  When using or
 * redistributing this file, you may do so under either license.
 *
 * Copyright(c) 2018 Intel Corporation
 */

#ifndef __INCLUDE_SOUND_SOF_HEADER_H__
#define __INCLUDE_SOUND_SOF_HEADER_H__

#include <linux/types.h>
#include <uapi/sound/sof/abi.h>

/** \addtogroup sof_uapi uAPI
 *  SOF uAPI specification.
 *  @{
 */

/*
 * IPC messages have a prefixed 32 bit identifier made up as follows :-
 *
 * 0xGCCCNNNN where
 * G is global cmd type (4 bits)
 * C is command type (12 bits)
 * I is the ID number (16 bits) - monotonic and overflows
 *
 * This is sent at the start of the IPM message in the mailbox. Messages should
 * not be sent in the doorbell (special exceptions for firmware .
 */

/* Global Message - Generic */
#define SOF_GLB_TYPE_SHIFT
#define SOF_GLB_TYPE_MASK
#define SOF_GLB_TYPE(x)

/* Command Message - Generic */
#define SOF_CMD_TYPE_SHIFT
#define SOF_CMD_TYPE_MASK
#define SOF_CMD_TYPE(x)

/* Global Message Types */
#define SOF_IPC_GLB_REPLY
#define SOF_IPC_GLB_COMPOUND
#define SOF_IPC_GLB_TPLG_MSG
#define SOF_IPC_GLB_PM_MSG
#define SOF_IPC_GLB_COMP_MSG
#define SOF_IPC_GLB_STREAM_MSG
#define SOF_IPC_FW_READY
#define SOF_IPC_GLB_DAI_MSG
#define SOF_IPC_GLB_TRACE_MSG
#define SOF_IPC_GLB_GDB_DEBUG
#define SOF_IPC_GLB_TEST_MSG
#define SOF_IPC_GLB_PROBE
#define SOF_IPC_GLB_DEBUG

/*
 * DSP Command Message Types
 */

/* topology */
#define SOF_IPC_TPLG_COMP_NEW
#define SOF_IPC_TPLG_COMP_FREE
#define SOF_IPC_TPLG_COMP_CONNECT
#define SOF_IPC_TPLG_PIPE_NEW
#define SOF_IPC_TPLG_PIPE_FREE
#define SOF_IPC_TPLG_PIPE_CONNECT
#define SOF_IPC_TPLG_PIPE_COMPLETE
#define SOF_IPC_TPLG_BUFFER_NEW
#define SOF_IPC_TPLG_BUFFER_FREE

/* PM */
#define SOF_IPC_PM_CTX_SAVE
#define SOF_IPC_PM_CTX_RESTORE
#define SOF_IPC_PM_CTX_SIZE
#define SOF_IPC_PM_CLK_SET
#define SOF_IPC_PM_CLK_GET
#define SOF_IPC_PM_CLK_REQ
#define SOF_IPC_PM_CORE_ENABLE
#define SOF_IPC_PM_GATE

/* component runtime config - multiple different types */
#define SOF_IPC_COMP_SET_VALUE
#define SOF_IPC_COMP_GET_VALUE
#define SOF_IPC_COMP_SET_DATA
#define SOF_IPC_COMP_GET_DATA
#define SOF_IPC_COMP_NOTIFICATION

/* DAI messages */
#define SOF_IPC_DAI_CONFIG
#define SOF_IPC_DAI_LOOPBACK

/* stream */
#define SOF_IPC_STREAM_PCM_PARAMS
#define SOF_IPC_STREAM_PCM_PARAMS_REPLY
#define SOF_IPC_STREAM_PCM_FREE
#define SOF_IPC_STREAM_TRIG_START
#define SOF_IPC_STREAM_TRIG_STOP
#define SOF_IPC_STREAM_TRIG_PAUSE
#define SOF_IPC_STREAM_TRIG_RELEASE
#define SOF_IPC_STREAM_TRIG_DRAIN
#define SOF_IPC_STREAM_TRIG_XRUN
#define SOF_IPC_STREAM_POSITION
#define SOF_IPC_STREAM_VORBIS_PARAMS
#define SOF_IPC_STREAM_VORBIS_FREE

/* probe */
#define SOF_IPC_PROBE_INIT
#define SOF_IPC_PROBE_DEINIT
#define SOF_IPC_PROBE_DMA_ADD
#define SOF_IPC_PROBE_DMA_INFO
#define SOF_IPC_PROBE_DMA_REMOVE
#define SOF_IPC_PROBE_POINT_ADD
#define SOF_IPC_PROBE_POINT_INFO
#define SOF_IPC_PROBE_POINT_REMOVE

/* trace */
#define SOF_IPC_TRACE_DMA_PARAMS
#define SOF_IPC_TRACE_DMA_POSITION
#define SOF_IPC_TRACE_DMA_PARAMS_EXT
#define SOF_IPC_TRACE_FILTER_UPDATE
#define SOF_IPC_TRACE_DMA_FREE

/* debug */
#define SOF_IPC_DEBUG_MEM_USAGE

/* test */
#define SOF_IPC_TEST_IPC_FLOOD

/* Get message component id */
#define SOF_IPC_MESSAGE_ID(x)

/* maximum message size for mailbox Tx/Rx */
#define SOF_IPC_MSG_MAX_SIZE

/*
 * Structure Header - Header for all IPC structures except command structs.
 * The size can be greater than the structure size and that means there is
 * extended bespoke data beyond the end of the structure including variable
 * arrays.
 */

struct sof_ipc_hdr {} __packed;

/*
 * Command Header - Header for all IPC commands. Identifies IPC message.
 * The size can be greater than the structure size and that means there is
 * extended bespoke data beyond the end of the structure including variable
 * arrays.
 */

struct sof_ipc_cmd_hdr {} __packed;

/*
 * Generic reply message. Some commands override this with their own reply
 * types that must include this at start.
 */
struct sof_ipc_reply {}  __packed;

/*
 * Compound commands - SOF_IPC_GLB_COMPOUND.
 *
 * Compound commands are sent to the DSP as a single IPC operation. The
 * commands are split into blocks and each block has a header. This header
 * identifies the command type and the number of commands before the next
 * header.
 */

struct sof_ipc_compound_hdr {}  __packed;

/**
 * OOPS header architecture specific data.
 */
struct sof_ipc_dsp_oops_arch_hdr {}  __packed;

/**
 * OOPS header platform specific data.
 */
struct sof_ipc_dsp_oops_plat_hdr {}  __packed;

/** @}*/

#endif