This reverts commit 713cdff118.
Build error:
ERROR: /soc/mmc@ee140000 <rcar_mmc_init> is initialized before its
dependency /regulator_1p8v <regulator_fixed_init>
ERROR: ... /regulator_3p3v <regulator_fixed_init>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This reverts commit f9bed91088.
build error:
Build failure - error: static assertion failed: "cpu0 clock-frequency
does not match HSE * mul"
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
set the default of SDHC_INIT_PRIORITY to
KERNEL_INIT_PRIORITY_DEVICE, just like at the other
driver priorities.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit adds a new DT control `hsi-prediv` for `wch,ch32v20x_30x`
devices and compile-time checks to ensure the clock configuration is valid.
This allows control of the internal clock divisor to be able to reach the
full 144MHz when using the internal clock source (`HSI`).
Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Perry Naseck <pnaseck@media.mit.edu>
Writes/erases use the indirect interface and don't update the D-cache, so
memory-mapped reads returned stale data once the cache was enabled.
Invalidate the affected range on write/erase completion.
Assisted-by: GPT-5.3-Codex
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
Add HL78XX_MODEM_INFO_FW_VERSION to the public modem API and
return the modem firmware version through get_modem_info().
Also introduce a configurable desired firmware version option
for firmware validation and diagnostics.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Replace the generic initialization-failure handling path with a
rule-based recovery framework for HL78xx modem chat scripts.
The new recovery mechanism captures script failure context,
including the failed script, command index, request, and result,
and uses this information to select a targeted recovery action.
Successful recovery is tracked and verified before the failure
state is fully cleared.
Key changes include:
- Introduce a dedicated RECOVERY state
- Capture and preserve script failure context
- Add configurable recovery rules and recovery actions
- Track recovery attempts and enforce retry limits
- Add helpers for clearing and confirming recovery state
- Recover corrupted KBNDCFG band configuration automatically
- Recover post-restart KSUP configuration timeouts
- Extend modem chat APIs to expose the active script and command
- Remove the legacy diagnostic-script recovery path
- Simplify restart fallback handling and recovery lifecycle
- Remove the obsolete script failure counter
This improves modem robustness by enabling targeted recovery of
known script failures while avoiding unnecessary modem resets
and full reinitialization sequences.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Rename the PMC configuration script state leave handler to
better match the associated state and follow existing handler
naming conventions.
This is a non-functional change that improves code clarity and
consistency within the HL78xx state machine implementation.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
The buffer size validation compared buffer_size (bytes) against
num_channels (sample count), allowing undersized buffers to pass.
The byte count was then stored in results_length and used as a
uint16_t slot count in the sample-reading worker, causing
out-of-bounds 16-bit writes.
Fix by:
- Using the shared adc_sequence_validate_buffer() helper to validate
buffer_size against num_channels * sizeof(uint16_t), matching the
common approach introduced for the other ADC drivers
- Storing buffer_size / sizeof(uint16_t) in results_length
- Using post-decrement (length-- > 0) instead of pre-decrement
(--length > 0) to allow the correct number of writes
Assisted-by: Claude:opus-4.6
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
Prevent infinite loops when hardware becomes unresponsive
by adding a timeout in TX context allocation.
Signals interface is down and returns -ETIMEDOUT on timeout.
Co-authored-by: Alessandro Nuzzi <alesnu96@gmail.com>
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
This adds support for ARM Corstone System Architecture Specification Ma2
(ARM CRSAS-MA2) System Counter and System Timer.
The HW consists of one 64-byt System Counter, and any number
of System Timers that have match registers to generate interrupts
based on the value of the System Counter.
The timers don't have any counter/timer of their own, meaning that
System Counter can't be started or stopped independently if there is an
enabled System Timer.
Add the crsas-ma2 timer to the test for counters.
Signed-off-by: Mike J. Chen <mjchen@google.com>
Signed-off-by: Krystian Hebel <khebel@antmicro.com>
Some STM32 SAI nodes may expose a shared kernel clock for both sub-blocks,
while others may provide different kernel clocks for sub-block A and
sub-block B.
These changes allow the driver to handle SAI nodes with different kernel
clock layouts. Nodes with sai_ker_ck use a shared kernel clock for both
sub-blocks, while nodes with sai_a_ker_ck and sai_b_ker_ck use
separate kernel clocks for each sub-block.
Signed-off-by: Mario Paja <mariopaja@hotmail.com>
Modified the Microchip XEC eSPI TAF V2 driver adding support for
MEC174x/5x/165x. We agree with code quality tool analysis the eSPI
TAF register structure is too larger and not maintainable. The driver
now uses Zephyr's system memory mapped register access routines.
quality check tools find the structure too large.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
The do_ccc syscall verifier checked the outer payload and the
ccc/targets arrays but operated on the caller's live structure and
did not validate the per-target data buffers, unlike the i3c_transfer
verifier which snapshots its message array before use.
Make the two paths consistent: introduce copy_ccc_and_do(), which
snapshots the payload, allocates a kernel-side copy of the target
array via k_usermode_alloc_from_copy(), and validates each data
buffer with K_SYSCALL_MEMORY() before calling the implementation.
num_targets is capped at 31 as a sanity bound. The driver-written
num_xfer and err fields are copied back to the caller after the
transfer so results still propagate; data buffers are unaffected
as their pointers still reference user memory.
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
rv8263c8_calibration_get() decodes the offset register with the
mode-to-step mapping reversed relative to rv8263c8_calibration_set()
and the application manual: it multiplies fast mode (MODE = 1) by
the 4340 ppb normal mode step and normal mode by the 4069 ppb fast
mode step, so every readback is scaled by the wrong step size.
The signed 7-bit decode is also broken. The register byte is read
into an int8_t, so the MODE bit acts as the sign during integer
promotion, and the branch for a set bit 6 ORs in bit 7 of an
already-positive value: a stored offset of -64 (0x40 with MODE = 0)
reads back as +192 steps. Mask the 7-bit offset field and use
sign_extend(), as rtc_rv8803 does for the same register layout.
With both fixes a set()/get() sequence returns the effective
programmed value at hardware resolution.
Built tests/drivers/build_all/rtc (i2c_devices.overlay) for
qemu_cortex_m3 with CONFIG_RTC_CALIBRATION=y. No hardware run;
register-level analysis against the RV-8263-C8 application manual.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
rv8263c8_calibration_set() masks the mode candidates with
GENMASK(7, 0), so bit 7 of a negative two's complement candidate
lands in the MODE bit of the offset register: every negative
calibration request silently switches the device into fast mode
even when normal mode was selected. Mask with the signed 7-bit
offset field (bits 6..0) instead so the MODE bit is controlled
only by the selected mode.
The function also accepts any int32_t request. Out-of-range values
now return -EINVAL per the rtc_set_calibration() API contract
instead of silently wrapping in the register field. In addition,
the fast mode candidate is only selected when it fits the 7-bit
field: fast mode has the smaller step, so near the range limits
its candidate can exceed the field even though the request itself
is representable in normal mode.
Values previously accepted beyond +/-64 offset steps now fail with
-EINVAL, which is a user-visible conformance fix.
Built tests/drivers/build_all/rtc (i2c_devices.overlay) for
qemu_cortex_m3 with CONFIG_RTC_CALIBRATION=y. No hardware run;
register-level analysis against the RV-8263-C8 application manual.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
CK48 is now moved to separate mode.
It is shared by RNG and USB peripherals. This avoids
collision and also allows checking in RNG driver.
Signed-off-by: Adam BERLINGER <adam.berlinger@st.com>
Use #include <> instead of #include "" to include a header file which path
is not relative to the directory path of the file emitting the #include
directive.
This change was made running scripts/check_quoted_includes.py script
proposed in https://github.com/zephyrproject-rtos/zephyr/pull/112135
with the Linux shell command below and manually selecting the applicable
changes:
$ ./scripts/check_quoted_includes.py -w drivers/usb/
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
A peer that negotiated ACFC could not talk to us at all. The HDLC
receiver rejected such a frame twice: STATE_HDLC_FRAME_ADDRESS
resynchronised on any first octet other than 0xff, and ppp_process_msg()
dropped whatever survived unless the frame started with 0xff 0x03.
RFC 1662 ch. 3.2 requires accepting both forms.
Let STATE_HDLC_FRAME_ADDRESS fall through into STATE_HDLC_FRAME_DATA for
any non-delimiter octet, which also gives an ACFC frame the 0x7d
unescaping it needs when the Protocol field starts with 0x00, and make
the header removal peek before pulling.
The FCS needs no adjustment: it is computed over the frame as
transmitted, so an ACFC frame simply has fewer octets covered. The
Address and Control fields must not be synthesized back in.
Frames damaged by line noise are no longer rejected on the Address octet
and are now caught by the FCS check alone, which is why
NET_PPP_VERIFY_FCS defaults to y.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Aleksandr Senin <al@meshium.net>
ppp->next_escaped is set when a 0x7d escape octet is received and cleared
only when the escaped octet itself arrives. A frame aborted mid-escape
(0x7d 0x7e, RFC 1662 ch. 4.2) therefore leaves the flag set, and the first
octet of the following frame that reaches STATE_HDLC_FRAME_DATA gets XORed
with 0x20.
Today the damage is limited because STATE_HDLC_FRAME_ADDRESS stores the
Address octet without consulting the escape state, so the corruption lands
on the Protocol field and the frame is dropped on an unknown protocol.
Clear the flag whenever a 0x7e delimiter is seen, in all three states that
can observe one.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Aleksandr Senin <al@meshium.net>
Consider k_work_submit() return value in STM32 I2C RTIO driver. If
failing the bus recovery sequence is not started in which case the
error must but reported to the caller and the RTIO queue should not
stall.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Remove the dedicated BCM2711 auxiliary UART driver and its associated
Kconfig entry now that support has been integrated into the generic
NS16550 driver.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
Add support for the Broadcom BCM283x auxiliary UART variant to the
NS16550 driver by introducing a dedicated Kconfig option and variant-
specific register definitions required for the extended register set.
This enables the generic NS16550 driver to support the auxiliary UART
found on Broadcom BCM283x SoCs.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
When check_buffer_size() fails, the driver was returning early
without calling adc_context_complete(). This caused the caller
to hang indefinitely waiting for the context to complete. We now
properly complete the context with the -ENOMEM error code.
Fixes#115091
Signed-off-by: Saksham Gupta <saksham77779@gmail.com>
The DINOFF update read back SMTEN instead of DINOFF, so the write
seeded the input-disable register from Schmitt-trigger state and
destroyed the other pins' DINOFF bits. Read DINOFF, matching every
other read-modify-write in the function.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The bridge already forwards the port configuration (baudrate,
parity, etc...) to the peer, but not the modem control lines.
Forward DTR RTS state to the peer port as well, so a bridged
serial port carries the control lines through like a USB-serial
adapter does.
Note the forwarding is compiled in only if CONFIG_UART_LINE_CTRL
is enabled.
Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
The 16-bit branch of spi_gd32_frame_exchange() read the TX buffer
through a uint8_t pointer, copied from the 8-bit branch, so the high
byte of every 16-bit frame was transmitted as zero. Read a full
16-bit word, matching the RX side.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Add modem driver for Nordic nRF91 series running the
Serial Modem application v2.0.0 or later. This includes the nRF91M1 module.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>