Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fb1ae68
[nrf fromtree] spi: rtio: patch spi_rtio_copy transceive with empty b…
bjarki-andreasen Feb 3, 2026
402d55a
[nrf fromtree] spi: rtio: make the shared rtio ctx of struct spi_rtio…
bjarki-andreasen Feb 3, 2026
f76596c
[nrf fromtree] spi: rtio: introduce spi_rtio_transceive_cb wrapper
bjarki-andreasen Feb 4, 2026
693abad
[nrf fromtree] spi: rtio: don't support SPI_LOCK_ON
bjarki-andreasen Feb 4, 2026
8289528
[nrf fromtree] drivers: spi: rtio: move private spi/rtio.h to drivers…
bjarki-andreasen Mar 26, 2026
2a5f305
[nrf fromtree] drivers: spi: rtio: introduce nrfx spim rtio
bjarki-andreasen Feb 4, 2026
cf84338
[nrf fromtree] drivers: spi: nrf_spim: refactor to use common code wi…
bjarki-andreasen Feb 23, 2026
3b3597d
[nrf fromtree] tests: drivers: spi_loopback: add nrf54h and nrf54l to…
bjarki-andreasen Feb 23, 2026
8606bdb
[nrf fromtree] tests: drivers: spi_loopback: exclude nrf spim from sa…
bjarki-andreasen Feb 26, 2026
018c3d4
[nrf fromtree] drivers: spi: spi_nrfx_spim_rtio: update spi_rtio.h in…
bjarki-andreasen Apr 16, 2026
1952aab
[nrf fromtree] drivers: spi: spi_nrfx_spim_common.c: patch pinctrl sl…
bjarki-andreasen Apr 16, 2026
e47096a
[nrf fromtree] tests: drivers: spi: controller_periph: lower nrf54l15…
bjarki-andreasen Apr 16, 2026
eaa2c7f
[nrf fromtree] drivers: spi: nrfx_spim_rtio: set CS after configuring…
bjarki-andreasen Apr 16, 2026
3cb8d9a
[nrf fromtree] tests: spi: loopback: update SPIM error regex for nrf …
bjarki-andreasen Apr 16, 2026
9ec4282
[nrf fromtree] drivers: spi: nrfx_spim: move update of buffer to afte…
bjarki-andreasen Apr 16, 2026
c40d932
[nrf fromtree] drivers: spi: context: calculate total rxtx before usi…
bjarki-andreasen Apr 16, 2026
9a1cd0a
[nrf fromtree] drivers: spi: nrfx_spim_common: include gpiote_nrfx.h
bjarki-andreasen Apr 17, 2026
c56bb60
[nrf fromtree] drivers: spi: nrfx_spim: patch flow so bus inits befor…
bjarki-andreasen Apr 17, 2026
ca73e64
[nrf fromtree] drivers: spi: nrfx_spim_common: Limit freq by max_freq…
bjarki-andreasen May 12, 2026
74a2148
[nrf fromtree] tests: drivers: spi: lower nrf54l and nrf7120 SPI freq…
bjarki-andreasen May 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/spi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_FLEXCOMM spi_mcux_flexcomm.c)
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_FLEXIO spi_mcux_flexio.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NPCX_SPIP spi_npcx_spip.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPI spi_nrfx_spi.c spi_nrfx_common.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPIM spi_nrfx_spim.c spi_nrfx_common.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPIM spi_nrfx_spim.c spi_nrfx_spim_common.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPIM_RTIO spi_nrfx_spim_rtio.c spi_nrfx_spim_common.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPIS spi_nrfx_spis.c)
zephyr_library_sources_ifdef(CONFIG_SPI_NUMAKER spi_numaker.c)
zephyr_library_sources_ifdef(CONFIG_SPI_OC_SIMPLE spi_oc_simple.c)
Expand Down
20 changes: 20 additions & 0 deletions drivers/spi/Kconfig.nrfx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,27 @@ config SPI_NRFX_SPI
config SPI_NRFX_SPIM
def_bool y
depends on DT_HAS_NORDIC_NRF_SPIM_ENABLED
depends on !SPI_RTIO
select NRFX_SPIM

config SPI_NRFX_SPIM_RTIO
def_bool y
depends on DT_HAS_NORDIC_NRF_SPIM_ENABLED
depends on SPI_RTIO
select NRFX_SPIM

if SPI_NRFX_SPIM_RTIO

config SPI_NRFX_SPIM_RTIO_SQE_POOL_SIZE
int "Size of SQE pool size for NRFX SPIM RTIO context"
default 8

config SPI_NRFX_SPIM_RTIO_CQE_POOL_SIZE
int "Size of SQE pool size for NRFX SPIM RTIO context"
default 8

endif # SPI_NRFX_SPIM_RTIO

