-
Notifications
You must be signed in to change notification settings - Fork 8k
stm32: introduce dma v3 driver #93945
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
base: main
Are you sure you want to change the base?
stm32: introduce dma v3 driver #93945
Conversation
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.
(first comments from non-exhaustive review)
e9e4541
to
12b871e
Compare
Update, I rebased, reduced the cognitive complexity in the configure function (solved the issue raised by sonarqube) and made some changes following the first comments. |
rx using channel 0 with request 17 for uart5_rx | ||
tx using channel 1 with request 18 for uart5_tx | ||
uart5 { | ||
dmas = <&hpdma3 0 18 (STM32_DMA_PERIPH_TX | STM32_DMA_PRIORITY_HIGH)>, |
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.
typically these sorts of dma cells have solely a node reference and channel identifier, maybe a handshake peripheral number. The choice to add bit field options here for linked list, cyclic, or various other modes of operation is interesting but I think gives the illusion that perhaps changing these fields will actually change the way the DMA is used at a peripheral driver level.
Is that actually the intent here? To allow say, a uart to work in linked list or cyclic mode, with 16, 32 or 64bit data words? That doesn't seem logical to me.
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.
That is in fact how we use it - see for example:
zephyr/drivers/spi/spi_ll_stm32.c
Lines 1539 to 1562 in 5c7e12b
#define SPI_DMA_CHANNEL_INIT(index, dir, dir_cap, src_dev, dest_dev) \ | |
.dma_dev = DEVICE_DT_GET(STM32_DMA_CTLR(index, dir)), \ | |
.channel = DT_INST_DMAS_CELL_BY_NAME(index, dir, channel), \ | |
.dma_cfg = { \ | |
.dma_slot = STM32_DMA_SLOT(index, dir, slot),\ | |
.channel_direction = STM32_DMA_CONFIG_DIRECTION( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)), \ | |
.source_data_size = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)), \ | |
.dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)), \ | |
.source_burst_length = 1, /* SINGLE transfer */ \ | |
.dest_burst_length = 1, /* SINGLE transfer */ \ | |
.channel_priority = STM32_DMA_CONFIG_PRIORITY( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)),\ | |
.dma_callback = dma_callback, \ | |
.block_count = 2, \ | |
}, \ | |
.src_addr_increment = STM32_DMA_CONFIG_##src_dev##_ADDR_INC( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)), \ | |
.dst_addr_increment = STM32_DMA_CONFIG_##dest_dev##_ADDR_INC( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)), \ | |
.fifo_threshold = STM32_DMA_FEATURES_FIFO_THRESHOLD( \ | |
STM32_DMA_FEATURES(index, dir)), \ |
where all the STM32_DMA_CONFIG_xxx
macros come from
zephyr/include/zephyr/drivers/dma/dma_stm32.h
Lines 58 to 86 in 5c7e12b
/* macros for channel-config */ | |
/* enable circular buffer */ | |
#define STM32_DMA_CONFIG_CYCLIC(config) ((config >> 5) & 0x1) | |
/* direction defined on bits 6-7 */ | |
/* 0 -> MEM_TO_MEM, 1 -> MEM_TO_PERIPH, 2 -> PERIPH_TO_MEM */ | |
#define STM32_DMA_CONFIG_DIRECTION(config) ((config >> 6) & 0x3) | |
/* periph increment defined on bit 9 as true/false */ | |
#define STM32_DMA_CONFIG_PERIPHERAL_ADDR_INC(config) ((config >> 9) & 0x1) | |
/* mem increment defined on bit 10 as true/false */ | |
#define STM32_DMA_CONFIG_MEMORY_ADDR_INC(config) ((config >> 10) & 0x1) | |
/* periph data size defined on bits 11-12 */ | |
/* 0 -> 1 byte, 1 -> 2 bytes, 2 -> 4 bytes */ | |
#define STM32_DMA_CONFIG_PERIPHERAL_DATA_SIZE(config) \ | |
(1 << ((config >> 11) & 0x3)) | |
/* memory data size defined on bits 13, 14 */ | |
/* 0 -> 1 byte, 1 -> 2 bytes, 2 -> 4 bytes */ | |
#define STM32_DMA_CONFIG_MEMORY_DATA_SIZE(config) \ | |
(1 << ((config >> 13) & 0x3)) | |
/* priority increment offset defined on bit 15 */ | |
#define STM32_DMA_CONFIG_PERIPHERAL_INC_FIXED(config) ((config >> 15) & 0x1) | |
/* priority defined on bits 16-17 as 0, 1, 2, 3 */ | |
#define STM32_DMA_CONFIG_PRIORITY(config) ((config >> 16) & 0x3) | |
/* macro for features (only for dma-v1) */ | |
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dma_v1) | |
#define STM32_DMA_FEATURES_FIFO_THRESHOLD(features) (features & 0x3) | |
#else | |
#define STM32_DMA_FEATURES_FIFO_THRESHOLD(features) 0 | |
#endif |
These being unpackers of the values encoded by the bindings header:
https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/dt-bindings/dma/stm32_dma.h
(that could use a good cleanup...)
You are raising an interesting point though, in the sense that it is up to the DMA user to actually consume these values (i.e., these only work because drivers do consume the values - they are not automagically injected in the dma_config
). The corollary question is: without this cell, how is one supposed to customize the DMA configuration when it is used by another device driver? Is there a generic method for this that the ST drivers should implement?
Also, at least some of these parameters could be hardcoded in drivers, e.g. the DMA used for UART TX will always be memory->peripheral; I'm going off-topic with this though...
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.
That's my point, the uart driver is going to configure the DMA for how it wishes to use it, having these fields here is confusing and would imply to someone configuring their device that these are options that can be changed for say... how the uart driver may use the DMA, but is that really the case? Can I change say how the st uart driver uses DMA to use the linked list descriptors or cyclic buffer mode? That would, I think, be a very different looking driver.
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.
So what you re asking for is either get the uart driver to actually be able to use Linked Lists, (I don t see the use of having 32bits transfers as the hardware will only transfer 8 anyways), and remove all the unused parameters from the dts binding ?
Then again how would you have a custom configuration for Hardware transfer requests ?
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'm saying don't provide bits in DTS defines that don't make sense from a user configuration perspective, as that's what it is. It's user configurable. If a driver wishes to set word sizing, linked list or cyclic, what the watermark would be, etc etc for a DMA transfer that's entirely up to the driver using the peripheral to do this. Otherwise what I'd expect is that a poor user comes along, sees that ST supports linked list transfers or cyclic transfers with their DMA and any peripheral, only to confusingly either break the peripheral driver or be silently ignored. Either of those outcomes is a poor user experience for someone setting up their devicetree.
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.
That's my point, the uart driver is going to configure the DMA for how it wishes to use it, having these fields here is confusing and would imply to someone configuring their device that these are options that can be changed for say... how the uart driver may use the DMA, but is that really the case? Can I change say how the st uart driver uses DMA to use the linked list descriptors or cyclic buffer mode? That would, I think, be a very different looking driver.
It seems to be the case, actually: DMA configuration cyclic
depends on DT property
zephyr/drivers/serial/uart_stm32.c
Lines 2377 to 2378 in 9135918
.cyclic = STM32_DMA_CONFIG_CYCLIC( \ | |
STM32_DMA_CHANNEL_CONFIG(index, dir)), \ |
and the driver checks whether it's enabled or not during its operation:
zephyr/drivers/serial/uart_stm32.c
Lines 1162 to 1173 in 9135918
/* When cyclic DMA is used, buffer positions are not updated - call callback every time*/ | |
if (data->dma_rx.dma_cfg.cyclic == 0) { | |
/* update the current pos for new data */ | |
data->dma_rx.offset = data->dma_rx.counter; | |
/* send event only for new data */ | |
if (event.data.rx.len > 0) { | |
async_user_callback(data, &event); | |
} | |
} else { | |
async_user_callback(data, &event); | |
} |
Whether all drivers support all use cases is another question but there are at least some drivers that consume some options to affect their behavior.
(+ I don't remember the exact DMA API, but as far as I understand, whether a DMA transfer is done with a "direct" programming or a linked list should be an implementation detail of the DMA driver?)
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.
whether a DMA transfer is done with a "direct" programming or a linked list should be an implementation detail of the DMA driver?
It seems that it is up to the driver to use one of the two, but that is depending on the usage/configuration.
The DMA struct from Zephyr enables the use of chained blocks, so one way is saying if you have more than one block to configure linked lists, one can also juste configure a said channel for a transfer and call the reload
function to do another transfer in direct programming with changing only the addresses, having the same effect with only direct programming.
So I d say the usage of linked lists or direct programmign depends on how the user side uses the DMA API and its structure.
In my case I tried exposing all the ways depending on the available tests. Si linked lists are used with cyclic and scatter gather tests as they need multiple transfers. and it is better to do so fully with DMA rather than call the CPU at each end of transfer.
Either way, some of the symbols I added in the yaml are in fact not consumable so far so I guess I ll just remove them for next batch and add them only when that s the case. :D
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.
@teburd PTAL :p
return 0; | ||
} | ||
|
||
if (!LL_DMA_IsEnabledChannel(dma, channel)) { |
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 channel is enabled or not, stop is allowable. See the DMA state diagram in driver expectations https://docs.zephyrproject.org/latest/hardware/peripherals/dma.html#driver-implementation-expectations
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 way I see this, the "LL_DMA_IsEnabledChannel" is more like a not running state as it is only changed after a dma_stm32_start
call.
So in this regard, it returns a 0 early when trying to stop before a start was called (just after configuration for example as it is done in the loop_transfer test). Removing this early exit will cause the stop function to actually disable the channel, making it fail to start.
d5f6d4e
to
fc2c508
Compare
deae80b
to
0b2086f
Compare
}; | ||
|
||
struct dma_stm32_data { | ||
struct dma_context dma_ctx; |
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.
quite strange to me a structure that integrates a single field?
Any reason to not directly use struct dma_context
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.
Looking around other drivers zephyr/drivers/dma/dma_nxp_sdma.c
, zephyr/drivers/dma/dma_mcux_edma.c
, zephyr/drivers/dma/dma_intel_adsp_hda.h
... they all have a "data" structure with the context, "atomic channel" which i m not sure what is it used for and even the channel pool for LLIs. so i just made it a structure in case.
Also in the zephyr/include/zephyr/drivers/dma.h
line 296:
/**
* DMA context structure
* Note: the dma_context shall be the first member
* of DMA client driver Data, got by dev->data
*/
So yeah I just made it in the data structure. should i remove it and use it directly ?
drivers/dma/dma_stm32_v3.c
Outdated
static inline DMA_Channel_TypeDef *dma_stm32_get_channel_addr(DMA_TypeDef *dma, | ||
uint32_t channel) | ||
{ | ||
return (DMA_Channel_TypeDef *)((uint32_t)dma + LL_DMA_CH_OFFSET_TAB[channel]); |
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.
no check needed on channel
value?
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 check is already done by the calling functions. Should I add a check here to make sure it is a valid channel again ?
I still generally disagree with this idea that you should be configuring how DMA (linked list, cyclic, etc) is used with common DMA bit flags here, and instead provide peripheral attributes for this. But I'm not going to block over this. |
hwdesc.channel_tr2 |= LL_DMA_TCEM_BLK_TRANSFER; | ||
} else { | ||
hwdesc.channel_tr2 |= LL_DMA_TCEM_EACH_LLITEM_TRANSFER; | ||
} |
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.
LL_DMA_TCEM_BLK_TRANSFER
and LL_DMA_TCEM_EACH_LLITEM_TRANSFER
are rather the same in term of transfer status: none of them indicates the end of the whole transfer.
LL_DMA_TCEM_BLK_TRANSFER
triggers TC event each time CxBR1.BNDT=0,
LL_DMA_TCEM_EACH_LLITEM_TRANSFER
triggers TC event each time the next LLI (if any) is loaded after CxBR1.BNDT=0.
|
||
if (ll_direction != LL_DMA_DIRECTION_MEMORY_TO_MEMORY) { | ||
LL_DMA_SetPeriphRequest(dma, channel, config->dma_slot); | ||
} |
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.
CxTR2.SWREQ
have to be set in case of LL_DMA_DIRECTION_MEMORY_TO_MEMORY
.
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 is set by the direction parameter.
the descriptor hwdesc.channel_tr2
holds the ll_direction
which in turn is defined as either:
LL_DMA_DIRECTION_MEMORY_TO_MEMORY
LL_DMA_DIRECTION_PERIPH_TO_MEMORY
LL_DMA_DIRECTION_MEMORY_TO_PERIPH
In the hal file these represent masks to set/clear DMA_CTR2_SWREQ
and DMA_CTR2_DREQ
.
So SWREQ is actually being set for the case LL_DMA_DIRECTION_MEMORY_TO_MEMORY
} | ||
|
||
LL_DMA_EnableIT_HT(dma, channel); | ||
} |
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 blocks have the same length (no CBR1 update) ?
Why do you enable half transfer interrupt ?
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.
So far I presume all blocks have the same size and I only update the source and destination addresses. That's why there is no CBR1 update.
I know I should check for all changes block by block but since I based this on the tests available, this was enough to validate them.
Hello, |
Indeed, at the hardware level, I confirm that the operation of LPDMA, GPDMA, and HPDMA is identical: they use the same registers and bitfields. HPDMA is an extension of GPDMA, which itself extends LPDMA. So a GPDMA driver is compatible with a HPDMA hardware. |
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.
Some minor comments.
drivers/dma/dma_stm32_v3.c
Outdated
static inline DMA_Channel_TypeDef *dma_stm32_get_channel_addr(DMA_TypeDef *dma, | ||
uint32_t channel) | ||
{ | ||
return (DMA_Channel_TypeDef *)((uint32_t)dma + LL_DMA_CH_OFFSET_TAB[channel]); |
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.
Prefer a cast to uintptr_t
instead of uint32_t
?
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.
Done
sys_clear_bits(dma_channel_ccr_reg, DMA_CCR_TCIE | DMA_CCR_HTIE | DMA_CCR_USEIE | | ||
DMA_CCR_ULEIE | DMA_CCR_DTEIE | DMA_CCR_SUSPIE); |
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.
Indentation, remove a tab:
sys_clear_bits(dma_channel_ccr_reg, DMA_CCR_TCIE | DMA_CCR_HTIE | DMA_CCR_USEIE | | |
DMA_CCR_ULEIE | DMA_CCR_DTEIE | DMA_CCR_SUSPIE); | |
sys_clear_bits(dma_channel_ccr_reg, DMA_CCR_TCIE | DMA_CCR_HTIE | DMA_CCR_USEIE | | |
DMA_CCR_ULEIE | DMA_CCR_DTEIE | DMA_CCR_SUSPIE); |
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.
These were run though the clang format :/
sys_set_bits(dma_channel_cfcr_reg, DMA_CFCR_TCF | DMA_CFCR_HTF | DMA_CFCR_DTEF | | ||
DMA_CFCR_ULEF | DMA_CFCR_USEF | DMA_CFCR_TOF | | ||
DMA_CFCR_SUSPF); |
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.
Indentation: remove a tab.
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.
These were run though the 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.
Strange, indentation is weird here :-(
drivers/dma/dma_stm32_v3.c
Outdated
{ | ||
const struct dma_stm32_config *dev_config = dev->config; | ||
struct dma_stm32_channel *channel_config; | ||
uint32_t channel = dma_stm32_id_to_channel(id); |
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.
Check id < Check
id < id >= dev_config->max_channels?
?
Ditto in dma_stm32_stop()
.
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 added checks for the start stop and status functions.
Not the IRQ handler since it is supposed to do the least ops possible (it already runs a bunch of if tests)
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.
Not the IRQ handler since it is supposed to do the least ops possible (it already runs a bunch of if tests)
Agree.
drivers/dma/dma_stm32_v3.c
Outdated
COND_CODE_1(DT_NODE_HAS_PROP(__node, clocks), \ | ||
(.pclken = { .bus = __bus, .enr = __cenr },), \ | ||
(/* Nothing if clocks not present */)) \ | ||
.config_irq = dma_stm32_config_irq_##index, \ |
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.
Indentation
.config_irq = dma_stm32_config_irq_##index, \ | |
.config_irq = dma_stm32_config_irq_##index, \ |
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.
Done
drivers/dma/dma_stm32_v3.c
Outdated
.max_channels = \ | ||
DT_INST_PROP_OR(index, dma_channels, DT_NUM_IRQS(DT_DRV_INST(index))), \ | ||
.channels = dma_stm32_channels_##index, \ | ||
.linked_list_buffer = dma_stm32_linked_list_buffer##index}; \ |
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.
For consistency, prefer:
.linked_list_buffer = dma_stm32_linked_list_buffer##index}; \ | |
.linked_list_buffer = dma_stm32_linked_list_buffer##index, \ | |
}; \ | |
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.
Done
drivers/dma/dma_stm32_v3.c
Outdated
channel = dma_stm32_id_to_channel(id); | ||
LL_DMA_SetLinkedListBaseAddr(dma, channel, base_addr); | ||
|
||
for (int i = 0; i < config->block_count; i++) { |
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.
Prefer use type uint
since block_count is unsigned. Would prefer some compiler to complain on signed/unsigned comparison.
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.
Done
Thanks @avolmat-st for raising this point. I agree that rather than duplicating a driver we'd better work on cleaning/completing the existing one. |
Add compatible yaml file for stm32 dma v3 controllers. This is compatible with the HPDMA and LPDMA controllers in the STM32MP2 series Socs. Signed-off-by: Youssef Zini <[email protected]>
Since the STM32MP2 series supports a new DMA peripheral (HPDMA and LPDMA), this commit introduces a new driver for the STM32 DMA v3. So far, it includes basic functionality for the HPDMA channels, enabling the use of async APIs (tested using uart on the STM32MP257F-EV1 board), as well as support circular dma and loop transfers (reload mode and suspend/resume). The driver is designed to be compatible with the existing Zephyr DMA API, while being inspired heavily by the linux stm32 dma3 driver[1]. The classes and functions used are thought to allow for easy linked list operations in the future, as well as support scatter gather, cyclic transfers and channel linking. [1]: https://github.com/STMicroelectronics/linux/blob/v6.6-stm32mp/drivers/dma/stm32/stm32-dma3.c Signed-off-by: Youssef Zini <[email protected]>
Add support for the new DMA v3 driver in the STM32 series uart async API. Signed-off-by: Youssef Zini <[email protected]>
Add dma v3 symbols to Kconfig.stm32 to enable support when dma v3 is used in the device tree. Also add the new driver reference in the CMakeLists.txt file. Signed-off-by: Youssef Zini <[email protected]>
Add parentheses to macros in drivers and dt-bindings stm32 dma files to avoid potential issues with operator precedence when these macros are used in expressions. Signed-off-by: Youssef Zini <[email protected]>
Add the clock bindings for the stm32mp2 dmas, HPDMA(1-3) and LPDMA1. Signed-off-by: Youssef Zini <[email protected]>
Add a new HPDMA3 node to the STM32MP2 M33 device tree. With the current configuration, the Cortex-M33 can only use the HPDMA3 channels 0 to 13. Signed-off-by: Youssef Zini <[email protected]>
Add dma as a supported driver in the STM32MP257F-EV1 board YAML file. Signed-off-by: Youssef Zini <[email protected]>
Add stm32mp257f_ev1 overlay for uart async API and circular_dma samples using uart5 with HPDMA3 channels 0 and 1 for TX and RX respectively. Signed-off-by: Youssef Zini <[email protected]>
Add stm32mp257f_ev1 overlays and related configuration files for the DMA tests. This includes support for: * chan_blen_transfer * cyclic * loop_transfer * scatter_gather Add stm32mp257f_ev1/stm32mp257fxx/m33 to the platform_allow list. Signed-off-by: Youssef Zini <[email protected]>
Add support for linked list items (LLI) in the STM32 DMA v3 driver. This allows for more flexible DMA configurations, such as scatter-gather and cyclic transfers. This allows to pass both the dma_m2m_cyclic and the dma_m2m_sg tests on the stm32mp257f_ev1 board. Signed-off-by: Youssef Zini <[email protected]>
0b2086f
to
c89e089
Compare
|
Hello there, 🎩
Edit: my wording isn't helping so I wanted to clear out things so no misunderstandings occur.
This PR adds the stm32_dma_v3 driver and support for the HPDMA (using the V3 driver) on the STM32MP257F-EV1 board.
It is inspired from linux version of this driver while maintaining the Zephyr style. (this means that I went through the linux code to understand specifities of the HPDMA, mainly the concept of linked lists that I wasn't familiar with, not that I copied from linux, feel free to compare both logics)
Up to this point, it covers the following tests/samples:
It uses linked lists when needed in a "dynamic" way (it only updates source and destination address).
The idea is to cover all capabilities of the DMA-V3, some features I am thinking about are:
Any ideas to include these features are welcome. I ll be waiting for reviews and counseling. 🎩
Signed-off-by: Youssef Zini [email protected]