Drop the direct MCUX_XBARA HAL coupling in the QDEC driver in
favour of the new generic mux subsystem: the driver now selects
CONFIG_MUX, defines mux states from a "mux-states" devicetree
property and applies them at init time via mux_state_apply(),
which makes it agnostic to the underlying mux hardware.
Update the nxp,mcux-qdec binding to include mux-consumer.yaml,
augment the i.MX RT10xx XBAR nodes with CCM clock phandles plus
the new #mux-control-cells / #mux-state-cells declarations, and
migrate the MIMXRT1050-EVK QDEC overlay to the mux-states syntax.
Add the matching XBAR clock support to the i.MX CCM clock driver
(IMX_CCM_XBAR1_CLK / IMX_CCM_XBAR2_CLK gate/ungate, guarded by
CONFIG_MUX_NXP_XBAR) so the XBAR controllers referenced by those
nodes can be clocked.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Drop the direct INPUTMUX_AttachSignal() coupling in the QDC driver
in favour of the new generic mux subsystem: the driver now selects
CONFIG_MUX, defines mux states from a "mux-states" devicetree
property, and applies them at init time via mux_state_apply().
This makes the driver mux-hardware-agnostic.
Update the nxp,mcux-qdc binding to use mux-consumer.yaml, expose
the inputmux0 node on the MCXNx4x family DTSI, and migrate the
FRDM-MCXN947 / MCXN5xx-EVK QDC overlays to the new mux-states
syntax.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Add a mux controller driver for the NXP MCUX XBAR (Crossbar
Switch) peripheral, supporting both 16-bit and 32-bit SEL register
layouts via DEVICE_MMIO. Update the nxp,mcux-xbar binding to also
declare the mux-controller interface (#mux-control-cells and
documenting the legacy xbar-maps property for as-yet-unmigrated
consumers (e.g. qdec_mcux).
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Add a mux controller driver for the NXP TRGMUX peripheral, used to
multiplex trigger signals between on-chip peripherals. The
controller exposes two address cells (trgmux instance / output id)
and supports register-level lock so that an applied routing can be
frozen for the lifetime of the system.
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Add a mux controller driver for the NXP INPUTMUX peripheral.
Wraps the HAL INPUTMUX_AttachSignal() routine to route a
peripheral input signal onto a destination channel through the
unified mux_state_apply() API.
Co-Authored-By: Declan Snyder <declan.snyder@nxp.com>
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
Introduce a new generic multiplexer (MUX) controller subsystem
modeled on the Linux mux framework. Provides a unified API for
software- and hardware-level signal routers via mux_control_set()
and mux_state_apply(), with userspace syscall handlers and common
devicetree bindings (mux-controller / mux-consumer) for downstream
consumers.
Co-Authored-By: Felix Wang <fei.wang_3@nxp.com>
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add UART driver support for the CH5xx.
This enables the hello_world and the drivers/uart/echo_bot samples.
Signed-off-by: Elie Carrot <elie.carrot@smile.fr>
Add GPIO driver support for the CH5xx series with the required bindings.
This enables the blinky sample to run by default, and the basic/button
sample when a device tree overlay is provided.
Signed-off-by: Elie Carrot <elie.carrot@smile.fr>
Add a pin controller driver for the WCH CH570 SoC.
Implements `pinctrl_configure_pins` to enable GPIO initialization and
alternate function configuration.
Update hal_wch revision in west.yml and hal_ch32fun.h to sync with
changes merged in zephyrproject-rtos/hal_wch#6
Signed-off-by: Elie Carrot <elie.carrot@smile.fr>
Rework the esp32 pcnt driver to expose every counting unit of a
single device. The read-and-decode api threads the unit index
through sensor_chan_spec.chan_idx so sensor_read returns an
encoded buffer that the driver's decoder unpacks per unit. The
legacy sensor_channel_get path is kept on unit 0 for backward
compatibility.
The new sensor_chan_pcnt_esp32_unit(n) helper (in a public
header) packs the unit index into the legacy sensor_channel
field so sensor_attr_set and sensor_trigger_set can target a
specific unit. A new sensor_attr_pcnt_esp32_reset attribute
clears the hardware counter.
Dt binding gains counts-per-revolution (enables degrees output
on sensor_chan_rotation), high-limit and low-limit watchpoints
(counter auto-resets on reach and raises the trigger), and
zero-cross-event. Filter is documented in apb cycles with the
correct 1023 clamp.
Threshold trigger demultiplexes per unit in the isr and fixes
the old behaviour that silently re-allocated the isr on every
trigger_set. Interrupt alloc moves to init.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
regulator_common_init() calls the .get_voltage() API.
So instead of not doing anything in the fake (not updating the voltage)
and therefore having regulator_common_init() continue with a random
value, let's update it to a relatively sensible constant (1V).
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a Process Call command for validating driver functionality and
debugging SMBus devices. The command accepts a command code and write
word data, then read the word data response returned by the target device.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
The driver supports up to nine SMBus controllers and implements the
standard SMBus protocols, except for Block Process Call.
It also supports an optional FIFO mode that uses the controller's
dedicated 32-byte FIFOs to reduce the interval between transferred
bytes and improve clock stretching during SMBus transactions.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
esp32_wifi_connect() sets data->state = ESP32_STA_CONNECTING before
validating the security parameters and before the synchronous calls
into the ESP Wi-Fi library. Every synchronous error return after that
point leaves the state at CONNECTING: the entry gate then rejects all
subsequent connect attempts with -EALREADY, and since no connection
was ever initiated, no Wi-Fi event will arrive to reset the state.
One failed connect (unsupported security mode, enterprise
configuration failure, esp_wifi_set_config() or esp_wifi_connect()
error) permanently wedges the interface until reboot.
Restore ESP32_STA_STARTED on all synchronous error paths so the
driver is ready for the next attempt.
Observed in the field on ESP32-C6: a provisioning request carrying an
SAE security mode on a build without CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE
returned -EINVAL once and the interface could never reconnect again
without a power cycle. Fix carried as a downstream patch on v4.3.1 and
v4.4.1 and validated on hardware there.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Linus Rüttimann <linus@noxblanc.com>
Add support for the Texas Instruments ADS7828 12-bit and ADS7830
8-bit 8-channel I2C ADCs. The two parts share one command byte and
channel permutation and differ only in resolution, so one source file
covers both. ADS7828-Q1 reuses the ADS7828 compatible.
Signed-off-by: JaeHwan Jin <jaehwan.jin@rakwireless.com>
channel holds the last zero-based channel index an LED occupies,
so a value equal to max_channels is already one past the last
valid channel. Reject it, matching the count-based check in
write_channels.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
In the update to hal_rpi_pico,
POWMAN_CHIP_RESET_HAD_WATCHDOG_RESET_PSM macros name were corrected
from POWMAN_CHIP_RESET_HAD_WATCHDOG_RESET_RSM.
Update this driver accordingly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
if() guard in disk CMakeLists file was redundant since the file will
only be included by the parent CMakeLists if CONFIG_DISK_DRIVERS is
already set. Drop it.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@analog.com>
The async completion timeout returned while still holding the
access mutex and the PM runtime reference, wedging the controller
for every subsequent request. Unlock and drop the reference before
returning.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The buffer check ran before active_channels was computed, so it
validated against zero required bytes and always passed, letting
undersized buffers through. Compute the channel count first.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
MIN_DELAY is the floor of the SysTick LOAD register: the closest-in
timeout the driver will program. It must exceed the longest the SysTick
interrupt can stay masked, otherwise the 24-bit counter can wrap more than
once between elapsed() reads and lose a LOAD's worth of cycles. That is a
wall-clock property, but the default was a fixed cycle count:
MAX(1024, CYC_PER_TICK/16)
A fixed cycle count is a different wall-clock time on every clock. On a
32 kHz SysTick the 1024-cycle floor is ~31 ms (31 ticks), so the driver
could never schedule a timeout shorter than 31 ticks and every such board
had to override zephyr,min-timeout-cycles by hand.
Compute it instead as a fixed wall-clock budget scaled to the actual
frequency (min_delay = SYSTICK_MIN_DELAY_US * HW_CYCLES_PER_SEC), resolved
at init and refreshed on a runtime frequency change, so it also works when
the frequency is only known at runtime. At ~10 us this matches the old
1024 cycles near 100 MHz and scales sensibly elsewhere. The tick rate is
not involved; if the budget exceeds a tick on some clock, sub-tick timeouts
are simply unavailable there. A dts override still takes precedence.
Floor the result at two cycles: LOAD is programmed as (cycles - 1) and a
LOAD of zero stops the counter, so the smallest usable reload is two cycles
(LOAD 1). On a slow clock such as a 32 kHz SysTick the 10 us budget rounds
below that, so the hardware floor is what applies and the board still needs
no override.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Convert cmd->response_type from a Zephyr enum sd_rsp_type value to the
Ambiq HAL's MMC_RSP_* bitmask via a new helper
ambiq_sdio_resp_type_to_hal(). The helper returns false on an
unrecognized response type and the caller propagates -EINVAL to fail
fast at the API boundary.
Remove the redundant CMD-index based ui32RespType overrides, keeping
only the bCheckBusyCmd handling for CMD6 and CMD38, which is a real
HAL-specific semantic not covered by the response type enum.
Also change the helper parameter type from enum sd_rsp_type to
uint32_t to match cmd->response_type, and add an explicit (int) cast
in the LOG_ERR format call.
Fixes zephyrproject-rtos#112220
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
The default MCUX_OS_TIMER_MIN_DELAY of 1000 cycles is too large
relative to CYC_PER_TICK (100) on platforms clocked at 1 MHz with
SYS_CLOCK_TICKS_PER_SEC=10000. Because MIN_DELAY exceeds CYC_PER_TICK
by 10x, nearly every sys_clock_set_timeout() call adds an extra tick,
inflating short delays and causing the kernel timer_behavior test
(timer_ramp) to fail for low delay values.
Reduce the default to 50 cycles (50 us at 1 MHz), which provides
sufficient hardware setup margin for the match register without
interfering with normal tick scheduling.
Verified on frdm_mcxa344 and frdm_mcxa156 hardware:
- tests/kernel/timer/timer_behavior: all cases pass
Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
Implements the new per-bus timeout mechanism for the I2C bus that was
introduced in PR #107827.
Assisted-by: Github Copilot:Claude Opus 5
Signed-off-by: John Batch <john.batch@infineon.com>
`select SYSCON` in `OTP_RTS5817` creates a circular Kconfig dependency
loop (`SYSCON -> OTP -> ... -> DCACHE -> SYSCON`) that breaks kconfig.py
in downstream builds.
Change `select SYSCON` to `depends on SYSCON` to break the loop.
Signed-off-by: Al Semjonovs <asemjonovs@google.com>
Align the public UART async API with its microsecond-based implementation.
Update the wide-data (u16 variant) TX and RX API documentation to
specify microseconds and SYS_FOREVER_US.
Replace millisecond-named forever sentinels in the serial test driver and
asynchronous UART callers, while retaining existing microsecond timeout
values in drivers, tests, and samples.
Assisted-by: Copilot:GPT-5.6 Terra
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Add `CONFIG_ST67W611M1_WIFI_AUTO_CONNECT` to control persistent
auto-connect setting `AT+CWAUTOCONN`.
During init the driver reads `AT+CWAUTOCONN?` and only issues
`AT+CWAUTOCONN=<0|1>` when the module's current value differs,
so the module's flash is not rewritten on every boot.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
The init sequence never put the coprocessor into station mode, so on a
freshly flashed module the first AT+CWJAP is rejected with ERROR and
wifi connect always fails.
Issue AT+CWMODE=1,1 during initialization. This matches ST's ST67W6X
SDK, which sets station mode in W61_WiFi_Station_Start(), called early in
W6X_WiFi_Init() (before auto-connect, country code and DTIM setup). The
auto-connect field is left at the firmware default (1) so mode changes
rely on the saved flash configuration.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
Add AES and SHA-256 crypto drivers for Realtek Bee SoCs. The AES
supports 128-bit and 256-bit keys with ECB, CBC, CFB, OFB, and CTR
modes.
The SHA-256 driver supports one-shot hash operations. Add devicetree
bindings and disabled nodes for RTL8752H and RTL87x2G, so boards can
enable the accelerators explicitly.
Signed-off-by: Zhiyuan Tang <zhiyuan_tang@realsil.com.cn>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Zhiyuan Tang <zhiyuan_tang@realsil.com.cn>
This driver needs the nsi_errno conversion component.
Let's make sure we build it by selecting it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This driver needs the nsi_errno conversion component.
Let's make sure we build it by selecting it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This driver needs the nsi_errno conversion component.
Let's make sure we build it by selecting it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This driver needs the nsi_errno conversion component.
Let's make sure we build it by selecting it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
According to Table 6 in the reference manual, the system memory ranging
from 0x1ff00000 to 0x1ff1ffff on STM32H7 SoCs may be accessed only by
the Cortex-M7. Notably, this range includes the 96 bit UID located at
0x1ff1e800. Attempting to access this address from the Cortex-M4 results
in a HardFault.
Simply omit the z_impl_hwinfo_get_device_id function entirely on the
Cortex-M4 and rely on the weak default symbol to return an error.
Signed-off-by: Vilhelm Engström <vilhelm.engstrom@tuta.io>
To avoid assuming that ZVFS_O_RDONLY matches O_RDONLY, compile the
Linux file access code directly with the host libc.
This also removes the need for the nsi_host file operation wrappers and
makes the host-side code easier to read.
Signed-off-by: Bayrem Gharsellaoui <bayrem.gharsellaoui@gmail.com>
Add a native_sim driver to read a Linux host temperature using the
Zephyr sensor API.
Signed-off-by: Bayrem Gharsellaoui <bayrem.gharsellaoui@gmail.com>
The BLE receive thread runs the connect-time settings store
(CCC, keys, GATT database hash), which on Espressif SoCs goes
through the flash driver and PSA crypto and overflows the 1200
byte host default. Raise BT_RX_STACK_SIZE to 2048 when
BT_SETTINGS is enabled.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Use store-and-forward mode instead of cut-through mode to
allow for offloading of checksum calculation to the hardware.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Cores with multiple queues need to have queue 0 setup explicitly,
otherwise no queue will be available for RX/TX. As only a single
queue is used in this driver, setup queue 0 and assign the whole
fifo to it.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>