Use controller/peripheral and SDO/SDI terminology in the remaining
SPI drivers, following coding guideline rule A.2. These changes are
limited to uses of the renamed core symbols (SPI_OP_MODE_CONTROLLER/
PERIPHERAL, spi_config.peripheral, spi_context_is_peripheral(),
SPI_SDO_OVERRUN_DT), driver-local identifiers (e.g. the silabs
mosi_overrun config members renamed to sdo_overrun), comments and
log messages. The Kconfig.renesas_ra8 hardware chip-select prompt
and help prose are reworded as well.
Vendor HAL/SDK and datasheet register identifiers keep their names,
notably: Ambiq IOSLAVE* base macros, Telink spi_master_* HAL calls,
TI driverlib SSI_MODE_MASTER, GD32 SPI_MASTER register bit, Nuvoton
BSP SPI_MASTER/SPI_SLAVE/QSPI_*/USPI_MASTER/SPI_CTL_SLAVE_Msk,
Microchip MSS_QSPI_CONTROL_MASTER and XEC CHPA_MOSI/CHPA_MISO
register bits, Silabs emlib EUSART/USART init symbols, and the
Zephyr PCIe core PCIE_CONF_CMDSTAT_MASTER bus-master bit referenced
by spi_pw.c (out of scope for this migration).
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Fix SPI clock frequency being modified during DMA transfers.
Fix regression in DMA configuration structure update.
Signed-off-by: Rick Tsao <rick592@andestech.com>
Fix incorrect behavior for non-8-bit SPI word sizes.
Fix the handling when both TX and RX buffers are NULL.
Signed-off-by: Rick Tsao <rick592@andestech.com>
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>
XIP may indicate that the program is executed either in local memory
or flash. However, the SPI node is only used as a flash controller
when the program is executed in flash.
Therefore, optimize the related checks to ensure that when XIP is
enabled but the program is executed in local memory, the SPI node
can still be used.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
1. Due to the hardware limitations of the ATCSPI200 IP, the transmission
and reception counts must be consistent. If there is a mismatch in
length, dummy data needs to be transmitted or received.
Under this limitation, using the spi_context_xx related APIs to
determine whether the transmission is complete may cause issues in
certain situations.
Therefore, additional variables are set to record the exact number of
bytes need to be transmitted or received.
2. Also, fix some inaccuracies in configuring DMA transfers.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
If CONFIG_SPI_STATS is enabled, the device state for all SPI controller
drivers must contain the SPI stats. This space is allocated by calling
Z_SPI_INIT_FN as part of the device definition; this is done automatically
when using SPI_DEVICE_DT_DEFINE instead of DEVICE_DT_DEFINE. If space for
statistics is not properly allocated but CONFIG_SPI_STATS is enabled, an
unexpected write to memory outside of the stats region may occur on a SPI
transfer. This commit uses SPI_DEVICE_DT_DEFINE or
SPI_DEVICE_DT_INST_DEFINE for all in-tree SPI controller drivers.
Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
Previously the logic was inverted for error_callback_en where 0 was
enablement and 1 was disable. This was likely done so that the default,
sensibly so, was to enable the error callback if possible. A variety of
in tree users had confused the enable/disable value.
Change the name of the flag to error_callback_dis where the default
remains 0 (do not disable the callback!) and correct in tree uses of the
flag where it seemed incorrect.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
1. Support the dma mode for andes_atcspi200
and use board adp_xc7k_ae350 for testing.
2. Refine the function mechanism.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
1. Remove the redundant code.
2. Use sys_set_bits and sys_clear_bits instead of customized MACRO.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
This change marks each instance of the 'spi_driver_api' as 'static const'.
The rationale is that 'spi_driver_api' is used for declaring internal
module interfaces and is not intended to be modified at runtime.
By using 'static const', we ensure immutability, leading to usage of only
.rodata and a reduction in the .data area.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>