-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: Intel: hda-mlink: add support for Extended Multi Links #4158
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
ASoC: SOF: Intel: hda-mlink: add support for Extended Multi Links #4158
Conversation
d3d234d to
442f1f3
Compare
|
2 checkpatch warnings missed, oops. fixed now. |
|
@ujfalusi @RanderWang @ranj063 @bardliao can you please look into this PR? it's rather important and gates the rest of the SoundWire patches. |
ranj063
left a comment
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.
looks great. just minor comments
|
v2: addressed comments, moved interrupt code in hdaml section. |
442f1f3 to
db258a6
Compare
db258a6 to
df257de
Compare
|
v3: modified hardware poll delay to 10us and max 1ms |
These helpers configure the ratio between the base clock and the hardware signal used for link synchronization. The SYNCPRD is written before the first sublink is powered-up. The SYNCPU bit is set, but it will only be cleared after the link is powered-up, hence the implementation with a set/wait pattern. These helpers are currently only needed by SoundWire support, where the lock is taken at a higher level, so only the _unlocked versions are exposed for now. Note that the _wait_bit() implementation is similar to previous helpers in drivers/soundwire, but with sleep duration and timeout aligned with hardware recommendations. If desired, this helper could be modified in a second step with e.g. readl_poll_timeout(). Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The multi-link synchronization uses the same concept and registers, but moved to the HDAudio extended links. Add helpers for sync_arm and sync_go which are the basic for the bus reset, bank switch and clock stop. Since SoundWire is the only user of those helpers, only expose the _unlocked versions for now. Note that SYNCGO is a write-only bit, so no error can be reported. We still return 0 for compatibility with the SoundWire stream management headers. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This helper is an optimization where sync_go is only called when the cmdsync field is actually set to a non-zero value. Since this is also only used by SoundWire for now, only expose the _unlocked version. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Each SoundWire peripheral can be programmed from the manager side either with a regular command FIFO, or with the HDaudio CORB/RIRB DMA-based mechanism. The mapping between SoundWire peripheral and SDI address is handled with the LSDIID register. This mapping only works of course if each peripheral has a unique address across all links. This has already been enforced in previous Intel contributions allowing for an IDA-based solution for the device number allocation. The checks on the dev_num are handled at the SoundWire level, but the locking is handled at the hda-mlink level. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Small helpers to make DAI ops simpler. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
For DMIC and SSP, the DSP will be responsible for programming the blobs and link registers. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
For SoundWire usages, we need to use the global eml_lock to serialize/protect all accesses to shared registers. Due to the split implementation across two subsystems, we need to pass a pointer around. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2c13ad1 to
f423930
Compare
|
v4: fixed nocodec issue (wrong Kconfig). sof-test will still fail on sof-logger test until thesofproject/sof-test#1003 is merged. |
|
The only issue in the tests is the hda-mlink module issue sof-test was updated, will re-run the tests. |
|
SOFCI TEST |
|
I don't understand the CI failures, I tested manually on the very same device that fails https://sof-ci.01.org/linuxpr/PR4158/build3223/devicetest/index.html?model=ADLP_RVP_SDW_IPC4ZPH&testcase=check-kmod-load-unload and it's working fine. Probably some caching issue? |
|
SOFCI_TEST |
|
SOFCI TEST |
RanderWang
left a comment
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.
LGTM
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.
With the update for sof-test merged, all is good.
|
GitHub I hate you, why can't I rebase this branch? "This branch cannot be rebased due to too many changes" What a useless tool. |
|
I'll use a merge commit for now, I don't have time to deal with stupid tools today. |
bardliao
left a comment
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 am late, but it looks good to me.
The LunarLake hardware moved a set of DMIC/SSP/SoundWire registers in the HDaudio multi-link areas. This PR adds a set of helpers to configure the DMIC/SSP/SoundWire. In the case of SoundWire, the configurations will be made both from the sound/soc/sof/intel and drivers/soundwire/intel locations, so the hda-mlink is now a separate module to avoid circular dependencies.
The actual use of these helpers will be provided when this PR #4158 and PR #4157 are merged. There will be cross-dependencies between ALSA, ASoC and SoundWire so we have to progress in steps.
One possible pushback is that this adds yet another layer on top of hdac_link and hdac_ext_link. That's a valid point. The reason why this was added as a separate extension is that we don't have the ability to validate the Skylake and AVS drivers, and there's no reason why these drivers would need to know about a hardware extension added 8 years after the introduction of SKL/KBL.
One could also argue that this extension is not SOF-specific. That's correct from a hardware perspective, however since there are no other users it's not clear where else than sound/soc/sof/intel this module should be located.
@tiwai FYI