Skip to content

Commit a7bdf49

Browse files
committed
ASoC: SOF: Intel: hda: follow strict BDLE address alignment for ACE4
Intel ACE4 based products require host to strictly follow HDA spec guidance on BDLE address alignment. Each BDLE address must be aligned to 128 bytes, and given ALSA periods are directly mapped to BDLEs, period size must be 128 aligned as well. Reported-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 667770d commit a7bdf49

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

sound/soc/sof/intel/hda-pcm.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ EXPORT_SYMBOL_NS(hda_dsp_pcm_pointer, "SND_SOC_SOF_INTEL_HDA_COMMON");
219219
int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
220220
struct snd_pcm_substream *substream)
221221
{
222+
const struct sof_intel_dsp_desc *chip_info = get_chip_info(sdev->pdata);
222223
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
223224
struct snd_pcm_runtime *runtime = substream->runtime;
224225
struct snd_soc_component *scomp = sdev->component;
@@ -268,8 +269,13 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
268269
return -ENODEV;
269270
}
270271

271-
/* minimum as per HDA spec */
272-
snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
272+
if (chip_info->hw_ip_version >= SOF_INTEL_ACE_4_0)
273+
snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
274+
SOF_HDA_BDLE_ADDRESS_ALIGNMENT);
275+
else
276+
/* minimum as per HDA spec */
277+
snd_pcm_hw_constraint_step(substream->runtime, 0,
278+
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
273279

274280
/* avoid circular buffer wrap in middle of period */
275281
snd_pcm_hw_constraint_integer(substream->runtime,

sound/soc/sof/intel/hda.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@
139139
/* SDxFIFOS FIFOS */
140140
#define SOF_HDA_SD_FIFOSIZE_FIFOS_MASK GENMASK(15, 0)
141141

142+
/* HDA BDLE size constraints */
143+
#define SOF_HDA_BDLE_ADDRESS_ALIGNMENT 128
144+
142145
/* CL: Software Position Based FIFO Capability Registers */
143146
#define SOF_DSP_REG_CL_SPBFIFO \
144147
(SOF_HDA_ADSP_LOADER_BASE + 0x20)

0 commit comments

Comments
 (0)