Use %zu instead of %d in LOG_DBG for size_t arguments (fill_len,
offset) to fix -Wformat build warnings.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Not all i.MX RT11xx SoCs implement a WDOG4 instance; on those parts
the SRC_SRSR register has no WDOG4_RST_B_M7 flag and the driver fails
to build. Take the flag into account only when the SoC header
defines it.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
The pue_mux register layout check indexed the pinmux array with the
raw pin number, while all other accesses use the gap-compensated
cfg_idx. On a port with gpio-reserved-ranges and a compacted pinmux
map this reads the wrong entry, or past the end of the array.
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
With PULLEN set, the PORT_OUT bit selects the pull direction. The
pull-down path never cleared a previously set OUT bit, so a requested
pull-down could configure a pull-up instead. Clear the latch in the
pull-down case, as the gpio_mchp_port_g1 driver does.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
When CONFIG_SOC_SERIES_NRF71_TFM_RAM_CTRL_SERVICE is set, route
z_nrf_retained_mem_retention_apply() to the secure RAM-control service
(tfm_platform_ram_ctrl_retention_set) instead of nrfx_ram_ctrl; the secure
build keeps the direct nrfx path. Apply regions best-effort and return
-EIO if the secure service rejects one.
Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
- spi_context_lock: move the ISR assert from function entry to guard the
actual blocking call (inside !already_locked), so the legitimate
SPI_LOCK_ON fast path is not falsely caught.
- spi_context.h comment: clarify that calling from ISR is legal when the
lock is already held via SPI_LOCK_ON.
- spi.h: point to the RTIO submit path as the correct way to chain
asynchronous transactions, per @teburd and @npitre.
Suggested-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Tibor Kiss <kiss.tibor@gmail.com>
Added help text for the I3C_CONTROLLER and I3C_TARGET options. While these
are promptless, they are worth explaining and should show up in the Kconfig
reference doc page so that cross-references to them can be resolved.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The TX path was broken if we did not prefill the
TX queue with more than one block. This is because
the TX DMA was queueing a NULL block causing DMA
failures after transfer of the first block.
Added logic to wait for atleast 2 blocks before
starting a transmit.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
The ppb conversion in rtc_sam0_get_calibration() multiplies the
FREQCORR correction value by 1000000000 in a 32-bit expression.
Any correction value of 3 or more overflows int32_t (3e9 >
INT32_MAX), so the reported calibration is garbage for most of
the register range (VALUE goes up to 127).
Do the multiplication in 64 bits, matching the equivalent
conversion in the Microchip G1 RTC driver. The result fits
comfortably in int32_t: with the smallest in-tree cal-constant
(983040), the maximum magnitude is 127 * 1e9 / 983040, about
129186 ppb.
Built tests/drivers/rtc/rtc_api for samc21n_xpro with
CONFIG_RTC_CALIBRATION=y.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Restore the previous interrupt state when DMM RX buffer preparation
fails. Returning with the IRQ lock held could leave interrupts disabled
after uart_rx_buf_rsp() reports the error.
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
Model DMAEND and FRAMETIMEOUT_DMAEND support as a devicetree
capability. Use DMAEND for finite asynchronous RX frame timeouts on
capable UARTE instances and retain STOPRX on unsupported hardware.
Disable TIMER-based byte counting when DMAEND is available. Preserve
buffer accounting when uart_rx_disable() races with an ENDRX rollover,
reject buffer responses during teardown, and restore the interrupt
state after DMM preparation failures.
Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
The default case of the angle_magnitude_axis switch programs
TMAG5273_ANGLE_EN_POS. This value sets bits outside the ANGLE_EN
field and overlaps with the adjacent range configuration bits in
SENSOR_CONFIG_2.
Use TMAG5273_ANGLE_EN_NONE instead to be corrrectly configured.
Signed-off-by: Stefan Prisacariu <stefan.prisacariu@prevas.dk>
The alarm getter open-coded find_lsb_set on the weekday bitmask
without the -1 index correction, returning the weekday off by one.
Use the rv8803_mask2weekday helper like get_time.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The Zephyr SD subsystem expects a 136-bit R2 response in
sdhc_command::response[4] with response[3] holding the most
significant 32 bits and response[0] holding the least significant
32 bits.
intel_emmc_host stored the 32-bit fragments in reverse order, so
resp3 (bits 127:96) was placed in response[0] and resp0 (bits 31:0)
in response[3]. Reverse the assignments.
sam_hsmci read the HSMCI_RSPR FIFO into response[3..0] in the order
the FIFO returns data, but that puts the most significant word in
response[0]. Read the FIFO into response[0..3] instead, matching the
Zephyr layout.
Fixes#112868
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
Add support for selecting HSE/1024 as the STM32WB RF wakeup (low speed)
clock source, as an alternative to LSE, for boards without a 32.768 kHz
LSE crystal.
The source is selected through the existing clock-cell mechanism on the
ble_rf devicetree node (e.g. <&rcc (STM32_SRC_HSE | STM32_CLOCK_DIV(1024))
RFWKP_SEL(3)>), so no new devicetree property and no clock-control driver
change are needed. The ipm_stm32wb driver reads the configured source from
that clock cell and, for HSE/1024, sets the HSE/1024 SHCI low speed clock
bit on top of the CFG_BLE_LS_SOURCE value from app_conf.h. The Cube
app_conf.h is not modified, so no companion hal_stm32 change is required.
Note: switching the RF wakeup clock source is a CPU2 clock change and
requires a power-on reset to take effect.
Signed-off-by: Lubos Koudelka <lubos.koudelka@st.com>
Port haptics API changes to the CS40L26/27 driver, notably
*_calibrate(), *_monitor_get(), *_monitor_set(),
*_select_source(), and *_set_level(). Removes CS40L5x-specific
API functions from the public header that have been replaced
by the haptics API.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
The dual-edge minimum interval check was immediately overridden by
an unconditional check requiring twice the step width, which only
applies to single-edge stepping, so valid dual-edge intervals were
rejected. Restrict the stricter check to single-edge mode.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Update the driver of SCLK (Slow Clock Controller) for compatible with
more MPUs such as sam9x and sama5d2 series.
Signed-off-by: Tony Han <tony.han@microchip.com>
A dedicated config item for SCKC is added so that the drivers for PMC
and SCKC can be built seperately.
Signed-off-by: Tony Han <tony.han@microchip.com>
The receive flag extraction used a compound shift assignment,
writing the right-shifted value back into the volatile MU status
register as a side effect. Use a plain shift into the local.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
uart_stm32_async_rx_disable() forced RXNE on and left the ERROR
interrupt enabled, causing per-byte/per-overrun ISR load on continuous
RX streams.
Keep async and interrupt-driven RX ownership separate: async disables
RXNE on enable and, on disable, only tears down async state and
disables ERROR. RXNE remains off; callers that switch back to
interrupt-driven RX must re-enable it via uart_irq_rx_enable().
This avoids ISR flooding for async users and matches API ownership.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
This adds support for the ARM Corstone System Architecture Specification
Ma2 (ARM CRSAS-MA2) Watchdog Timers.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Co-authored-by: Wojciech Sipak <wsipak@antmicro.com>
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
nPM10 devices' GPIO pins multiplex a lot of different functions. To avoid
application-side misconfiguration, an internal arbitration function was
added.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
Add a display driver for the LeveTop LT7680. This was tested with the
sample `zephyr/samples/subsys/display/lvgl`.
While this display should theoretically support all 4 orientations, I only
managed to get it working with 0 and 180 degrees, so the driver only
supports these for now.
Signed-off-by: Thomas Fischer <thomas.fischer@jumo.net>
Co-authored-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Add a test to only process the TC and TCR interrupts if they are
enabled for the corresponding peripheral (indicated by the TCIE bit in
the CR1 register). This prevents processing twice transfer complete
sequence in case the I2C interrupt is shard between 2 I2C buses.
Update sample counter only when a sample is effectively transferred
when DMA is not used.
This change prevents de-synchronization issues for example when the I2C
bus interrupt is shared when another I2C bus and interrupt can be
triggered while there are no samples no transfer. Note that the change
in TC/TCR interrupt status is synced with the change made in the non-RTIO
driver by commit ffbc63efcb ("drivers: i2c: stm32: fix issue with shared
interrupts") that fixed issue #109993.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Fix an issue seen on STM32C0xx/G0xx/L0xx/U0xx where controller fails
the receive data due to DMA being armed after I2C transfer have started.
Arm DMA and enable the transfer interrupts before generating the
(repeated) START condition. The STM32 I2C controller can buffer only
two received bytes (RXDR plus the shift register) before it stretches
the clock. If the START were issued first, the controller could start
clocking bytes in while the DMA setup (dma_config()/dma_start()) is
still ongoing; on slow parts RXDR would never get drained and the
transfer would stall. Issuing START last guarantees that DMA is ready
to service the very first byte.
Assisted-by: Claude Opus 4.8
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Enable CONFIG_I2C_STM32_V2_DMA by default if at least a compatible
and enabled I2C device node defines 'dmas' DT properties.
Remove the EXPERIMENTAL state of I2C_STM32_V2_DMA config symbol since the
feature is now mature enough to be used.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Allow using DMA only in one direction and don't use DMA on read
messages when destination buffer is not aligned on cache line size
to prevent cache invalidation affects nearby data.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Do not enforce use of DMA in STM32 I2C non-RTIO driver when
CONFIG_I2C_STM32_V2_DMA is enabled. Instead, rely on the devicetree
device node providing or not a DMA configuration.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Convert cached flash addresses to non-cached flash addresses in Realtek
Bee DMA driver. Without this conversion, DMA may access an invalid flash
mapping and read back 0xdeadbeef.
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Add UART asynchronous driver support for Realtek Bee series SoCs,
including RTL87x2G and RTL8752H.
This driver supports:
- Asynchronous TX/RX transfers
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
Use same window settings for both MIPI and DVP mode, helping reducing
the code size of the driver as well.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
In preparation for making DVP frmrate handling common with the existing
MIPI one, rename the structure ov5640_mipi_frmrate_config into
ov5640_frmrate_config as well as associated tables.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Avoid setting the output format as part of init_common_dvp since
this is set via the ov5640_set_fmt function as well.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
HFLIP/VFLIP settings are already done as part of the common init
sequence so avoid changing them specifically in the dvp part as
this is also accessible via dedicated controls.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Perform the sensor ID register check first before doing anything
else after the reset of the sensor.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Use BIT64() for the chain length limit, compare pointers against
NULL and drop a store already covered by the memset().
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Read avail->idx from shared memory once, replace the modulo with a
mask since queue sizes are powers of two, and make the helper void
as it cannot fail.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Carve the free descriptor stack storage out of the virtqueue
allocation instead of relying on a second, hidden k_malloc() in
k_stack_alloc_init(), whose return value was not checked.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>