Some modems output a message after a CMUX session disconnects and it is
ready to accept commands again on the non-multiplexed interface (nRF93M1
for example outputs `RDY`). Update the `INIT_POWER_OFF` handling to
support early exit from this state if a `MODEM_READY` event is received.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Notify all CMUX users that the interface has closed immediately upon
receiving the `CMUX_DISCONNECTED` event, instead of at some arbitrarily
later time point (`reset_pulse_duration_ms` later).
Signed-off-by: Jordan Yates <jordan@embeint.com>
ifx_tcpwm_counter_set_top_value() previously updated only the software
cache (data->value) and never reset the hardware counter register.
After counter_set_top_value() reduced the period (PERIOD register), the
TCPWM CNT register kept its old value. If that value was greater than
the new period, the counter had to wrap the full 16-bit (or 32-bit)
range before terminal count, instead of one new period's worth of
ticks.
This caused tests/drivers/counter/counter_basic_api
test_set_top_value_with_alarm to fail on Infineon TCPWM-based boards:
the test computes its timeout assuming the alarm fires within a few
new periods, but the first turnaround took several seconds (e.g. ~6 s
on a 16-bit counter clocked at 10 kHz).
Reset the hardware counter to 0 after writing the new period. When
COUNTER_TOP_CFG_DONT_RESET is set, return -ETIME if the current value
is already past the new ticks (matching the counter API contract);
also reset to 0 in that case when COUNTER_TOP_CFG_RESET_WHEN_LATE is
set.
Verified on kit_pse84_eval (m33+m55), kit_pse84_ai (m33+m55) and
cyw920829m2evk_02: all counter_basic_api subtests pass.
Assisted-by: GitHub Copilot (Claude)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
Switch from a binary semaphore to a mutex with priority inheritance.
Write in chunks (~128 B) so ISRs can run between chunks. Add per-operation
retry logic (up to 3 attempts) to handle transient voltage drops. Add cache
invalidation after write/erase on SoCs with D-cache. Extend HAL dispatch
to cover Apollo2x/3x (am_hal_flash), Apollo4x, and Apollo5x (MRAM).
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
uart drivers, that init in POST_KERNEL and
not in PRE_KERNEL_1 can't support
CONFIG_EARLY_CONSOLE, add a Kconfig for it.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add support Microchip MEC/XEC mailbox which is an eSPI peripheral
channel device. We modified the eSPI driver header file as follows:
a. Add a mailbox peripheral to the enum for eSPI peripherals.
b. Add custom Host command opcodes to get/set mailbox data using
ACPI EC for host commands.
c. Add ACPI and private event types for Host sending data, command,
or clearing data written to the Host by the EC (OBE).
d. Add a Microchip XEC vendor specific eSPI header with side-band
API's to access the mailbox.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
The lptimer unlike every other free running counter and compare has
cascaded 16bit counters and. The cascade happens on a match rather
than on a roll over. This means we cannot simply let the counter0/counter1
cacscade into a 32bit counter with a 32 bit match (compare). Instead use
counter2 as the definitive value on cycle counts and counter0/counter1
as a relative delay.
This costs some time to reset, program the match, and re-enable the
counters but does provide correct behavior. At most we can get a
tick rate of 1/4 the low frequency clock rate with correct behavior.
Simplifies the driver a great deal and adds lots of hopefully helpful
commentary to help the next person understand the design well enough.
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
The offload .get hook only populates offload_context when the
ESP-AT interface is the default one at net_context_get() time.
When ESP-AT is a secondary interface, a context can be routed or
bound to it afterwards and reach the offload send, recv, bind and
connect ops with a NULL offload_context, leading to a NULL
dereference.
Allocate the backing socket lazily on first use through a helper
so the driver works regardless of interface ordering, and guard
the put op against a context that never reached the offload layer.
The helper rejects non-IPv4 contexts before claiming a pool slot,
and only claims contexts whose interface is the ESP-AT one so a
context routed to another interface, such as DNS resolved over a
native Ethernet iface, is left for that interface to service.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add selects for GPIO, FLASH, and REGULATOR to the Kconfig
files for the CS40L26/27 and CS40L5x drivers.
Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
virtq_create() received a pointer to a struct virtq allocated by the
callers via k_malloc(). k_malloc() does not zero memory, so fields such
as lock could contain garbage. When CONFIG_SPIN_VALIDATE is enabled,
taking the spinlock then triggers an assertion because lock.thread_cpu
is non-zero.
Zero the whole struct at the start of virtq_create() so that all fields
are initialized before the descriptor table is set up.
Fixes#112349
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
Introduce STM32_LPTIM_* abstraction defines in the LPTIM timer driver to
map HAL1 and HAL2 polarity and preload symbols.
Use the abstraction in polarity and update mode setup so the same code
path works across HAL generations.
Assisted-by: GitHub Copilot:GPT-5.3-Codex
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Switch the STM32 LPTIM timer driver from SoC-series checks to a
Devicetree compatible check for U5-style LPTIM instances.
Update STM32 dtsi files to advertise "st,stm32u5-lptim" alongside
the legacy compatible so the new detection path is used consistently.
Assisted-by: GitHub Copilot:GPT-5.3-Codex
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Rename LPTIM LL clear-flag API calls from ClearFLAG_* to ClearFlag_*
in the STM32 LPTIM timer driver.
Add STM32MP1 compatibility aliases so platforms that still expose the
legacy ClearFLAG names keep building and running.
Assisted-by: GitHub Copilot:GPT-5.3-Codex
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The FIFO error flag is triggered either by wrong configuration
or by overrun/underrun condition. The configuration is handled
by stm32_dma_check_fifo_mburst function. For overrun/underrun
condition, there is no data loss, so it is rather warning
and can be ignored.
Signed-off-by: Adam BERLINGER <adam.berlinger@st.com>
There is an upcoming MDK change to remove MSPI_TMOD_TMOD_TXANDRX
due to it being redundant. The wrapper TMOD register only needs
to be set in peripheral mode.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
Add the ESP32-P4 USB-OTG high-speed controller using the
espressif,esp32-usb-otg-hs binding and the internal UTMI PHY. The
high-speed PHY uses dedicated pins, so no pad configuration is
needed. Enable the controller on the function ev board.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Introduce a shared Espressif USB-OTG binding scheme and rename the
existing full-speed quirk to the speed specific
espressif,esp32-usb-otg-fs compatible. The internal PHY D+/D- pad
numbers now come from the phy-dp-pin and phy-dm-pin device tree
properties, so migrate the esp32s3 node accordingly.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Accept MSPI_TIMING_PARAM_DUMMY in api_timing_config() as a
no-op instead of returning -ENOTSUP, allowing device drivers
that call mspi_timing_config() unconditionally to work on
controllers without platform-specific timing calibration.
Signed-off-by: Dhanoo Surasarang <dhanoo.surasarang@nordicsemi.no>
Implement software auto-CE-break. When mem_boundary and
time_to_break are configured via mspi_dev_config(), sync
transfers are transparently split at address-aligned boundaries
and at a maximum segment size derived from the tCEM time budget.
time_to_break (in µs) is converted to max_clocks_per_ce using
the actual clock rate. At transfer time, command, address, and
dummy phase clocks are subtracted from this budget and the
remaining clocks are converted to a data byte limit, ensuring
no single CE assertion exceeds the device's maximum CE-low time.
Introduce sub_pkt indirection so that start_next_packet() and
handle_fifos() read from a staging packet rather than indexing
directly into the user packet array. This is required for
CE-break splitting, where run_one_packet() constructs synthetic
sub-packets with adjusted address and byte counts that do not
exist in the original xfer.packets array.
Async transfers with CE-break splitting are currently unsupported.
Signed-off-by: Dhanoo Surasarang <dhanoo.surasarang@nordicsemi.no>
The DACC_MR_ONE bit has to be set to one in the DAC driver
but it only applies to SAM4S and SAM4E.
SAM3S and SAM3X, SAM3A do on have this bit.
Signed-off-by: Eve Redero <eve.redero@gmail.com>
Add vendor quirks for nRF54LM20 PHY configuration for DWC2 in host mode.
Given the PHY is powered from USB, the PHY needs to be configured and
powered on before registers can be accessed or the SoC freezes on any
register access.
Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Add interrupt-driven PWM event callback functionality to the TI AM3352
EHRPWM driver. Note that only one event can be enabled at a time, hence we
require all callbacks to have same event trigger or none at all.
Signed-off-by: Amneesh Singh <amneesh@ti.com>
The virtio device enumeration asserts that every advertised queue size is
a power of two. A device may legitimately advertise a zero-size queue for
a feature it does not use (e.g. the virtiofs hiprio queue), which then
trips the assertion under CONFIG_ASSERT. Treat a zero size as "unused"
and skip the power-of-two check for it.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1-byte write in mt9m114_write_reg() was not assigned to `val` variable,
which caused uninitialized value to be written to the register, and
causing corrupted / invalid byte write.
Introduced from commit e3a7a32334
Signed-off-by: Hong Nguyen <hong.nguyen.k54@gmail.com>
Following #109468, GPIO is now disabled by default on STM32 boards.
On the other hand, the STM32 LTDC driver optionally uses 2 GPIOs to
control the display on/off and backlight, and will configure them
automatically when they are given in the device tree. Consequently,
without any further change, this leads to this kind of error:
[00:00:00.000,000] <err> stm32_gpioport_mgr:
Attempting to use GPIO API without enabling it!
[00:00:00.000,000] <err> display_stm32_ltdc:
Configuration of display on/off control GPIO failed
(as seen with samples/drivers/display on STM32H7S78-DK)
Therefore enable GPIO when the LTDC uses them.
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
When enabling CONFIG_NET_L2_ETHERNET_RESERVE_HEADER
and increasing CONFIG_NET_BUF_DATA_SIZE a net_pkt can
just contain one fragment, for that we need to make sure, that
the first and last bit can be set at the same time.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
- Add DMA transfer mode handling in the QSPI MSPI transceive path
- Allow HAL QSPI to configure DMA direction per transfer
instead of setting a fixed direction during DMA setup.
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
Add an 'i2s' shell that streams a generated test tone over any I2S
controller via the generic i2s.h API: 'i2s tone start <dev> [hz]
[rate]', 'i2s tone stop' and 'i2s tone info'. Transport-only pairs
with the 'codec' shell to route audio through a codec.
Gated by CONFIG_I2S_SHELL.
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
Add gyro_odr to the encoded header so the decoder knows the sample
rate. Fix base_timestamp_ns to reflect the time of the first FIFO
sample (trigger_time - (N-1)*period) and add timestamp_delta per
sample, matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 396a5615ee758c156fc340b3e2a496b6d1590ffc)
Add accel_odr to the encoded header so the decoder knows the sample
rate. Fix base_timestamp_ns to reflect the time of the first FIFO
sample (trigger_time - (N-1)*period) and add timestamp_delta per
sample, matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 674f1aff9143bbd8191eff4844fd5d84c938e421)
Adjust base_timestamp_ns backward from the trigger timestamp by
(N-1)*period so it reflects the time of the first FIFO sample,
matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 6fa8569d5ded7c6a2578ea3b30a5033861224497)
Adjust base_timestamp_ns backward from the trigger timestamp by
(N-1)*period so it reflects the time of the first FIFO sample,
matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit beb67e32e8e91250ec1ed877c89e4b140fd95673)
Adjust base_timestamp_ns backward from the trigger timestamp by
(N-1)*period so it reflects the time of the first FIFO sample,
matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 31e23771424d99a99392a94ae459be836d91dc3c)
Record base_timestamp_ns as the time of the first sample in the FIFO
by adjusting backward from the trigger timestamp using the total frame
count and ODR period, matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 36386844a6a0da009cca6bc730034f849e4b9dcf)
This reverts commit 794134a5ab.
NOTE: This is not a pure revert as conflicts needed to be resolved.
The "simplified" version was incorrect as it did not properly
account for elapsed cycles. This accounting lapse would allow
the timer to get programmed for some point in the past. As a
result, the timer would no longer be firing as expected.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
In the initialization function, when calling out to other functions,
save the returned status code in a dedicated variable which can then be
used to (1) print the error code in the LOG_ERR() message and (2) return
the error code as-is to the initialization function's caller.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The REGULATOR_STM32_VREFBUF_INIT_PRIORITY Kconfig option is only needed
when the associated driver is enabled. Gate it behind the driver option
REGULATOR_STM32_VREFBUF instead of merely whether a node is enabled,
DT_HAS_ST_STM32_VREFBUF_ENABLED.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Fix standalone HL78XX builds when optional low-power, GPIO, KSTATEV, and
IPv6 paths are disabled or enabled in different combinations.
Guard low-power registration bootstrap state behind
CONFIG_MODEM_HL78XX_LOW_POWER_MODE so builds without low-power support do
not reference low-power-only status fields.
Only keep the modem config pointer in hl78xx_init() when GPIO validation
is compiled in, and compile the GPIO validation block only when at least
one GPIO is configured.
Build the LTE-disable/GSM-enable registration status script only when
KSTATEV URC support is available and the GSM or AutoRAT paths require it.
Update IPv6 socket state references to use the grouped network.ipv6
storage.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Instantiate HL78XX modem, GNSS, and socket offload devices by devicetree
node instead of by DT_DRV_COMPAT instance.
This allows the standalone driver to support multiple HL78XX compatibles
without relying on a single active DT_DRV_COMPAT value. Generate unique
config, data, PM, and offload identifiers from the devicetree node hash.
Replace the HL78XX variant choice with hidden symbols selected by the
presence of matching devicetree nodes. This lets HL7800, HL7802, HL7810,
and HL7812 support be enabled from devicetree instead of requiring a
manual Kconfig variant selection.
Update modem, GNSS, and socket offload instantiation to use
DT_FOREACH_STATUS_OKAY() for the supported HL7800 and HL7812 compatible
nodes.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Create APLIC direct mode test cases to exercise APLIC with direct mode,
and include direct-mode QEMU in places where other qemu_riscv32 variants
are included.
Signed-off-by: Omar Naffaa <onaffaa@qti.qualcomm.com>