Skip to content

Conversation

@kv2019i
Copy link
Contributor

@kv2019i kv2019i commented Dec 9, 2025

Program I2S link for DSP offload, allowing to run DSP tests using the I2S/SSP interface.

The I2S/SSP hardware provides nice loopback capabilities that are useful for testing. On ACE platforms, this capability needs to be enabled on host side, so add the capabiltiy to cavstool.py used to run Zephyr based tests.

Program I2S link for DSP offload, allowing to run DSP tests using
the I2S/SSP interface.

Signed-off-by: Kai Vehmanen <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

@kv2019i kv2019i requested a review from ujfalusi December 11, 2025 08:47
log.info(f"Enabling offload for I2S link")
# needed to allow DSP to access SSP DAI
hda.HDAML_I2S_LCTL |= mask(OFLEN)
log.debug(f"HDAML.I2S_LCTL 0x{hda.HDAML_I2S_LCTL:x}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Unconditionally enable SSP offload? What can go wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ujfalusi This is a bit contentious, but this script/tool is only used to test the DSP and I can't think of cases where we would not enable DSP to program the SSP. Also this matches the behaviour where SSP was accessible by DSP by default. This is really a hw feature to allow use without a DSP at all, and when/if you are using cavstool.py, you are pretty deep on the "let's use DSP" path. :)

But in summarum, I did consider putting this behind a command-line option, but decided not to (as anyone using this on a ACEx.y Intel platform, would want to have the option set).

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

def mask(bit):
if cavs25:
return 0b1 << bit
return 0b1 << bit
Copy link
Contributor

Choose a reason for hiding this comment

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

So this works on ACE as well? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, know. I was very nervous about this change, but I trust our hw engineers. ;)

hda.PPCTL = 0x0804

if adsp_is_ace():
hda.HDAML_I2S_LCTL = 0x0C40 + 0x40 * 3 + 4
Copy link
Contributor

Choose a reason for hiding this comment

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

HDAML_I2S_LCTL is set only in case of ACE (cAVS also have SSP I believe...)
and at line 546 you write to this unconditionally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did test this on cavs2.5! L546 is in funtion load_firmware_ace() which is only run on ACE hw.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, indeed it is in load_firmware_ace(), I just checked the function name up to load_firmware...

log.info(f"Enabling offload for I2S link")
# needed to allow DSP to access SSP DAI
hda.HDAML_I2S_LCTL |= mask(OFLEN)
log.debug(f"HDAML.I2S_LCTL 0x{hda.HDAML_I2S_LCTL:x}")
Copy link
Contributor

Choose a reason for hiding this comment

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

OK

hda.PPCTL = 0x0804

if adsp_is_ace():
hda.HDAML_I2S_LCTL = 0x0C40 + 0x40 * 3 + 4
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, indeed it is in load_firmware_ace(), I just checked the function name up to load_firmware...

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants