Skip to content

SoundWire: aggregation fixes#4800

Closed
plbossart wants to merge 12 commits intothesofproject:topic/sof-devfrom
plbossart:pr4790-take2
Closed

SoundWire: aggregation fixes#4800
plbossart wants to merge 12 commits intothesofproject:topic/sof-devfrom
plbossart:pr4790-take2

Conversation

@plbossart
Copy link
Member

This PR extends the initial work done by @bardliao in PR #4790

The only changes are the conventions used:

The gateway node_id is the intel_alh_id for all generations, even if it's completely useless for LNL+ (link_id << 4 + pdi)

The 'device' in the DMA_TLV required for LNL+ is the dai_index (link_id << 8 | pdi)

bardliao and others added 12 commits January 19, 2024 15:26
…re DAIs"

This reverts commit 699e146.
Don't reset device_count as we will use the multi-gateway firmware
configuration.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Each stream needs a dma_config_tlv. We will handle multi dma_config_tlv
in the follow up commits.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
sof_ipc4_dma_config_tlv{} is required for ACE2.x. And the
dma_stream_channel_map.mapping in sof_ipc4_dma_config{} should be
the same as the mapping in sof_ipc4_alh_configuration_blob{}.
The device id is equal to node_id which is 'node_type |  stream_tag - 1',
The purposes of device id is to map DMA tlv.
The patch copies the mapping from sof_ipc4_alh_configuration_blob{}
to sof_ipc4_dma_config_tlv{} to meet the firmware's requirement.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
…for first CPU DAI"

This reverts commit f8ba62a.

The SoundWire aggregated solution was to use one DMA on multiple links.
But, the solution changed to use one DMA for each link. It means that
we should assign HDaudio stream_tag for each cpu_dai.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Set ipc4_copier->data.gtw_cfg.config_length dynamically based on
blob->alh_cfg.device_count to align with the other OS.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
This reverts commit 7f9512a.

commit 7f9512a ("ASoC: SOF: Intel: hda-dai-ops: fix HDaudio link
format") added up all DAIs channels for SoundWire aggregation mode. That
was correct because we used a DMA for all DAIs. But, it is not valid
anymore after we use a DMA for each DAI.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
We always use the lowest N channels of stream. So, set ch_mask to
GENMASK(params_channels(params) - 1, 0).

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Starting with Lunar Lake, the notion of ALH is mostly irrelevant,
since the HDaudio DMAs are used. However the firmware still relies on
an 'ALH gateway' with a 'node_id' based on the same formula.

This patch in isolation has no functional impact, it's only when the
ASoC parts use it that we will see a changed behavior.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
We need to be able to set the dai config differently for SoundWire.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add intel_alh_id to set the expected gateway node_id in a follow-up
patch.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The node_id value needs to be handled specifically for ALH.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The firmware does not really care about the exact values used for the
DMA TLV 'device' field, the only requirement is that each DMA TLV
contains a unique number.

In practice, there's no need to be creative, so this patch uses the
same conventions used by reference firmware and the other OS.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
*/
dma_config = &ipc4_copier->dma_config_tlv[i].dma_config;
dma_config->dma_stream_channel_map.mapping[0].device =
blob->alh_cfg.mapping[i].device;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be invert.
I.e.

-                               dma_config->dma_stream_channel_map.mapping[0].device =
-                                       blob->alh_cfg.mapping[i].device;
+                               blob->alh_cfg.mapping[i].device =
+                                       dma_config->dma_stream_channel_map.mapping[0].device;

@plbossart plbossart closed this Feb 2, 2024
@mengdonglin
Copy link

@plbossart Will you create a new PR to replace this one?

@plbossart
Copy link
Member Author

@plbossart Will you create a new PR to replace this one?

@mengdonglin see #4804

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