We should not release context until transfer ends. The code previously
would return from wait_for_completion and then release the context. This
is only supposed to be done in the dma callback except for the case of
error in the transceive call. For async transfer this was most likely
always happening wrong and probably broken for multi threads trying to
access the bus due to this premature release of the context.
Also we should not enable CS and leave enabled in case of error, move CS
enable to after the error check.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Stop the transfer with error if at any point there is some
execution reached where transfer is being set up for 0 length, this can
cause problems where for example eDMA set up with this nonsense 0 length
channels can get an infinite error interrupt.
And this is probably an erroneously crafted transfer request anyways.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
If there are HAL definitions available, do these two things:
Ungate the clock for the device from the zephyr driver. Eventually it
would be better to have a clocks property in the LPSPI DT node and get
the resources from there rather than the HAL.
Some platforms require the peripheral to be reset at system level, add
code to do this. Eventually it would be more ideal to have Zephyr
reset drivers for all of the NXP platforms and use DT to describe the
reset resources, but for now we can just do this to get the LPSPI
supported.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add support for an optional "idle disconnect" feature in the TCA954x
I2C multiplexer. When enabled via the `i2c-mux-idle-disconnect` device
tree property, the driver will disconnect all channels after each
transfer. This helps avoid address conflicts when multiple multiplexers
are present on the same I2C bus.
Even if the I2C transfer fails, the driver will still attempt to
disconnect the channels to ensure the bus is left in a consistent state.
If the disconnect operation itself fails, its error code will be returned
unless the transfer already failed with a different error.
This implementation is inspired by the Linux kernel driver for PCA954x
I2C multiplexers. Special thanks to Ofir Shemesh for valuable suggestion.
Signed-off-by: Hank Wang <wanghanchi2000@gmail.com>
Clamp the returned humidity to a non-negative value. This ensure that
the return value is always within the expected range, even if the
calibration parameters are read out incorrectly or corrupted.
This check is applied in the example Bosch driver for the float
conversion case, so there are situations that warrant it.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add indirect CSR access to access CLIC register to satisfy the current
CLIC spec (Version v0.9, 2024-06-28: Draf).
Add CONFIG_LEGACY_CLIC_MEMORYMAP_ACCESS for legacy CLIC implementation
with memory-mapped CLIC register.
Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
Add support for CLIC hardware parameters based on the hardware
implementation.
1. CLIC_PARAMETER_INTCTLBITS
Specifies the number of modifiable bit in interrupt control register.
2. CLIC_PARAMETER_MNLBITS
Specifies the number of bits are assigned to interrupt level in the
interrupt control bits.
Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
Add support for CLIC SMCLICCONFIG extension, allowing user to configure
the number of available interrupt level bits at runtime.
Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
Temporarily disabled PMP stack guard to allow access to CLIC M-mode
register, because U-mode load/store (mstatus.MPRV=0x1,MPP=0x0) is
restricted.
Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
This reverts commit c2f02533a6.
DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT should be enabled for all ACE platforms.
Any new platform in the ACE series will likely need it as well.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
The dev argument is missing.
Introduced in the commit 1cccf28d5e
("drivers: usb: udc: Reduce unnecessary ep config lookups").
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The PCAL6534 driver simply doesn't work. This is
due to an incorrect mapping of commands to pcal6534
registers.
Signed-off-by: Victor Brzeski <vbrzeski@meta.com>
Setting the filter registers in master CAN requires initializing master
CAN first. CONFIG_CAN_MAX_EXT_ID_FILTER banks are reserved for IDE
frames. Previously we set FS1R(CAN filter scale register) at init time,
but it is possible that the master CAN is not initialized at that time.
That is when the filter banks are not set correctly, causing that we get
wrong filter_id from slave CAN. This patch fixes the issue by setting
FS1R at the time of initializing master CAN.
Tested on:
STM32F407IGH6 with 2 std_id and 2 ext_id on each of CAN1 and CAN2.
Signed-off-by: Wenxi Xu <xuwenxi0517@gmail.com>
Replace occurrences of "RaspberryPi" with "Raspberry Pi" in
documentation, comment blocks etc. Correct the name of "PicoW" to
"Pico W", matching Raspberry Pi's documentation at
https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html .
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
The callback function for the DMA is not used in the case where no DMA
properties are given in the esuart node in the device tree. It causes
a warning in the CI build.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
The ov5640 driver already supports QVGA and QQVGA in dvp mode but not
in CSI mode. This PR adds support for these resolutions in CSI mode.
Signed-off-by: Caio Barz Molinari <caioheitor.barzmolinari_1@nxp.com>
Add support for the Wi-Fi version command to retrieve
the Wi-Fi firmware and driver version information.
Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
Instead of a command and event mechanism that relies on processors being
active (UMAC/LMAC) add a new command that reads from the RPU memory
directly for all stats, useful in debugging when processors are
crashed/non-functional.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Implement support for scatter-gather DMA transfers in the siwx917 driver.
This enhancement allows the driver to handle multiple non-contiguous memory
buffers in a single DMA transaction
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
Updated the driver to ensure that each DMA channel can properly
assign and handle individual callbacks.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
This new API allows the assignment of desired DMA channels for
peripheral transfers, enhancing flexibility and control over DMA
operations.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
Refactored the driver code to ensure compatibility with the
dma_context API, improving maintainability and consistency
with other DMA drivers in the Zephyr project.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
1. Corrected the burst length processing to be handled in bytes
for the siwx917 DMA drivers.
2. Removed overlay and configuration files associated with the
chan_blen_transfer test application. The chan_blen_transfer
test application attempted to use 8 and 16 byte bursts, which
are not supported by the siwx91x UDMA.
Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
Looping while waiting for auto-negotiation to complete can block the
system workqueue for several seconds.
Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
Implement `irq_is_pending` in terms of the `irq_rx_ready` and
`irq_tx_ready` function calls.
Using `intstatus` directly results in an implementation that does not
conform to the interrupt driven UART API. Since `intstatus` bits are
only only set when a buffer transitions from full to empty, any calls to
`irq_is_pending` before any bytes have been sent will return 0. This is
problematic since the documented implementation for the API IRQ handler
is:
```
while (uart_irq_update(dev) && uart_irq_is_pending(dev)) {
if (uart_irq_rx_ready(dev)) {
...
}
if (uart_irq_tx_ready(dev)) {
uart_fifo_fill(dev, ...);
}
}
```
If `uart_irq_is_pending` does not return 1 until the first byte is sent,
we never end up pushing data to be transmitted into the `uart_fifo_full`
function.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add defines to avoid magic values in the dtsi.
Replace usb_dc_stm32_get_maximum_speed() with device tree property.
- Use DT_INST_STRING_UPPER_TOKEN(0, maximum_speed) to set the USB speed.
- Remove PCD_SPEED_FULL initialization.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Add defines to avoid magic values in the dtsi.
Replace usb_dc_stm32_get_maximum_speed() with device tree property.
- Use DT_INST_STRING_UPPER_TOKEN(0, maximum_speed) to set the USB speed.
- Remove PCD_SPEED_FULL initialization.
Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
#84065 replaced diagnostic pragmas with TOOLCHAIN_* macros, but we don't
need to use that here since __used is a cleaner way to indicate that the
function is used and will also prevent it from being optimized away at
link time if LTO is enabled.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Add the ability to set the MAC address from the command line when
running a native sim build.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
refactoring enable function into enable and disable increasing readability
and increasing coherence with other stepper apis in terms of
nomenclature
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit adds ambiq iom binding file to consolidate
spi and i2c that share the same IO Master module on
Apollo MCUs
Signed-off-by: Hao Luo <hluo@ambiq.com>