Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove platform lib/dai.h from SOF Zephyr builds #9653

Merged
merged 7 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/audio/base_fw_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <sof/lib/memory.h>

#include <ipc4/base_fw.h>
#include <ipc4/alh.h>
#include <rimage/sof/user/manifest.h>
#include "copier/copier_gain.h"

Expand All @@ -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)
lgirdwood marked this conversation as resolved.
Show resolved Hide resolved
#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)
Expand Down Expand Up @@ -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;
lgirdwood marked this conversation as resolved.
Show resolved Hide resolved
tlv_value_uint32_set(tuple, IPC4_GATEWAY_COUNT_HW_CFG, value);

tuple = tlv_next(tuple);
Expand Down
11 changes: 7 additions & 4 deletions src/audio/chain_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@
#include <ipc/header.h>
#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);

Expand Down Expand Up @@ -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;
Expand Down
11 changes: 10 additions & 1 deletion src/include/ipc4/alh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) + \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, should this be in Zephyr now ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgirdwood I took a look at this, but we don't really have a good schema for ALH instances in DT, and on newer platforms (ace20 onwards), this is really replaced by the HDA link DMA. And to add to that, this bi-dir-link group is really only used to parse the blob, so it's not even strictly tied to hw interface and its use, so in the end did not seem worth the effort.

(((x) & 0xF) - IPC4_ALH_DAI_INDEX_OFFSET))

/* Multi-gateways addressing starts from IPC4_ALH_MULTI_GTW_BASE */
Expand Down
1 change: 0 additions & 1 deletion src/include/sof/lib/dai-zephyr.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#ifndef __SOF_LIB_DAI_ZEPHYR_H__
#define __SOF_LIB_DAI_ZEPHYR_H__

#include <platform/lib/dai.h>
#include <rtos/bit.h>
#include <sof/list.h>
#include <sof/lib/io.h>
Expand Down
46 changes: 0 additions & 46 deletions src/platform/ace30/include/platform/lib/dai.h

This file was deleted.

19 changes: 0 additions & 19 deletions src/platform/imx95/include/platform/lib/dai.h

This file was deleted.

46 changes: 0 additions & 46 deletions src/platform/lunarlake/include/platform/lib/dai.h

This file was deleted.

46 changes: 0 additions & 46 deletions src/platform/meteorlake/include/platform/lib/dai.h

This file was deleted.

54 changes: 0 additions & 54 deletions src/platform/tigerlake/include/platform/lib/dai.h

This file was deleted.

Loading