Commit graph

1,550 commits

Author SHA1 Message Date
Guillaume Gautier
515ce19bf0 drivers: spi: stm32: add dma asynchronous support
Add DMA support for asynchronous SPI transfer for STM32.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-03-13 16:26:11 +01:00
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Fin Maaß
2b929b5431 spi: spi_context: use sys_timepoint* api
use sys_timepoint* api inside
`spi_context_wait_for_completion()`.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-12 12:08:35 -04:00
Minh Tang
9375da6e9c drivers: spi: Support DTC transfer for RX130 SPI
This commit is to add DTC transfer feature for both SPI controller mode
and peripheral mode on board RSK-RX130-512KB

Signed-off-by: Minh Tang <minh.tang.ue@bp.renesas.com>
2026-03-11 17:59:10 +00:00
Minh Tang
87621d54a1 drivers: i2c: support DTC transfer for RX130 I2C
Support DTC transfer for I2C module on rsk_rx130_512kb board

Signed-off-by: Minh Tang <minh.tang.ue@bp.renesas.com>
2026-03-11 17:59:10 +00:00
Pete Johanson
d3dbe45ccb drivers: spi: Fix for SPI register access on MAX32
Add the additional required busy wait needed when accesseng SPI registers
during setup of a new SPI transaction.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-03-10 09:35:21 +01:00
Julien Racki
6164a41ea7 drivers: spi: stm32: add RTIO-DMA support
Add SPI DMA support for RTIO

Signed-off-by: Julien Racki <julien.racki-ext@st.com>
Co-authored-by: Wouter Horré <wouter@versasense.com>
2026-03-05 11:16:48 +00:00
Brett Peterson
c901b174b1 drivers: spi: update for dma
Updating SPI driver to work with recent dma driver changes.

Signed-off-by: Brett Peterson <brett.peterson@infineon.com>
2026-02-26 21:24:20 +00:00
Bjarki Arge Andreasen
f53928fdb5 drivers: spi: nrfx_spim: only spi_context_release if !SPI_LOCK_ON
Update driver to follow this, stated in the documentation of the
spi_context_release: "appropriate time to call this would be at the
end of a transfer that was initiated by a transceive API call, except
in the case that the SPI_LOCK_ON bit was set"

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-02-26 08:44:31 -06:00
Bjarki Arge Andreasen
9c287c64a5 drivers: spi: nrfx_spim: move buffer setup and check earlier
The SPI loopback test suite passes up transfers nop and null buffers
to the device drivers, expecting them to return early with -EINVAL
or -ENOTSUP, before setting the CS pins. Currently the NRFX based
nRF SPIM device driver sets CS unconditionally, without checking
the buffers, resulting in no transfer while toggling CS.

Add a check of the provided buffers in the transceive() function and
return early if buffers are invalid (result in 0 lenght transfer).

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-02-26 08:44:31 -06:00
Pete Johanson
8892875d61 drivers: spi: Add DMA support for RTIO on MAX32 devices
Implement support for using DMA for SPI RTIO transfers.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-25 18:44:29 +01:00
Bill Waters
9ac587cc9f drivers: spi: spi_context.h compiler warning
Avoid this warning associated with the spi_context_cs_* functions
when DT_SPI_CTX_HAS_NO_CS_GPIOS is defined.
warning: statement with no effect [-Wunused-value]

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2026-02-24 16:03:00 -06:00
Michal Smola
f5c65899dc drivers: nxp: Allow usage of clocks without subsystem name
Several NXP drivers require clock control subsystem name definition in
Devicetree. It prevents usage of clock control without subsystem such
as fixed-clock. fixed-clock can be used for early SoC enablement when
complete clock controller is not available or not required.
Allow optional usage of clock control without subsystem by using 0 as
subsystem name if the name is not defined in devicetree. Add the option
for port, i2c, spi and serial drivers.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2026-02-23 16:59:01 +00:00
Sreeram Tatapudi
b9a4fade7c drivers: spi: Infineon: Fix IFX_SCB_ARRAY_SIZE for PSE84
Define IFX_SCB_ARRAY_SIZE for PSoC Edge SoCs to properly
determine the SCB array size.

