-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: dma: rpi_pico: add support for RaspberryPi Pico DMA #53892
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
ef700a0 to
1fd9ffc
Compare
bb96b0b to
ad1dfa7
Compare
9bc5bc1 to
af56e30
Compare
yonsch
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.
Thanks, a few comments/questions
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.
Why are these functions/file needed? And why is the extern needed?
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.
It defines rpi_pico_dma specific APIs.
This is not fit in zephyr's common API features.
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.
There is a channel_priority field in struct dma_config which could almost certainly be used for this
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.
Thank you for reviewing, and sorry for my late response.
I recently updated the rpi_pico's HAL module. This includes the DMA priority API.
I updated this PR to call that API with refer to the channel_priority value.
The rpi_pico specific function is no needed.
I removed it.
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.
what is ch_cfg in this case? If we need to expand the dma_config struct to cover this, that seems more sensible that adding rpi specific functions if possible.
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.
Since it is not necessary for basic operation, I deleted it.
For functions that may be able to common (For example, rpi_pico has a function to change the order of 2 bytes and 4 bytes), I will consider to create as a separately PR if necessary.
|
Pico parts LGTM. I still think it's better to extend the DMA API rather than adding a pico specific API, as much as it's possible. But that I'll leave to @teburd to decide |
9a263fb to
5a835fc
Compare
Some pico-sdk drivers call a panic function, originally implemented as part of the Pico's C runtime. This commit adds a Zephyr compatible implementation of panic, so that those drivers could be compiled with Zephyr. Signed-off-by: Yonatan Schachter <[email protected]>
Enable DMA driver. Add the path of the DMA driver header into include paths. `hardware_claim` is depends by DMA driver, also enable it. Signed-off-by: TOKITA Hiroshi <[email protected]>
cc4a437 to
f975dff
Compare
|
|
teburd
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.
Many LOG_DBG's should be LOG_ERR's
The driver, binding, and the rest look ok to me
drivers/dma/dma_rpi_pico.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.
If this is a possible runtime error condition, LOG_ERR.
If this is a programming error __ASSERT()
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 function caller can give the NULL as filter_pattern args.
It is need to handle as the runtime error here.
drivers/dma/dma_rpi_pico.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.
LOG_ERR
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.
Fixed it.
drivers/dma/dma_rpi_pico.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.
LOG_ERR
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.
ditto.
drivers/dma/dma_rpi_pico.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.
LOG_ERR
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.
ditto.
drivers/dma/dma_rpi_pico.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.
LOG_ERR
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.
ditto.
drivers/dma/dma_rpi_pico.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.
All LOG_DBG's here should be LOG_ERR
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.
ditto.
Adding RaspberryPi Pico DMA driver. Signed-off-by: TOKITA Hiroshi <[email protected]>
Add overlay file for rpi_pico target. Signed-off-by: TOKITA Hiroshi <[email protected]>
Add myself as codeowner of previously committed driver. - zephyrproject-rtos#53892 Signed-off-by: TOKITA Hiroshi <[email protected]>
Add myself as codeowner of previously committed driver. - #53892 Signed-off-by: TOKITA Hiroshi <[email protected]>
Add myself as codeowner of previously committed driver. - zephyrproject-rtos#53892 Signed-off-by: TOKITA Hiroshi <[email protected]>
Adding RaspberryPi Pico DMA driver.
Signed-off-by: TOKITA Hiroshi [email protected]
The SPI client PR is #54195.
It pass the
tests/spi/spi_loopbacktest.And work fine
samples/subsys/fs/fat_fssample with my configuration.