-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
drivers: dma: Add GD32 DMA driver #47501
Conversation
drivers/dma/dma_gd32.c
Outdated
} | ||
} | ||
|
||
static int gd32_dma_config(const struct device *dev, uint32_t channel, struct dma_config *dma_cfg) |
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.
Let's keep at 80 col
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.
Currently, the clang-format setting is up to 100 columns(3f0e8dd).
Is this no good?
This code is formating with clang-format following instruction https://docs.zephyrproject.org/latest/contribute/guidelines.html#clang-format.
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.
Hi @soburi ,
There was an agreement to allow up to 100 col in code. This doesn't mean that we will follow it.
Zephyr still use Linux kernel coding style and we will keep it for GigaDevices. I point 2 exceptions that are OK to use more than 80 columns.
Please, reformat code to use 80 columns.
235757b
to
1689baa
Compare
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 big step for the tansfer performence. Have a qiuck look, will try to run this on my gd32vf103v board latter.
For gd32f4xx series, only dma1 support m2m, and EDIT: m2m multi-data mode auto applied by hardware. |
d446511
to
6a6c12b
Compare
drivers/dma/dma_gd32.c
Outdated
rcu_periph_clock_enable(cfg->rcu_periph_clock); | ||
|
||
for (uint32_t i = 0; i < cfg->channels; i++) { | ||
gd32_dma_interrupt_disable(cfg->reg, i, DMA_CHXCTL_FTFIE | GD32_DMA_INTERRUPT_ERRORS); |
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.
long lines...
-gd32_dma_interrupt_disable(cfg->reg, i, DMA_CHXCTL_FTFIE | GD32_DMA_INTERRUPT_ERRORS);
+gd32_dma_interrupt_disable(cfg->reg, i,
+ DMA_CHXCTL_FTFIE |
+ GD32_DMA_INTERRUPT_ERRORS);
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.
Completed all fixes.
Sorry for taking up your time, but please review.
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, dma loop_transfer test passed on my gd32f450i_eval and gd32f350r_eval boards.
drivers/dma/dma_gd32.c
Outdated
* Register access functions | ||
*/ | ||
|
||
static inline void gd32_dma_periph_increase_enable(uint32_t reg, dma_channel_enum ch) |
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.
Please, keep at 80col, rework all file.
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.
Rerun clang-format with ColumnLimit: 80
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 the clang format settings aren’t the style guide this is the inevitable issue. Please file an issue or PR against the clang format settings. The docs suggest running it, and the settings define a style that should make code fit the zephyr style and avoid exactly this discussion, if not it’s something that should be fixed.
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.
+1
drivers/dma/dma_gd32.c
Outdated
} | ||
} | ||
|
||
static int gd32_dma_config(const struct device *dev, uint32_t channel, struct dma_config *dma_cfg) |
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.
Hi @soburi ,
There was an agreement to allow up to 100 col in code. This doesn't mean that we will follow it.
Zephyr still use Linux kernel coding style and we will keep it for GigaDevices. I point 2 exceptions that are OK to use more than 80 columns.
Please, reformat code to use 80 columns.
Add support for GD32 DMA Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add DMA support for GD32 series. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Add configuration file for GD32 boards. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
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 like a well written driver, very nice
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.
Hi @soburi ,
Thank you for the patience. You made a very good job!
Add support for GD32 DMA
Signed-off-by: TOKITA Hiroshi tokita.hiroshi@gmail.com
I verified ths PR with tests/drivers/dma/loop_transfer with GD32VF103(longan_nano board).