config SPI_NRFX_SPIS
def_bool y
depends on DT_HAS_NORDIC_NRF_SPIS_ENABLED
Expand All @@ -30,6 +49,7 @@ config SPI_NRFX_SPIS

config SPI_NRFX_RAM_BUFFER_SIZE
int "Size of RAM buffers for SPIM peripherals"
default 0 if HAS_NORDIC_DMM
default 8
depends on SPI_NRFX_SPIM
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_ambiq_bleif.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
LOG_MODULE_REGISTER(spi_ambiq_bleif);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_ambiq_spic.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
LOG_MODULE_REGISTER(spi_ambiq);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_b91.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
LOG_MODULE_REGISTER(spi_telink);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include "spi_context.h"
#include <zephyr/drivers/pinctrl.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(spi_bitbang);

#include <zephyr/sys/sys_io.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include "spi_context.h"

struct spi_bitbang_data {
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_cc13xx_cc26xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
LOG_MODULE_REGISTER(spi_cc13xx_cc26xx);

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/pm/device.h>
#include <zephyr/pm/policy.h>
Expand Down
10 changes: 4 additions & 6 deletions drivers/spi/spi_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct spi_context {
const struct spi_buf *current_rx;
size_t rx_count;

size_t max_count;

const uint8_t *tx_buf;
size_t tx_len;
uint8_t *rx_buf;
Expand Down Expand Up @@ -206,13 +208,8 @@ static inline int spi_context_wait_for_completion(struct spi_context *ctx)
if (IS_ENABLED(CONFIG_SPI_SLAVE) && spi_context_is_slave(ctx)) {
timeout = K_FOREVER;
} else {
uint32_t tx_len = spi_context_total_tx_len(ctx);
uint32_t rx_len = spi_context_total_rx_len(ctx);

timeout_ms = MAX(tx_len, rx_len) * 8 * 1000 /
ctx->config->frequency;
timeout_ms = ctx->max_count * 8 * 1000 / ctx->config->frequency;
timeout_ms += CONFIG_SPI_COMPLETION_TIMEOUT_TOLERANCE;

timeout = K_MSEC(timeout_ms);
}
#ifdef CONFIG_MULTITHREADING
Expand Down Expand Up @@ -495,6 +492,7 @@ void spi_context_buffers_setup(struct spi_context *ctx,
&ctx->rx_len, dfs);

ctx->sync_status = 0;
ctx->max_count = MAX(spi_context_total_tx_len(ctx), spi_context_total_rx_len(ctx));

#ifdef CONFIG_SPI_SLAVE
ctx->recv_frames = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LOG_MODULE_REGISTER(spi_dw);
#endif

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/irq.h>

#include "spi_dw.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_emul.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LOG_MODULE_REGISTER(spi_emul_ctlr);
#include <zephyr/device.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/spi_emul.h>

/** Working data for the device */
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_esp32_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(esp32_spi, CONFIG_SPI_LOG_LEVEL);
#include <soc.h>
#include <esp_memory_utils.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
#ifdef SOC_GDMA_SUPPORTED
#include <zephyr/drivers/dma.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_gd32.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/reset.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#ifdef CONFIG_SPI_GD32_DMA
#include <zephyr/drivers/dma.h>
#include <zephyr/drivers/dma/dma_gd32.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_grlib_spimctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define DT_DRV_COMPAT gaisler_spimctrl

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(spi_spimctrl);
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_infineon.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LOG_MODULE_REGISTER(cat1_spi);

#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/kernel.h>

#include <cyhal_scb_common.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_litex_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <zephyr/kernel.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys_clock.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_max32.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/clock_control/adi_max32_clock_control.h>
#include <zephyr/logging/log.h>
#include <zephyr/irq.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mchp_mss.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mchp_mss_qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mchp_sercom_g1.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <soc.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/clock_control/mchp_clock_control.h>
#if CONFIG_SPI_MCHP_DMA_DRIVEN
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mcux_dspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <errno.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/clock_control.h>
#include <fsl_dspi.h>
#include <zephyr/drivers/pinctrl.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mcux_ecspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LOG_MODULE_REGISTER(spi_mcux_ecspi, CONFIG_SPI_LOG_LEVEL);
#include <zephyr/drivers/clock_control.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <fsl_ecspi.h>

#include "spi_context.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mcux_flexcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <errno.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/clock_control.h>
#include <fsl_spi.h>
#include <zephyr/logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_mcux_flexio.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <errno.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/clock_control.h>
#include <fsl_flexio_spi.h>
#include <zephyr/logging/log.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_npcx_spip.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define DT_DRV_COMPAT nuvoton_npcx_spip

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/drivers/clock_control.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/kernel.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi_nrfx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/spi/rtio.h>
#include "spi_rtio.h"
#include <zephyr/pm/device.h>
#include <zephyr/drivers/pinctrl.h>
#include <soc.h>
Expand Down
Loading
Loading