Without this change, the driver fails to compile on
PSoC Edge platforms

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2026-02-20 07:08:25 +01:00
Sreeram Tatapudi
4a3aaa03ab drivers: spi: Infineon: fix trailing commas in macros
Fix trailing commas in ADVANCED_SPI_FIELDS macro definition
and its usage to ensure clean macro expansion.

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2026-02-20 07:08:25 +01:00
Adam Kondraciuk
38c736295a drivers: spi: spi_nrfx_spi: use standard instantiation
Switched nrfx_spi API to standard instantiation.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2026-02-18 10:31:16 +00:00
Guillaume Gautier
b65e287a36 drivers: spi: stm32: use the new fifo related property
Use the new SPI FIFO related property to retrieve FIFO size (instead of
guessing it from the supported data width), and to check that the
TSIZE register is not written with a value that exceeds the maximal
supported transfer size.

Also reorder the spi_stm32_config structure to have better packing.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-02-17 15:22:28 +00:00
Guillaume Gautier
3261e9c946 drivers: spi: stm32: fix full duplex asynchronous transfer
For an asynchronous transfer, the driver was waiting until transfer was
ended to leave the transceive function, which defeated the purpose of
async. Restore previous behavior. The transfer is still blocking for
half duplex though.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-02-17 15:22:28 +00:00
Guillaume Gautier
feb2315565 drivers: spi: stm32: add fifo threshold support for h7-compatible
This commit adds the support of the FIFO threshold for H7-compatible SPI.
This makes full use of the two FIFOs (Tx and Rx) available for these
devices, by packing the frames together in a single read or write when
possible, reducing the number of operations.

The FIFO threshold is supported only when fifo-enabled property is enabled
in device tree.

This new implementation is useful in interrupt mode at fast speed:
on Nucleo H753ZI, test_spi_complete_multiple_timed at fast speed indicates
a theoretical minimum duration of 27 µs, with a latency measurement of
18 µs for the new code against 34 µs previously, and a huge 76 µs when
fifo-enable is not present.

There are no noticeable changes at slow speed, or in polling or DMA mode.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-02-17 15:22:28 +00:00
Guillaume Gautier
2056ec87b9 drivers: spi: stm32: make fifo-enable compatible with dma transfer
Until now, SPI DMA transfers were not possible for H7-compatible STM32
devices if the fifo-enable property was enabled.
This commit adds the support of this property with DMA usage.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-02-17 15:22:28 +00:00
PyoJin Yoon
9e41fe144d drivers: spi: stm32: keep SPE enabled for Slave Half-Duplex TX
In Slave Half-Duplex TX mode, the driver disables SPE immediately
after loading data into DR, before the Master provides clock.
Since the Slave depends on the Master for clock, data is never
actually shifted out.

Fix by treating Slave Half-Duplex TX like SPI_HOLD_ON_CS: keep SPE
enabled after spi_write() returns, and let the application call
spi_release() once the Master has clocked out the data.

Tested on NUCLEO-F439ZI with SPI1 (master) and SPI3 (slave) in
half-duplex configuration.

Signed-off-by: PyoJin Yoon <volphin310@gmail.com>
2026-02-17 12:18:23 +01:00
Dharun krithik k
a6c70e9110 drivers: spi: infineon: add PSoC 4 support
Add support for the Infineon PSoC 4 family to the SPI driver,
Kconfig options, and polling-based transfer completion for slave
mode as PSoC 4 slave hardware does not control transaction start.

Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-02-16 00:13:04 +00:00
Dharun krithik k
433c10db04 drivers: spi: infineon: implement SCB block number lookup
Implement ifx_get_hw_block_num to retrieve the hardware block number
for a given SCB base address. This replaces the dependency on the
UART-specific lookup function ifx_cat1_uart_get_hw_block_num, making
the SPI driver more self-contained and ensuring correct resource
identification for SCB blocks.

Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-02-16 00:13:04 +00:00
Dharun krithik k
db0d22166b drivers: spi: infineon: cleanup and rename
Rename Kconfig options and internal macros to remove "CAT1" specificity,
making the driver more generic for the Infineon family. This is a
non-functional change to prepare for PSoC 4 support.

Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-02-16 00:13:04 +00:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Henrik Brix Andersen
1e3483d262 drivers: spi: stm32: replace ll_func_* by ll_*
Replace remaining ll_func_* by ll_* for LL function redefinitions in the
STM32 SPI driver.

