Skip to content

acp: add TDM DAI and DMA support for ACP 7X#10940

Open
DINESHKUMARK1 wants to merge 5 commits into
thesofproject:mainfrom
DINESHKUMARK1:main
Open

acp: add TDM DAI and DMA support for ACP 7X#10940
DINESHKUMARK1 wants to merge 5 commits into
thesofproject:mainfrom
DINESHKUMARK1:main

Conversation

@DINESHKUMARK1

Copy link
Copy Markdown
Contributor

Add TDM DAI and DMA support for the AMD ACP7x
platform with three instances: TDM0,TDM1,TDM2.

Add SOF_DAI_AMD_TDM to the sof_ipc_dai_type enum, placed before
SOF_DAI_INTEL_UAOL to maintain ABI ordering.

Add format field to sof_ipc_dai_acp_params to carry the sample
format (16/24/32-bit) from topology to the DAI driver.

Add SOF_DMA_CAP_TDM (BIT(16)) and SOF_DMA_DEV_TDM (BIT(16))
capability/device bitmasks for the ACP TDM DMA controller.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sneha Voona <sneha.voona@amd.com>
Route SOF_DAI_AMD_TDM through the DAI and DMA layer:

- dai-zephyr.c: add SOF_DAI_AMD_TDM -> DAI_AMD_TDM / acptdm params
- lib/dai.c: map SOF_DAI_AMD_TDM -> DAI_AMD_TDM in type conversion
  and set SOF_DMA_DEV_TDM/SOF_DMA_CAP_TDM in dai_set_device_params()
- ipc3/dai.c: add SOF_DAI_AMD_TDM to dai_config_dma_channel();
  handle TDM context allocation with struct tdm_context for
  CONFIG_SOC_ACP_7_X, propagating frame_fmt, pin_dir and dma_channel
- zephyr/lib/dma.c: add amd_acp_tdm_dma DMA array entry guarded by
  DT_HAS_COMPAT_STATUS_OKAY(amd_acp_tdm_dma)

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sneha Voona <sneha.voona@amd.com>
Add ACP_TDM_INVALID_32 and ACP_TDM_INVALID_16 sentinel values to
both acp_7_0 and acp_7_x platform_misc.h.  These are used by the
TDM DAI and DMA drivers to mark unallocated channels/indices,
consistent with the existing SDW driver conventions.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sneha Voona <sneha.voona@amd.com>
Enable CONFIG_DMA_AMD_ACP_TDM and CONFIG_DAI_AMD_TDM for the
ACP 7.X ADSP board to activate TDM audio support.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sneha Voona <sneha.voona@amd.com>
Add TDM I2S topology templates for ACP 7.X:
- platform/common/acp-tdm.m4: TDM DAI and pipeline macros
- sof-acp_7_x_i2s.m4: default 16-bit TDM topology
- sof-acp_7_x_i2s_24bit.m4: 24-bit TDM topology
- dai.m4: add SOF_DAI_AMD_TDM token
- tokens.m4: add acptdm format token
- CMakeLists.txt: register new topology targets

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Signed-off-by: Sneha Voona <sneha.voona@amd.com>
@bhiregoudar

Copy link
Copy Markdown

@DINESHKUMARK1: Rebase as #10761 got merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants