-
Notifications
You must be signed in to change notification settings - Fork 8.4k
soc: intel_adsp: tools: cavstool.py: add I2S offload support #100742
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
base: main
Are you sure you want to change the base?
soc: intel_adsp: tools: cavstool.py: add I2S offload support #100742
Conversation
Program I2S link for DSP offload, allowing to run DSP tests using the I2S/SSP interface. Signed-off-by: Kai Vehmanen <[email protected]>
|
| 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}") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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...



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.