diff --git a/src/audio/base_fw_intel.c b/src/audio/base_fw_intel.c index 520894ec2d0a..5c38d07960cc 100644 --- a/src/audio/base_fw_intel.c +++ b/src/audio/base_fw_intel.c @@ -24,6 +24,7 @@ #include #include +#include #include #include "copier/copier_gain.h" @@ -47,6 +48,10 @@ struct ipc4_modules_info { #define PLATFORM_LPSRAM_EBB_COUNT (DT_REG_SIZE(DT_NODELABEL(sram1)) / SRAM_BANK_SIZE) #define PLATFORM_HPSRAM_EBB_COUNT (DT_REG_SIZE(DT_NODELABEL(sram0)) / SRAM_BANK_SIZE) +#define DT_NUM_SSP_BASE DT_NUM_INST_STATUS_OKAY(intel_ssp) +#define DT_NUM_HDA_IN DT_PROP(DT_INST(0, intel_adsp_hda_link_in), dma_channels) +#define DT_NUM_HDA_OUT DT_PROP(DT_INST(0, intel_adsp_hda_link_out), dma_channels) + LOG_MODULE_REGISTER(basefw_intel, CONFIG_SOF_LOG_LEVEL); int basefw_vendor_fw_config(uint32_t *data_offset, char *data) @@ -83,8 +88,8 @@ int basefw_vendor_hw_config(uint32_t *data_offset, char *data) tuple = tlv_next(tuple); /* 2 DMIC dais */ - value = DAI_NUM_SSP_BASE + DAI_NUM_HDA_IN + DAI_NUM_HDA_OUT + - DAI_NUM_ALH_BI_DIR_LINKS + 2; + value = DT_NUM_SSP_BASE + DT_NUM_HDA_IN + DT_NUM_HDA_OUT + + IPC4_DAI_NUM_ALH_BI_DIR_LINKS + 2; tlv_value_uint32_set(tuple, IPC4_GATEWAY_COUNT_HW_CFG, value); tuple = tlv_next(tuple); diff --git a/src/audio/chain_dma.c b/src/audio/chain_dma.c index 77081b962bb3..d2cc14230ea9 100644 --- a/src/audio/chain_dma.c +++ b/src/audio/chain_dma.c @@ -30,8 +30,11 @@ #include #endif +#define DT_NUM_HDA_IN DT_PROP(DT_INST(0, intel_adsp_hda_link_in), dma_channels) +#define DT_NUM_HDA_OUT DT_PROP(DT_INST(0, intel_adsp_hda_link_out), dma_channels) + static const struct comp_driver comp_chain_dma; -static const uint32_t max_chain_number = DAI_NUM_HDA_OUT + DAI_NUM_HDA_IN; +static const uint32_t max_chain_number = DT_NUM_HDA_OUT + DT_NUM_HDA_IN; LOG_MODULE_REGISTER(chain_dma, CONFIG_SOF_LOG_LEVEL); @@ -405,10 +408,10 @@ static int get_connector_node_id(uint32_t dma_id, bool host_type, { uint8_t type = host_type ? ipc4_hda_host_output_class : ipc4_hda_link_output_class; - if (dma_id >= DAI_NUM_HDA_OUT) { + if (dma_id >= DT_NUM_HDA_OUT) { type = host_type ? ipc4_hda_host_input_class : ipc4_hda_link_input_class; - dma_id -= DAI_NUM_HDA_OUT; - if (dma_id >= DAI_NUM_HDA_IN) + dma_id -= DT_NUM_HDA_OUT; + if (dma_id >= DT_NUM_HDA_IN) return -EINVAL; } connector_node_id->dw = 0; diff --git a/src/include/ipc4/alh.h b/src/include/ipc4/alh.h index eaa6692210c3..c15578514b2a 100644 --- a/src/include/ipc4/alh.h +++ b/src/include/ipc4/alh.h @@ -36,10 +36,19 @@ #define IPC4_ALH_DAI_INDEX_OFFSET 0 #endif +#if defined(CONFIG_SOC_SERIES_INTEL_ADSP_CAVS) || \ + defined(CONFIG_SOC_INTEL_ACE15_MTPM) +#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS 16 +#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP 4 +#else +#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS 0 +#define IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP 0 +#endif + /* copier id = (group id << 4) + codec id + IPC4_ALH_DAI_INDEX_OFFSET * dai_index = (group id << 8) + codec id; */ -#define IPC4_ALH_DAI_INDEX(x) ((((x) & 0xF0) << DAI_NUM_ALH_BI_DIR_LINKS_GROUP) + \ +#define IPC4_ALH_DAI_INDEX(x) ((((x) & 0xF0) << IPC4_DAI_NUM_ALH_BI_DIR_LINKS_GROUP) + \ (((x) & 0xF) - IPC4_ALH_DAI_INDEX_OFFSET)) /* Multi-gateways addressing starts from IPC4_ALH_MULTI_GTW_BASE */ diff --git a/src/include/sof/lib/dai-zephyr.h b/src/include/sof/lib/dai-zephyr.h index d7ef31b4fb21..84b834138eae 100644 --- a/src/include/sof/lib/dai-zephyr.h +++ b/src/include/sof/lib/dai-zephyr.h @@ -16,7 +16,6 @@ #ifndef __SOF_LIB_DAI_ZEPHYR_H__ #define __SOF_LIB_DAI_ZEPHYR_H__ -#include #include #include #include diff --git a/src/platform/ace30/include/platform/lib/dai.h b/src/platform/ace30/include/platform/lib/dai.h deleted file mode 100644 index cce32b808cf7..000000000000 --- a/src/platform/ace30/include/platform/lib/dai.h +++ /dev/null @@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2022-2024 Intel Corporation. - * - * Author: Marcin Maka - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* SSP */ - -/* - * Number of base and extended SSP ports must be defined separately - * since some HW registers are in two groups, one for base and one - * for extended. - */ - -/** \brief Number of 'base' SSP ports available */ -#define DAI_NUM_SSP_BASE 6 - -/* HD/A */ - -/** \brief Number of HD/A Link Outputs */ -#define DAI_NUM_HDA_OUT 9 - -/** \brief Number of HD/A Link Inputs */ -#define DAI_NUM_HDA_IN 11 - -/* ALH */ - -/** \brief Number of ALH bi-directional links */ -#define DAI_NUM_ALH_BI_DIR_LINKS 0 - -/** \brief Number of contiguous ALH bi-dir links */ -#define DAI_NUM_ALH_BI_DIR_LINKS_GROUP 0 - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/platform/imx95/include/platform/lib/dai.h b/src/platform/imx95/include/platform/lib/dai.h deleted file mode 100644 index 4a64614f6092..000000000000 --- a/src/platform/imx95/include/platform/lib/dai.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2024 NXP - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* TODO: remove me whenever possible */ - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/platform/lunarlake/include/platform/lib/dai.h b/src/platform/lunarlake/include/platform/lib/dai.h deleted file mode 100644 index 3d52e0bc20bf..000000000000 --- a/src/platform/lunarlake/include/platform/lib/dai.h +++ /dev/null @@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2023 Intel Corporation. All rights reserved. - * - * Author: Jaroslaw Stelter - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* SSP */ - -/* - * Number of base and extended SSP ports must be defined separately - * since some HW registers are in two groups, one for base and one - * for extended. - */ - -/** \brief Number of 'base' SSP ports available */ -#define DAI_NUM_SSP_BASE 3 - -/* HD/A */ - -/** \brief Number of HD/A Link Outputs */ -#define DAI_NUM_HDA_OUT 9 - -/** \brief Number of HD/A Link Inputs */ -#define DAI_NUM_HDA_IN 11 - -/* ALH */ - -/** \brief Number of ALH bi-directional links */ -#define DAI_NUM_ALH_BI_DIR_LINKS 0 - -/** \brief Number of contiguous ALH bi-dir links */ -#define DAI_NUM_ALH_BI_DIR_LINKS_GROUP 0 - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/platform/meteorlake/include/platform/lib/dai.h b/src/platform/meteorlake/include/platform/lib/dai.h deleted file mode 100644 index a1fc2dfff4e5..000000000000 --- a/src/platform/meteorlake/include/platform/lib/dai.h +++ /dev/null @@ -1,46 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2022 Intel Corporation. All rights reserved. - * - * Author: Marcin Maka - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* SSP */ - -/* - * Number of base and extended SSP ports must be defined separately - * since some HW registers are in two groups, one for base and one - * for extended. - */ - -/** \brief Number of 'base' SSP ports available */ -#define DAI_NUM_SSP_BASE 3 - -/* HD/A */ - -/** \brief Number of HD/A Link Outputs */ -#define DAI_NUM_HDA_OUT 9 - -/** \brief Number of HD/A Link Inputs */ -#define DAI_NUM_HDA_IN 10 - -/* ALH */ - -/** \brief Number of ALH bi-directional links */ -#define DAI_NUM_ALH_BI_DIR_LINKS 16 - -/** \brief Number of contiguous ALH bi-dir links */ -#define DAI_NUM_ALH_BI_DIR_LINKS_GROUP 4 - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */ diff --git a/src/platform/tigerlake/include/platform/lib/dai.h b/src/platform/tigerlake/include/platform/lib/dai.h deleted file mode 100644 index 048c9d56164f..000000000000 --- a/src/platform/tigerlake/include/platform/lib/dai.h +++ /dev/null @@ -1,54 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2018 Intel Corporation. All rights reserved. - * - * Author: Marcin Maka - */ - -#ifdef __SOF_LIB_DAI_H__ - -#ifndef __PLATFORM_LIB_DAI_H__ -#define __PLATFORM_LIB_DAI_H__ - -/* TIGERLAKE */ - -/* SSP */ - -/* - * Number of base and extended SSP ports must be defined separately - * since some HW registers are in two groups, one for base and one - * for extended. - */ - -/** \brief Number of 'base' SSP ports available */ -#define DAI_NUM_SSP_BASE 6 - -/** \brief Number of 'extended' SSP ports available */ -#define DAI_NUM_SSP_EXT 0 - -/** \brief Number of SSP MCLKs available */ -#define DAI_NUM_SSP_MCLK 2 - -/* HD/A */ - -/** \brief Number of HD/A Link Outputs */ -#define DAI_NUM_HDA_OUT 9 - -/** \brief Number of HD/A Link Inputs */ -#define DAI_NUM_HDA_IN 7 - -/* ALH */ - -/** \brief Number of ALH bi-directional links */ -#define DAI_NUM_ALH_BI_DIR_LINKS 16 - -/** \brief Number of contiguous ALH bi-dir links */ -#define DAI_NUM_ALH_BI_DIR_LINKS_GROUP 4 - -#endif /* __PLATFORM_LIB_DAI_H__ */ - -#else - -#error "This file shouldn't be included from outside of sof/lib/dai.h" - -#endif /* __SOF_LIB_DAI_H__ */