-
Notifications
You must be signed in to change notification settings - Fork 8.1k
drivers: spi: siwx91x: Use GPDMA rather than UDMA #97534
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?
drivers: spi: siwx91x: Use GPDMA rather than UDMA #97534
Conversation
Group the DMA nodes in the same place. Signed-off-by: Jérôme Pouiller <[email protected]>
93b9f18
to
1a319f5
Compare
|
||
desc = gspi_siwx91x_fill_data_desc(cfg, channel->dma_descriptors, buffer, buffer_count, | ||
padded_transaction_size, is_tx, dfs); | ||
padded_transaction_size, is_tx, 4); |
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.
Instead, remove the last parameter (dfs) from this function and change the GSPI_DMA_MAX_DESCRIPTOR_TRANSFER_SIZE to 4096
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
|
||
ret = gspi_siwx91x_dma_config(spi_dev, channel, | ||
ARRAY_INDEX(channel->dma_descriptors, desc) + 1, is_tx, dfs); | ||
ARRAY_INDEX(channel->dma_descriptors, desc) + 1, is_tx, 1); |
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.
Hardcoding this to 1 may limit the source_data_size and dest_data_size to 8-bit. Instead pass dfs to the function and hardcode source_burst_length and dest_burst_length to 1 in gspi_siwx91x_dma_config function to enable transfer for 16-bit data size
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
pinctrl-names = "default"; | ||
|
||
dmas = <&dma0 11>, <&dma0 10>; | ||
dmas = <&dma1 0 11>, <&dma1 1 10>; |
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 this too should be replaced with gpdma
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.
Yeah, CI also noticed it.
1a319f5
to
3fad096
Compare
GPDMA hardware block has some requirement regarding the buffers alignments. Note the previous condition was too permissive. It ignored source_burst_length during the check of the transaction size. Signed-off-by: Jérôme Pouiller <[email protected]>
The DMAs expect a 32 bits aligned address as source. Signed-off-by: Jérôme Pouiller <[email protected]>
The siwx91x platform provides two DMA block: UDMA and GPDMA. GPDMA require the dma_slot attribute. Signed-off-by: Jérôme Pouiller <[email protected]>
Since various macros don't end with a colon, the code formatters give bad results. Let's fix that. Signed-off-by: Jérôme Pouiller <[email protected]>
Properly reset the device before the transaction, whatever its previous state. Signed-off-by: Jérôme Pouiller <[email protected]>
Silabs siwx91x offer two DMA hardware block: GPDMA and UDMA. While UDMA has some benefit when running in low power modes, GPDMA offer better performances. So GDMA is probably better suited for SPI device. Ideally, we would like to leave the ability to switch back to UDMA. Unfortunately, UDMA and GPDMA are not configured in the same way: - the maximum length of the block are different (1024 or 2048 for UDMA and 4096 for GPDMA) - the burst length is different So, we only support GPDMA. Signed-off-by: Jérôme Pouiller <[email protected]>
We now support GPDMA with SPI. So update the tests to reflect this changes. Signed-off-by: Jérôme Pouiller <[email protected]>
3fad096
to
d1a09c0
Compare
|
Oops, |
Silabs siwx91x offer two DMA hardware block: GPDMA and UDMA.
While UDMA has some benefit when running in low power modes, GPDMA offer better performances. So GDMA is probably better suited for SPI device.
Ideally, we would like to leave the ability to switch back to UDMA.
Unfortunately, UDMA and GPDMA are not configured in the same way:
So, we only support GPDMA.