Fixes: 938fe74aae

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2026-02-12 23:21:06 +01:00
Guillaume Gautier
938fe74aae drivers: spi: stm32: replace ll_func_* by ll_*
Replace ll_func_* by ll_* for LL function redefinitions in the STM32
SPI driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-02-12 20:04:25 +01:00
Harpreet Saini
67b1a12827 drivers: spi: fix halfduplex for stm32
Fix Infinite Loop Hang in Half-Duplex Master RX Mode

signed-off-by: Harpreet Saini <sainiharpreet29@yahoo.com>
2026-02-11 17:51:35 -06:00
Lin Yu-Cheng
8b2ea2e32b drivers: spi: use frequency to calculate the waiting time
Use the frequency and the data length to
adjust the waiting time of every transmission.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2026-02-11 17:49:07 -06:00
Scott Worley
448dda458b drivers: spi: microchip: mec: Common QMSPI-LDMA driver
We converted the QMSPI-LDMA driver to linux style with a local
register header in the driver folder. This is part of the long
term plan to remove the MEC5 HAL and have common drivers for
as many SoC's as possible. QMSPI register definitions are in
the SoC layer to be shared with other drivers (MSPI). The driver
was also updated based on changes in the SPI config structure.
The lastest SPI config structure changes force hardware controlled
chip selects and GPIO controlled chip selects to be mutually exclusive.
NOTE: driver works with the flash driver sample
and passes the common flash driver test.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2026-02-06 13:46:14 -06:00
Sven Ginka
249b13c8cd drivers: spi: add support for soc sy1xx
Before that commit spi was not available for the soc sy1xx.
With this commit a basic usage of spi is possible.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
Co-authored-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-06 13:43:45 -06:00
Sai Santhosh Malae
505251140d drivers: spi: siwx91x: hold GSPI FIFO reset for one bus clock cycle
The Siwx91x GSPI controller requires the FIFO reset bits to be
held high for a minimum of one GSPI bus clock cycle.
Currently, the driver asserts and deasserts the reset back-to-back,
which may result in an insufficient reset pulse width at higher
frequencies.
Add a small, frequency-based delay after asserting the FIFO reset
bits to guarantee the minimum reset duration, ensuring reliable
FIFO reset behavior.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2026-02-04 15:28:49 -06:00
Sai Santhosh Malae
84a5255ac8 drivers: spi: siwx91x: Fix DMA callback handling
Update the GSPI DMA configuration to conditionally register the DMA
callback based on transfer direction and RX buffer presence. The
callback is enabled for TX-only transfers when the RX buffer is NULL
and for RX transfers when a valid RX buffer is provided.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2026-02-04 15:28:49 -06:00
Dat Nguyen Duy
597933388d drivers: nxp_lpspi: add driver support for GIC-based platforms
On Cortex-M with NVIC, if a peripheral sets its interrupt
flag again while the current handler is executing, the NVIC
pending bit is set. Even after the current handler clears
the flags, the pending bit still remain set. The current
implementation manually clears the pending bit to avoid
unneccesary extra handler calls when no additional
processing is required.

On other Arm GIC-based platforms like Cortex-R52, the GIC
automatically clears the pending bit when the peripheral
flag is cleared since these interrupts are level-sensitive.
Therefore, manually clearing the pending bit is unneccesary.

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2026-02-04 15:28:13 -06:00
Dat Nguyen Duy
afda1e8de4 drivers: spi_nxp_lpspi: introduce Kconfig option for ERR050456
ERR050456 affects only S32K344, not all S32 platform

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2026-02-04 15:28:13 -06:00
Rob Newberry
0d28bc1fb2 drivers: spi: stm32: allow for using soft NSS in peripheral mode
The current stm32 drivers will only enable soft NSS support if
the device is using a Zephyr managed GPIO for CS, or if the
CONFIG_SPI_STM32_USE_HW_SS flag is set.  Neither of these are
actually appropriate for a peripheral, which doesn't control CS.

With this change, it is possible for the SPI interface to be
configured as a peripheral but still use soft NSS -- otherwise,
short of creating a "fake" GPIO configuration, the peripheral
will always use hard NSS, and for some boards/configurations,
that is unworkable.  In the case of a board where the CS
is not hooked up, we can use soft NSS to allow the peripheral
to assume CS and be driven by the SPI clock signal alone.

Our board has only three signals (clock, COPI, POCI) enabled
on one of the SPI interfaces (it is communicating with another
MCU on the same board), and works with this change.  Without
the change, we must enable a "fake" GPIO driver configuration
(which is never used for anything, and really makes little
sense for a peripheral, but it just happens to force the
driver to go down that code path).  We cannot disable the
CONFIG_SPI_STM32_USE_HW_SS mechanism, as that impacts ALL
interfaces, and we have a second interface in controller
mode that speaks to flash and requires the NSS_HARD codepath.

Signed-off-by: Rob Newberry <rob@zenomoto.com>
2026-02-04 15:27:17 -06:00
Zacck Osiemo
41a6f3ebce drivers: mfd: Add base support for NXP SC18IS606
Add support for base sc18is606  device and move dependencies to
mfd header rather than the SPI device.

Signed-off-by: Zacck Osiemo <coderv63@gmail.com>
2026-02-03 14:22:34 -06:00
Fin Maaß
a06e4b271f spi: litex: litespi: move spi_context_update_tx
With writing to `master_rxtx_addr` the transfer starts
and with that the interrupt for rx can also come at any time after it.
If that interrupt happens during
spi_context_update_tx, it can lead to some undefined behavior.
In my case I got a `Load access fault` due to some later code,
then wanting to read a write only area. Probably
`tx_count` in `struct spi_context` being decremented one to many,
so it would be the max value of size_t.

Also we don't want to do `spi_context_update_tx`
before `spi_context_wait_for_completion()`. As
it contains `spi_context_total_tx_len()` and that
needs the not incremented `current_tx`.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-03 13:08:46 +01:00
Pisit Sawangvonganan
08d4cf1c1f drivers: spi: place API into iterable section
Add the `DEVICE_API` wrapper to the remaining `spi_driver_api` instances,
ensuring that each driver API is placed in its respective linker section.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-02-03 09:36:43 +01:00
Hoang Nguyen
52859845c8 drivers: spi: renesas: Initialize p_reg in extended configuration
Initialize p_reg with the register base address from devicetree.

Signed-off-by: Hoang Nguyen <hoang.nguyen.jx@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2026-02-03 09:29:36 +01:00
Fin Maaß
9934d7e82d drivers: spi: litex: litespi: make the rxtx size a define
make the rxtx size a define, as this driver
does not support any other value and it's
also not configureable in litex.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-02 12:56:11 +01:00
Qingsong Gou
afef16e841 drivers: spi: add spi driver support for sf32lb
Add spi driver for sf32lb platform

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2026-01-30 05:55:24 -06:00
Fin Maaß
1501ce3719 spi: litespi: correct max word size to 8
this driver wasn't really supporting
other word sizes than 8, so remove it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-30 11:06:38 +01:00
Guillaume Gautier
6809092944 drivers: spi: stm32: use dfs for data frame size
Harmonize the variable names frame_size, bytes_per_frame or word_size_bytes
by replacing them all with dfs, which is already used in the Zephyr SPI
driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
c85e063607 drivers: spi: stm32: replace register read by ll function
Replace the direct read from the registers by dedicated LL functions
since that they are now available.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
5308d39b75 drivers: spi: stm32: factorize dma requests
Define a single function to enable the DMA requests instead of duplicating
the same lines several times.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
d9dcb50bf4 drivers: spi: stm32: remove some unnecessary line breaks
This commit removes some line breaks from function definitions that were
not needed since it can fit on one line.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
f13931f150 drivers: spi: stm32: fix and simplify isr
In case of error from the spi_stm32_shift_frames, spi_stm32_complete
could be called twice if one of the condition with the transfer directiion
were true. To prevent this, add a return after the call to
spi_stm32_complete.

Simplify the if/else block with a single if since spi_stm32_complete is
called in every case.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
9164899d1b drivers: spi: stm32: use already existing function to shift frames
The functions spi_stm32_send_next_frame and spi_stm32_read_next_frame
already exist to send and receive next frame. Use them in slave mode
instead of doing it manually.
Additional checks with spi_context_tx_buf_on and spi_context_rx_buf_on are
done inside these functions but they are already done beforehand in slave
mode.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00
Guillaume Gautier
7eebaa0e0c drivers: spi: stm32: rename variable for consistency
Rename spi_dma_data variable to data for consistency with the rest of the
file.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-01-30 11:06:19 +01:00