Sound Open Firmware
Loading...
Searching...
No Matches
alh.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_ALH_H__
26#define __SOF_IPC4_ALH_H__
27
28#include <stdint.h>
29#include <stdbool.h>
30#include <stddef.h>
31#include <ipc4/gateway.h>
32
34#define IPC4_ALH_MAX_NUMBER_OF_GTW 16
35#ifdef CONFIG_DMA_INTEL_ADSP_GPDMA
37#define IPC4_ALH_DAI_INDEX_OFFSET 7
38#else
40#define IPC4_ALH_DAI_INDEX_OFFSET 0
41#endif
42
43#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_CAVS) || \
44 defined(CONFIG_SOC_ACE15_MTPM)
46#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS 16
48#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP 4
49#else
51#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS 0
53#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP 0
54#endif
55
62#define IPC4_ALH_DAI_INDEX(x) ((((x) & 0xF0) << IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP) + \
63 (((x) & 0xF) - IPC4_ALH_DAI_INDEX_OFFSET))
64
66#define IPC4_ALH_MULTI_GTW_BASE 0x50
67
74static inline bool is_multi_gateway(const union ipc4_connector_node_id node_id)
75{
76 return node_id.f.v_index >= IPC4_ALH_MULTI_GTW_BASE;
77}
78
84 uint32_t count;
86 struct {
87 uint32_t alh_id;
88 uint32_t channel_mask;
90} __attribute__((packed, aligned(4)));
91
99} __attribute__((packed, aligned(4)));
100
107static inline size_t
109{
110 return sizeof(alh_blob->gtw_attributes) +
111 sizeof(alh_blob->alh_cfg.count) +
112 sizeof(alh_blob->alh_cfg.mapping[0]) * alh_blob->alh_cfg.count;
113}
114
115#endif
#define IPC4_ALH_MULTI_GTW_BASE
Base virtual index marking the beginning of aggregated multi-gateway addressing.
Definition alh.h:66
#define IPC4_ALH_MAX_NUMBER_OF_GTW
Maximum number of single ALH channels supported in multi-gateway aggregation.
Definition alh.h:34
IPC4 audio gateway attributes, ALH, HDA, and SoundWire gateway definitions.
static size_t get_alh_config_size(const struct sof_alh_configuration_blob *alh_blob)
Calculate the serialized size of an ALH configuration blob.
Definition alh.h:108
static bool is_multi_gateway(const union ipc4_connector_node_id node_id)
Check if an IPC4 connector node ID corresponds to an aggregated multi-gateway.
Definition alh.h:74
Multi-gateway channel aggregation configuration.
Definition alh.h:83
uint32_t count
Number of single channels in mapping array.
Definition alh.h:84
struct ipc4_alh_multi_gtw_cfg::@10 mapping[IPC4_ALH_MAX_NUMBER_OF_GTW]
Single-to-multi aggregation mapping table.
uint32_t channel_mask
Bitmask of audio channels mapped to this ALH endpoint.
Definition alh.h:88
uint32_t alh_id
Virtual index (v_index) of single ALH channel.
Definition alh.h:87
Full configuration blob for Audio Hub Link (ALH) gateways.
Definition alh.h:96
struct ipc4_alh_multi_gtw_cfg alh_cfg
Multi-gateway channel aggregation mappings.
Definition alh.h:98
union ipc4_gateway_attributes gtw_attributes
Gateway memory placement attributes.
Definition alh.h:97
Audio gateway addressing descriptor (connector node ID).
Definition gateway.h:105
uint32_t v_index
Virtual DMA channel or FIFO index.
Definition gateway.h:109
struct ipc4_connector_node_id::@15 f
Bitfield access structure.
Gateway buffer allocation attributes.
Definition gateway.h:128