-
Notifications
You must be signed in to change notification settings - Fork 7.4k
api: dma: add circular buffer support #15885
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
Add one more bitfield to support buf configuration, thus to support using circular buffer config. And implement circular buffer support for STM32 SoCs. Signed-off-by: Jun Li <[email protected]>
@erwango Please help to review. Thanks! |
@cybertale can you review? |
Hi, in reference maunals of STM32, circular mode is explained as 'reloading address pointer'. As an example from RM0090, it is explained as:
And there are two configuration options in 'struct dma_block_config', which is 'source_reload_en' and 'dest_reload_en', I think these two options can just do the job, right? For STM32 series SOCs, these two options have to be enabled and disabled togather since circular mode in STM32 reload both dest and src address pointers. |
Hmm, it seems a good idea to use the fields |
To be honest I think the purpose of |
@avisconti I agree with aa standalone option for this mode, but I'm worried that if this feature is generic enough for ADC's api. I'm thinking it may be better to have a 'void *args' parameter pointing to a DMA controller related structure to convey these special options in dma_config(). |
So, the client can access any DMA registers through that pointer? Sounds good to developers but the behaviors could be hard to control. |
@jli157 What I'm thinking is that they pass driver specific structure like what the clock control subsystem of stm32 do.
in dma_stm32.h or something like that. And when users use dma clients, they pass a pointer pointing to a instance of this structure. |
So the answer is no, client would not be able to access registers directly or through the pointer, they just pass options. |
The problem from this way is that a client needs to include a header file inside the driver directory which is kind of internal use. Also, some applications expect driver behaviors agnostic to specific hardware; thus its requirement can't be met by this way. |
From my experience, main usage of dma in stm32 is for stm32's internal IP blocks, ADC, DMA, etc. Other devices or apps using stm32's DMA wouldn't need this parameter so they would need to include that header file. For example, i2s driver of stm32 should include this header, while if some app needs only memory copy, they can pass NULL to this. |
@jli157 Is this PR still valid? |
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.
Requires heavy rebase
It has been addressed and solved in the current code base. So, I can close this PR. |
Add one more bitfield to support buf configuration, thus
to support using circular buffer config.
And implement circular buffer support for STM32 SoCs.
The PR will be the one of dependencies for PR #14916
Signed-off-by: Jun Li [email protected]