Sound Open Firmware
Loading...
Searching...
No Matches
gateway.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2021 Intel Corporation. All rights reserved.
4 */
5
6/*
7 * This file contains structures that are exact copies of an existing ABI used
8 * by IOT middleware. They are Intel specific and will be used by one middleware.
9 *
10 * Some of the structures may contain programming implementations that makes them
11 * unsuitable for generic use and general usage.
12 *
13 * This code is mostly copied "as-is" from existing C++ interface files hence the use of
14 * different style in places. The intention is to keep the interface as close as possible to
15 * original so it's easier to track changes with IPC host code.
16 */
17
25#ifndef __SOF_IPC4_GATEWAY_H__
26#define __SOF_IPC4_GATEWAY_H__
27
28#include <stdint.h>
29#include <rtos/bit.h>
30
91
93#define IPC4_INVALID_NODE_ID 0xffffffff
94
96#define IPC4_NODE_ID_MASK 0x1fff
97
106 uint32_t dw;
108 struct {
109 uint32_t v_index : 8;
110 uint32_t dma_type : 5;
111 uint32_t _rsvd : 19;
112 } f;
113} __attribute__((packed, aligned(4)));
114
116#define IPC4_HW_HOST_OUTPUT_NODE_ID_BASE 0x00
118#define IPC4_HW_CODE_LOADER_NODE_ID 0x0F
120#define IPC4_HW_LINK_INPUT_NODE_ID_BASE 0x10
121
129 uint32_t dw;
131 struct {
132 uint32_t lp_buffer_alloc : 1;
133 uint32_t alloc_from_reg_file : 1;
134 uint32_t _rsvd : 30;
136} __attribute__((packed, aligned(4)));
137
144 uint32_t config_blob[];
145} __attribute__((packed, aligned(4)));
146
152 uint32_t buffer_size;
154 union {
155 struct {
156 uint32_t notif_high : 1;
157 uint32_t notif_low : 1;
158 uint32_t rsvd : 30;
159 } f;
160 uint32_t flags_raw;
161 } u;
163 uint32_t threshold_high;
164 uint32_t threshold_low;
165} __attribute__((packed, aligned(4)));
166
172 ipc4_gtw_none = BIT(0),
173 ipc4_gtw_host = BIT(1),
174 ipc4_gtw_dmic = BIT(2),
175 ipc4_gtw_link = BIT(3),
176 ipc4_gtw_alh = BIT(4),
177 ipc4_gtw_ssp = BIT(5),
178 ipc4_gtw_all = BIT(6) - 1
180
186 ipc4_playback = BIT(0),
187 ipc4_capture = BIT(1),
188 ipc4_bidirection = BIT(0) | BIT(1)
190
192#define IPC4_DIRECTION(x) BIT(x)
193#endif
ipc4_gateway_type
Gateway peripheral category bitmask.
Definition gateway.h:171
ipc4_direction_type
Audio data stream direction flags.
Definition gateway.h:185
ipc4_connector_node_id_type
Hardware and virtual audio gateway connector types.
Definition gateway.h:35
@ ipc4_gtw_none
No gateway specified.
Definition gateway.h:172
@ ipc4_gtw_all
Bitmask covering all gateway types.
Definition gateway.h:178
@ ipc4_gtw_dmic
Digital microphone gateway.
Definition gateway.h:174
@ ipc4_gtw_alh
Audio Hub Link / SoundWire gateway.
Definition gateway.h:176
@ ipc4_gtw_host
Host DMA gateway.
Definition gateway.h:173
@ ipc4_gtw_link
HD/A link gateway.
Definition gateway.h:175
@ ipc4_gtw_ssp
SSP / I2S gateway.
Definition gateway.h:177
@ ipc4_playback
Playback stream direction (host/memory to peripheral).
Definition gateway.h:186
@ ipc4_capture
Capture stream direction (peripheral to host/memory).
Definition gateway.h:187
@ ipc4_bidirection
Bidirectional stream direction.
Definition gateway.h:188
@ ipc4_ipc_input_class
Inter-Processor Communication (IPC) input (host/peer to DSP).
Definition gateway.h:76
@ ipc4_spi_output_class
SPI hardware gateway output.
Definition gateway.h:85
@ ipc4_ipc_output_class
Inter-Processor Communication (IPC) output (DSP to host/peer).
Definition gateway.h:74
@ ipc4_spi_input_class
SPI hardware gateway input.
Definition gateway.h:87
@ ipc4_hda_link_input_class
HD/A link input (external codec to DSP capture).
Definition gateway.h:46
@ ipc4_hda_host_inout_class
HD/A host bidirectional stream (reserved for future use).
Definition gateway.h:41
@ ipc4_alh_link_output_class
ALH link output, legacy alias for SoundWire (DSP to SoundWire link).
Definition gateway.h:59
@ ipc4_dmic_link_input_class
Digital Microphone (DMIC) link input (microphones to DSP capture).
Definition gateway.h:51
@ ipc4_i2s_link_input_class
I2S/SSP link input (I2S codec to DSP capture).
Definition gateway.h:56
@ ipc4_alh_uaol_stream_link_input_class
USB Audio Offload (UAOL) link input (UAOL controller to DSP).
Definition gateway.h:71
@ ipc4_hda_host_output_class
HD/A host output stream (Host to DSP playback).
Definition gateway.h:37
@ ipc4_gpio_class
GPIO hardware gateway.
Definition gateway.h:83
@ ipc4_i2s_multi_link_output_class
I2S aggregated multi-gateway output.
Definition gateway.h:79
@ ipc4_max_connector_node_id_type
Sentinel marking maximum connector node ID type.
Definition gateway.h:89
@ ipc4_alh_link_input_class
ALH link input, legacy alias for SoundWire (SoundWire link to DSP).
Definition gateway.h:61
@ ipc4_alh_uaol_stream_link_output_class
USB Audio Offload (UAOL) link output (DSP to UAOL controller).
Definition gateway.h:69
@ ipc4_i2s_link_output_class
I2S/SSP link output (DSP to I2S codec playback).
Definition gateway.h:54
@ ipc4_hda_host_input_class
HD/A host input stream (DSP to Host capture).
Definition gateway.h:39
@ ipc4_alh_snd_wire_stream_link_output_class
SoundWire link output stream (DSP to SoundWire codec playback).
Definition gateway.h:64
@ ipc4_hda_link_inout_class
HD/A link bidirectional stream (reserved for future use).
Definition gateway.h:48
@ ipc4_i2s_multi_link_input_class
I2S aggregated multi-gateway input.
Definition gateway.h:81
@ ipc4_hda_link_output_class
HD/A link output (DSP to external codec playback).
Definition gateway.h:44
@ ipc4_alh_snd_wire_stream_link_input_class
SoundWire link input stream (SoundWire codec to DSP capture).
Definition gateway.h:66
Generic gateway configuration blob container.
Definition gateway.h:142
uint32_t config_blob[]
Variable-length gateway-specific configuration payload.
Definition gateway.h:144
union ipc4_gateway_attributes gtw_attributes
Memory allocation attributes.
Definition gateway.h:143
Configuration parameters for IPC Host Gateway.
Definition gateway.h:151
uint32_t flags_raw
Raw 32-bit flags value.
Definition gateway.h:160
uint32_t notif_low
Send notification when buffer falls below low threshold.
Definition gateway.h:157
uint32_t rsvd
Reserved bits.
Definition gateway.h:158
uint32_t threshold_low
Low buffer fill watermark in bytes.
Definition gateway.h:164
struct ipc4_ipc_gateway_config_blob::@17::@18 f
Bitfield access structure.
union ipc4_ipc_gateway_config_blob::@17 u
Notification threshold flags union.
uint32_t notif_high
Send notification when buffer exceeds high threshold.
Definition gateway.h:156
uint32_t buffer_size
Size of gateway circular buffer in bytes.
Definition gateway.h:152
uint32_t threshold_high
High buffer fill watermark in bytes.
Definition gateway.h:163
Audio gateway addressing descriptor (connector node ID).
Definition gateway.h:105
uint32_t dw
Raw 32-bit value of node ID.
Definition gateway.h:106
uint32_t v_index
Virtual DMA channel or FIFO index.
Definition gateway.h:109
uint32_t _rsvd
Reserved bits.
Definition gateway.h:111
struct ipc4_connector_node_id::@15 f
Bitfield access structure.
uint32_t dma_type
Gateway type (enum ipc4_connector_node_id_type).
Definition gateway.h:110
Gateway buffer allocation attributes.
Definition gateway.h:128
struct ipc4_gateway_attributes::@16 bits
Bitfield access structure.
uint32_t lp_buffer_alloc
Allocate gateway buffers in Low Power (LP) SRAM.
Definition gateway.h:132
uint32_t _rsvd
Reserved bits.
Definition gateway.h:134
uint32_t dw
Raw 32-bit attributes value.
Definition gateway.h:129
uint32_t alloc_from_reg_file
Allocate gateway structures from DSP register file.
Definition gateway.h:133