-
Notifications
You must be signed in to change notification settings - Fork 349
dma: switch to native Zephyr API for dw-dma & HDA #5610
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
Conversation
7906394 to
2bd603a
Compare
|
This seems like a nice way to adapt the SOF <-> Zephyr APIs |
src/drivers/dw/dma-zephyr.c
Outdated
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.
this doesn't look right - dma_block_cfg has been incremented block_count times in the loop above. Also, I don't think that parameter is "consumed" by dma_config() so we have to free it in the success case too.
lgirdwood
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.
Needs to be more generic and not per DMA driver.
|
Can one of the admins verify this patch? |
|
@abonislawski any update ? These would be mapped to the native Zephyr API call i.e. all user would be converted to use int dma_stop(const struct device *dev, uint32_t channel)¶ We would need to convert the existing SOF dma calls to the Zephyr APIs as the first part of this work and then add in support for linking with the Zephyr implementation of this API. @juimonen same applies to SSP and other DAI drivers. |
|
@lgirdwood this approach will require to switch all dma or all dai drivers once. With sof api -> zephyr api wrapper we can merge and test each driver separately, it is also possible to use for example one dai driver from sof and one from zephyr. |
I want to avoid having an intermediate stage to develop and validate, I think it's fine to transition in steps with a Kconfig option "Use Zephyr drivers" with default value n. This means that all the local xtos based driver will be used unless this Kconfig is "y".
|
16a8782 to
0dd3035
Compare
abonislawski
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.
@lgirdwood please take a look, added early version but few things still needs to be changed
added host_zephyr.c and dai_zephyr.c, so both HDA and DW-DMA (similar changes)
sof dma lib not divided yet
Please ignore _sof functions, it will be reverted later
src/audio/host_zephyr.c
Outdated
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.
The main issue is dma_config, Im still using old config and translating it to the dma_config at the end, which is obviously wrong but the old config contain some fields which are not available in the new config, like is_scheduling_source, not sure if we can ignore such fields?
src/audio/host_zephyr.c
Outdated
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.
dma_get_attrubite is still missing in new version, Zephyr API does not support this.
Not sure if we can use here defines directly?
One more thing, lets not use |
|
@abonislawski , maybe this could be useful. |
@lgirdwood please check carefully, this is how it works now with native zephyr api in src/audio/dai_zephyr.c and src/audio/host_zephyr.c, I can also rename them to dai.c/host.c and old version to dai-legacy.c/host-legacy.c |
Yes please - we really need to make it obvious what files are Zephyr and what files are legacy. Also please use the |
8b35ad7 to
a7089d0
Compare
|
@lgirdwood updated with new legacy/zephyr suffix, also added CONFIG_ZEPHYR_NATIVE_DRIVERS as you adviced previously so we can enable it later when everything is ready along with dai PR |
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.
This is a good first step toward full native Zephyr. Next things (in subsequent PRs) are
- Reduce other SOF native RTOS APIs in host-zephyr.c and dai-zephyr.c and use the Zephyr versions, i.e for PM, notifiers memory.
- Fix the DAI, DMA init to have const tables of DT name strings and topology IDs so that teh CC does more of the init and not the runtime code.
|
SOFCI TEST |
src/audio/CMakeLists.txt
Outdated
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 think it should be possible to split this patch, making the renaming to *legacy file and function names a separate patch?
|
@lyakh I will fix most of your comments today but please note that this PR is not about dai&host refactor |
f48e9e3 to
a54a272
Compare
This patch will add new versions of host and dai components with Zephyr native DMA support Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Get device binding for DW-DMA & HDA drivers using Zephyr API Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
This patch will add dw-dma wrapper for zephyr driver
Opens: