this flushes the rx buffer before the
start of a new transaction. It is needed
because the litex bios is not always
reading the rx buffer.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
when no rx data need to be read set the rxignore bits.
with this change the dma setup is faster and no unnecessary
dummy writes are done to memory.
Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
when sending multiple bytes only the DMA_STATUS_COMPLETE
status is interesting. otherwise the semaphore will be signaled twice.
Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
- Following similar approach followed on spi_mcux_lpspi driver.
- Enabling DMA by default when SPI RTIO is selected to favor
non-blocking transfers.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Implements the SPIO RTIO API. Refactors internal transcive
fucntios to work with both existing SPI API and RTIO functions.
When SPI_RTIO is enabled the spi_transcieve call translates
the request into an RTIO transaction placed in the queue
that device will execute.
Include the latest refacor changes of RTIO.
Signed-off-by: Dimitrije Lilic <dimitrije.lilic@orioninc.com>
Added a new driver to support SPI communication via EUSART. Since the
Silabs EFR32MG24 family SoCs have only one USART, EUSART support is
necessary for implementing SPI functionality.
Signed-off-by: Teresa Zepeda Ventura <teresa.zvent@gmail.com>
The RxFIFO is already flushed any time a transceive operation
finishes, there is no need for doing it also before the
transaction start.
The aim of this change is to simplify the logic and to
(potentially) reduce the minimum time between transactions.
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
Inform the executor of a submissions completion with -ENOMEM
if the size of the workq is not big enough.
Signed-off-by: Florian Weber <Florian.Weber@live.de>
The Drivers using Pinctrl should be turning Pinctrl on
this should not be the responsibility of the board. This
commit removes CONFIG_PINCTRL from the boards side for nxp boards.
Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
Make clear in the include/ header that data frame size
is the same thing as word size for the context of this API.
Also, add some comments to the spi_context to make it easier
for driver writers to understand how to use the functions,
by noting the meaning of the dfs and len parameters to the update
functions. Otherwise it takes some time to understand what they mean.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The SPI stm32 H7 driver always suspends the SPI transaction
when finishing the transceive operation. This, according to
the stm32 H7 datasheet, must only be done when the SPI master
is configured as receive-only, and the driver always
configures it as full-duplex.
Hence, remove this unnecessary operation for clarify and for
a potential reduction in the minimum time between SPI
transceive operations.
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
Fix the chip select when using the synchronous API with DMA path.
Note need to use TxDataRequest flag instead of ModuleBusy flag now
because module busy flag will not deassert until PCS deasserts.
This does not fix CS for the non-DMA path, because that would require a
large driver rework.
Do not skip configuration when calling transceive with the same spi_cfg
because we need to write a new command word.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The CONFIG_PINCTRL setting is removed from the board
_defconfig files. And "select PINCTRL" is added to
the appropriate driver files.
Signed-off-by: Bill Waters <bill.waters@infineon.com>
This commit removes the y-selection of the `CONFIG_PINCTRL` Kconfig option
in FE310-based boards defconfig files.
It also makes drivers used in FE310 y-select `CONFIG_PINCTRL` if pinmuxing
is needed.
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
For code clarity, this commit adjusts the use of `return` statements
in functions with a void return type as follows:
- Transform `return foo();` into separate statements:
`foo();`
`return;`
- Remove unnecessary `return` statements when
they don't affect control flow.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Extracted common SPI RTIO operations from the spi_mcux_lpspi driver
into spi_rtio, which should be common across RTIO drivers.
Tested with spi_loopback with and without CONFIG_SPI_RTIO. Ran on
mimxrt1010_evk.
Also, verified the other SPI RTIO driver (spi_sam) is not broken by
these changes (tested building for target: robokit1 with the same
conditions as above).
Signed-off-by: Luis Ubieda <luisf@croxel.com>
As a step to make them common code: spi_rtio.c.
Verified this refactorization builds and passes spi_loopback, both with
CONFIG_SPI_RTIO enabled, as well as disabled. Tested on mimxrt1010_evk.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Select PINCTRL subsystem by drivers which require it.
Prevent the need from enabling this symbol at board or soc level.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
After testing the flexio spi_loopback on the ke1xz platform,
it is found that the master transfer and receive are not
synchronized. So add loop code to wait for the master transfer
to complete for frdm_ke17z and frdm_ke17z512 platforms.
Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
Fixes division by zero exception when SPI is configured to operate in mode3
whit CS controlled by software.
Such exception occurred because data->dfs is listed as the denominator in
a division inside the spi_esp32_transfer() function which is called from
spi_esp32_configure() (before assigning a value to data->dfs) inside
transceive() in the condition where mode 3 is chosen as the SPI operating
mode and the chip select is configured to be software-controlled.
Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
Add checks to return value of esp_intr_alloc to avoid drivers init
returning 0 when interrupt allocation fails.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add power management support for Apollo3/Apollo3P SPI, and
automatically enables device runtime power management
Signed-off-by: Zhengwei Wang <zwang@ambiq.com>
Update spi_bitbang_transceive_async function parameter to it match
with correct one that declared in struct
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
Transmit/write buffers are expected to be constant values given to the
operation to transmit but not mutate. Seperate the OP_TX and OP_RX
operation description unions.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
REG_X_BASEADDR will be removed from all hal files.
This forces the use of the peripheral base address
Define MSPI_PORT macro for chip drivers
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>