-
Notifications
You must be signed in to change notification settings - Fork 8.2k
MSPI_DW DMA and Async support #94469
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
MSPI_DW DMA and Async support #94469
Conversation
|
Current known issues/to do list for this PR:
To be done in follow-up PR:
|
ce8a013 to
c095bba
Compare
266a237 to
aa46e61
Compare
3b17e2e to
3c55ba4
Compare
694e6ab to
523f677
Compare
The nrf-qspi-v2 peripheral is similar to EXMIF on nrf54h20 but supports DMA and slave-mode. The wrapper around the SSI IP is also different with DMA features. Signed-off-by: David Jewsbury <[email protected]>
523f677 to
6875795
Compare
Support for new MSPI peripheral where there is no PSEL so pins are setup through CTRLSEL. Signed-off-by: David Jewsbury <[email protected]>
This is a new callback option that drivers can use for when a request or xfer has timed out. E.g if an Async RX request never received anything, this callback can be used so a user can clean up their application. Signed-off-by: David Jewsbury <[email protected]>
enum mspi_op_mode in mspi.h has different syntax to this binding. Aligning these will allow for cleaner code in the implmented drivers. Signed-off-by: David Jewsbury <[email protected]>
6875795 to
6b94a2d
Compare
6b94a2d to
8fcf1ed
Compare
ec2db33 to
01f4523
Compare
Handling of asynchronous transfers uses the system workqueue, hence they are not available when multithreading is disabled. Also add missing dependency on multithreading in the MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE Kconfig option. Signed-off-by: David Jewsbury <[email protected]> Signed-off-by: Andrzej Głąbek <[email protected]>
MSPI slave mode is selected through devicetree using the op-mode property. Mode selected by SSIISMST bit in the CTRLR0 register. EXMIF can only be Master (controller). Signed-off-by: David Jewsbury <[email protected]>
|
@swift-tk could you please take another look? |
| } else { | ||
| /* Sending command or address while configured as target isn't supported */ | ||
| tmod = QSPI_TMOD_RX_ONLY; | ||
| transfer_list->rx_job = &joblist[0]; | ||
| joblist[0] = EVDMA_JOB(packet->data_buf, packet->num_bytes, | ||
| EVDMA_ATTRIBUTE); | ||
| joblist[1] = EVDMA_NULL_JOB(); | ||
| transfer_list->tx_job = &joblist[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.
Why not put this in if (config->op_mode == MSPI_OP_MODE_PERIPHERAL) and handle in a separate path from the one for the controller. Right now it is a bit confusing that the joblist is first filled with the command and address entries and then discarded.
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 code section is common for both Peripheral mode and Controller mode (when not sending addr and cmd). Also MSPI_TX is common for both. Having separate paths for peripheral and controller mode would mean a lot of code duplication in both paths. I could avoid setting the joblist with address and command for peripheral RX but it would require more logic which I think would be less clean?
if (packet->dir == MSPI_RX && (config->op_mode == MSPI_OP_MODE_PERIPHERAL ||
(xfer.cmd_length <= 0 && xfer.addr_length <= 0))) {
preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes) >>
dev_data->bytes_per_frame_exp) - 1;
tmod = QSPI_TMOD_RX_ONLY;
...
}
} else {
if (dev_data->xfer.cmd_length > 0) {
joblist[job_idx++] = EVDMA_JOB(&packet->cmd, 4, EVDMA_ATTRIBUTE);
}
if (dev_data->xfer.addr_length > 0) {
joblist[job_idx++] = EVDMA_JOB(&packet->address, 4, EVDMA_ATTRIBUTE);
}
if (packet->dir == MSPI_TX) {
tmod = QSPI_TMOD_TX_ONLY;
...
} else {
preg->CONFIG.RXTRANSFERLENGTH = ((packet->num_bytes + dev_data->xfer.addr_length +
dev_data->xfer.cmd_length) >>
dev_data->bytes_per_frame_exp) - 1;
tmod = QSPI_TMOD_TX_AND_RX;
...
}
}
01f4523 to
085acb0
Compare
Initial DMA support. DMA supports implementation of SSI IP but using vendor specific DMA in the wrapper. The setup of the DMA is done in mspi_dw_vendor_specific.h. Signed-off-by: David Jewsbury <[email protected]>
085acb0 to
052c3f9
Compare
|
| @@ -55,6 +55,12 @@ config MSPI_TIMING | |||
| Enables mspi_timing_config calls in device drivers for those | |||
| controllers that need this to proper function at high frequencies. | |||
|
|
|||
| config MSPI_DMA | |||
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.
needs to be mentioned in release notes please



PR for the mspi_dw driver to support Async and DMA transactions and support for the new nrf-mspi peripheral (name tbc). This peripheral is similar to the exmif in nRF54H20, using the same core designware IP, but has been configured to support DMA and slave mode. The DMA being used is part of the wrapper and not the core IP.
Concurrent Aync transactions and XiP support for nrf-mspi will be added in a future PR. The DMA support uses the DMA in a vendor specific wrapper.