9#ifndef __SOF_IPC_COMMON_H__
10#define __SOF_IPC_COMMON_H__
29struct ipc4_message_request;
32#define IPC_IS_SIZE_INVALID(object) \
33 ((object).hdr.size != sizeof(object))
35#define IPC_TAIL_IS_SIZE_INVALID(object) \
36 ((object).comp.hdr.size + (object).comp.ext_data_length < sizeof(object))
42#define IPC_SIZE_ERROR_TRACE(ctx, object) \
43 tr_err(ctx, "ipc: size %d expected %zu", \
44 (object).hdr.size, sizeof(object))
47#define ipc_get_ppl_src_comp(ipc, ppl_id) \
48 ipc_get_ppl_comp(ipc, ppl_id, PPL_DIR_UPSTREAM)
51#define ipc_get_ppl_sink_comp(ipc, ppl_id) \
52 ipc_get_ppl_comp(ipc, ppl_id, PPL_DIR_DOWNSTREAM)
54#define IPC_TASK_INLINE BIT(0)
55#define IPC_TASK_IN_THREAD BIT(1)
56#define IPC_TASK_SECONDARY_CORE BIT(2)
57#define IPC_TASK_POWERDOWN BIT(3)
105#if CONFIG_TWB_IPC_TASK
111#ifdef CONFIG_SOF_USERSPACE_LL
116#ifdef CONFIG_SOF_TELEMETRY_IO_PERFORMANCE_MEASUREMENTS
118 struct io_perf_data_item *io_perf_in_msg_count;
119 struct io_perf_data_item *io_perf_out_msg_count;
123 struct k_work_delayable z_delayed_work;
124 struct k_work_q ipc_send_wq;
130#define ipc_set_drvdata(ipc, data) \
131 ((ipc)->private = data)
132#define ipc_get_drvdata(ipc) \
137#ifdef CONFIG_SOF_USERSPACE_LL
175#if CONFIG_ZEPHYR_NATIVE_DRIVERS
176 struct sof_dma *
dmac;
196 uint32_t *ring_size);
246#if defined(CONFIG_PM_DEVICE) && defined(CONFIG_IPC_SERVICE_BACKEND_INTEL_ADSP_HOST_IPC)
258void ipc_send_failed_power_transition_response(
void);
317#ifdef CONFIG_SOF_USERSPACE_LL
329int ipc_user_forward_cmd(uint32_t primary, uint32_t extension);
uint32_t data[]
Definition debug_stream_slot.h:2
void ipc_compound_msg_done(uint32_t msg_id, int error)
Complete the IPC compound message.
int ipc_dma_trace_send_position(void)
Send DMA trace host buffer position to host.
int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
Configure DAI.
int ipc4_user_process_glb_message(struct ipc4_message_request *ipc4, struct ipc_msg *reply)
Processes IPC4 userspace global message.
void ipc_cmd(struct ipc_cmd_hdr *_hdr)
Generic IPC command handler.
int ipc_init(struct sof *sof)
Initialise global IPC context.
int ipc_process_on_core(uint32_t core, bool blocking)
IPC message to be processed on other core.
struct ipc_cmd_hdr * mailbox_validate(void)
Validate mailbox contents for valid IPC header.
struct ipc_cmd_hdr * ipc_prepare_to_send(const struct ipc_msg *msg)
Prepare an IPC message for sending.
struct ipc_cmd_hdr * ipc_compact_read_msg(void)
Read a compact IPC message or return NULL for normal message.
void ipc_boot_complete_msg(struct ipc_cmd_hdr *header, uint32_t data)
create a IPC boot complete message.
void ipc_send_buffer_status_notify(void)
send a IPC buffer status notify message
static struct ipc * ipc_get(void)
Get the IPC global context.
Definition common.h:147
int ipc_compact_write_msg(struct ipc_cmd_hdr *hdr)
Write a compact IPC message.
int ipc4_user_process_module_message(struct ipc4_message_request *ipc4, struct ipc_msg *reply)
Processes IPC4 userspace module message.
void ipc_send_panic_notification(void)
Send a IPC notification that FW has hit a DSP notification.
void ipc_complete_cmd(struct ipc *ipc)
Call platform-specific IPC completion function.
struct task_ops ipc_task_ops
int ipc_process_host_buffer(struct ipc *ipc, struct sof_ipc_host_buffer *ring, uint32_t direction, struct dma_sg_elem_array *elem_array, uint32_t *ring_size)
Processes page tables for the host buffer.
void ipc_free(struct ipc *ipc)
Free global IPC context.
IPC definitions for streams.
#define list_item(item, type, member)
Definition list.h:80
struct sof * sof_get(void)
Audio component base device "class".
Definition component.h:645
Audio component base driver "class".
Definition component.h:587
DAI runtime data.
Definition dai-zephyr.h:119
SG elem array.
Definition dma.h:155
Data provided by the platform which use ipc...page_descriptors().
Definition common.h:173
struct dma * dmac
Definition common.h:178
uint8_t * page_table
Definition common.h:180
struct k_thread * audio_thread
Definition common.h:76
struct k_event * event
Definition common.h:62
const struct comp_driver * init_drv
Original kernel driver pointer for restoring dev->drv after create.
Definition common.h:78
uint32_t reply_tx_size
Reply TX data size from user thread (e.g.
Definition common.h:72
uint32_t reply_ext
Reply extension word from user thread (e.g.
Definition common.h:70
uint8_t init_drv_data[160] __aligned(4)
User-accessible copy of comp_driver + tr_ctx for create().
uint32_t ipc_msg_ext
Copy of IPC4 message extension word forwarded to user thread.
Definition common.h:66
int result
Result code from user thread processing.
Definition common.h:68
struct ipc * ipc
Definition common.h:75
struct k_sem * sem
Definition common.h:61
uint32_t ipc_msg_pri
Copy of IPC4 message primary word forwarded to user thread.
Definition common.h:64
struct k_thread * thread
Definition common.h:60
void * reply_tx_data
Reply TX data pointer from user thread (e.g.
Definition common.h:74
bool is_notification_pending
Definition common.h:98
unsigned int core
Definition common.h:100
int pm_prepare_D3
Definition common.h:95
void * comp_data
Definition common.h:92
struct k_spinlock lock
Definition common.h:91
struct list_item msg_list
Definition common.h:97
uint32_t task_mask
Definition common.h:99
struct task ipc_task
Definition common.h:108
struct list_item comp_list
Definition common.h:102
Definition ringbuffer.h:21
General firmware context.
Definition sof.h:44
struct ipc * ipc
Definition sof.h:51
Task operations.
Definition task.h:49
Task used by schedulers.
Definition task.h:56