Commit graph zephyr/drivers
Author SHA1 Message Date
Bjarki Arge Andreasen
62f200f4b8 drivers: spi: nrfx_spim_common: remove RAM_BUF linker placement
Since nordic DMM has been introduced, the SPIM RAM buffer is no
longer used in case DMM is enabled. Before DMM the SPIM RAM buffer
was manually placed in the DMM linker section, now the driver
allocates a buffer from the DMM linker section dynamically instead.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-06-17 16:35:23 -04:00
Etienne Carriere
7488ca1e2a drivers: i2c: stm32: lock PM state on suspend-to-ram
Get/put PM state lock for suspend-to-ram mode when CONFIG_PM_S2RAM
is enabled to prevent clocks are switch off while an I2C transfer
is on-going.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-17 16:35:13 -04:00
Etienne Carriere
3f65fc4812 drivers: i2c: stm32: common PM get/put helper functions
Add i2c_stm32_pm_get() and i2c_stm32_pm_put() helper functions for
all STM32 I2C driver flavors to get and put PM resources when the
I2C bus is used. Use them in the I2C master mode sequences instead
of using local implementation.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-17 16:35:13 -04:00
Etienne Carriere
b66fc638c0 drivers: i2c: stm32: Test PM runtime initialization
Report error returned by pm_device_runtime_enable() in STM32 I2C drivers.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-17 16:35:13 -04:00
Etienne Carriere
1efd7fe1d7 drivers: i2c: stm32: test I2C_TARGET_FLAGS_ADDR_10_BITS bit flag
Test I2C_TARGET_FLAGS_ADDR_10_BITS as a bit flag value instead of
a 32bit overall value.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-17 16:35:13 -04:00
Aiden Hu
e402022682 usb: uhc_mcux_ehci: use clock control driver to set usb host clock
Check that the controller and PHY clock devices are ready, then
enable the clocks with clock_control_on() before calling
clock_control_set_rate().

This lets the host EHCI driver bring up RT7xx USB clocks from the
devicetree clock description.

Signed-off-by: Aiden Hu <weiwei.hu@nxp.com>
2026-06-17 16:35:06 -04:00
Perry Naseck
1069b6822a serial: Fix PL011 error staying latched
This commit fixes an issue where a framing error is never cleared
on the PL011 serial peripheral.

Assisted-by: Claude:claude-opus-4.7

Signed-off-by: Perry Naseck <pnaseck@media.mit.edu>
2026-06-17 16:34:56 -04:00
Łukasz Stępnicki
d5ce0c2390 drivers: watchdog: gswdt with config service
Added option to nrf gswdt drivers to be able to configure
maximum timeout window and also to be able to stop gswdt.
This features are only available when gswdt service is
supported by local domain, otherwise gswdt can still be
used but with fixed timeout and cant be stopped.

Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
2026-06-17 16:34:11 -04:00
Łukasz Stępnicki
95316d3fbd drivers: watchdog: global software based watchdog
New driver based on sysctrl acting as a watchdog.
After global software watchdog setup sysctrl will monitor
pings from particular local domain and reset SOC if ping
doesnt arrive before 6s timeout expires.
This software watchdog will be active only if local
domain will do wdt setup procedure.'

Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
2026-06-17 16:34:11 -04:00
Travis Lam
bceda620fd driver: flash: tf-m mramc service in nrf_mramc and write in normal mode
Add tfm-nrf-mramc to zephyr MRAMC driver, since mramc is secure only
peripheral. Access of nrf-mramc need nrf mramc service.
Bugfix for unaligned write should be done byte by byte instead of word
by word.

Flash write in normal write mode, previously nrf_mramc driver write use
DIRECT_WRITE_MODE in mramc. It is a not reliable method of handling
flash write since the write buffer may lost content when the write is
interrupted. This change is to switch to normal write mode and the
every write should align to 16 bytes which is the write-block-size.

Signed-off-by: Travis Lam <travis.lam@nordicsemi.no>
2026-06-17 17:44:58 +02:00
Travis Lam
496e5a17e5 driver: flash: nrf_mramc: add write verification
Physical write block size of mram is 16 for nrf7120. While using
direct write mode for write. Writing 32-bits word is handled by
mramc hardware itself.

In nrf7120 is capable to disable busfault when word written is
corrupted. Data verification is added after write/erase to
ensure a write is robust.

Signed-off-by: Travis Lam <travis.lam@nordicsemi.no>
2026-06-17 17:44:58 +02:00
Anas Nashif
ea1fbf3588 driver: fix various typos
Fixed various typos under drivers/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-17 10:12:27 -04:00
Lucas Zampar Bernardi
ac8d707530 drivers: flash: stm32_qspi: fix Read JEDEC ID phantom address phase
qspi_read_jedec_id() builds the JEDEC Read ID (0x9F) command with
.AddressMode set to QSPI_ADDRESS_1_LINE, while intending to send no
address phase: .AddressSize is set to QSPI_ADDRESS_NONE, which is the
AddressMode "none" constant (0x0) and, used as an address size, equals
QSPI_ADDRESS_8_BITS.

Because the STM32 HAL emits an address phase whenever
AddressMode != QSPI_ADDRESS_NONE, the controller clocks out a phantom
8-bit address after the opcode. This shifts the returned data by one
byte and drops the manufacturer ID: flash_read_jedec_id() returns e.g.
40 19 00 instead of EF 40 19 for a Winbond W25Q256JV.

Set .AddressMode to QSPI_ADDRESS_NONE so the Read ID command issues no
address phase, as the 0x9F command requires.

Signed-off-by: Lucas Zampar Bernardi <lucas.zampar@gmail.com>
2026-06-17 10:06:49 -04:00
Chaitanya Tata
a741c7300c drivers: wifi: nrf70: add Kconfig for FW patch download chunk size
Expose the chunk size used when downloading the nRF70 firmware patches
to the RPU as NRF70_PATCH_DL_CHUNK_SIZE. It defaults to 4096 bytes, and
to 2048 bytes on the nRF54H.

Each chunk maps to a single SPI/QSPI transfer, so it has to fit both the
host EasyDMA MAXCNT and any DMA bounce region the bus driver relies on.
The previous hard-coded 8192 overran the 13-bit EasyDMA MAXCNT on nRF91
(max 8191 bytes) and the 4 KB cpuapp DMA bounce region on nRF54H20. The
oversized transfer was rejected and the error dropped on the write path,
leaving the RPU with a corrupt patch and a bad boot signature.

On the nRF54H the bounce buffer comes from the small 4 KB cpuapp DMA
region that is shared with the console UART and other peripherals, so
even a 4096 byte chunk cannot find contiguous space there. Default to
2048 on that SoC and keep 4096 elsewhere, which also stays within the
nRF91 MAXCNT while keeping the chunk count low.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
2026-06-17 10:06:41 -04:00
Erdem Simsek
d40b63ae47 drivers: flash: nordic: Add mramc region size and address kconfig.
NRF_MRAMC_REGION_ADDRESS_RESOLUTION and NRF_MRAMC_REGION_SIZE_UNIT
is added.

Signed-off-by: Erdem Simsek <erdem.simsek@nordicsemi.no>
2026-06-17 10:06:21 -04:00
Baptiste Coffin
ef3da3c7a7 drivers: ieee802154: mcxw: fix channel desync after temporary operations
- Added `phy_channel` to track actual PHY hardware state
- Created `rf_change_channel()` as single entry point for all changes
- Implemented `rf_restore_main_channel()` for automatic restoration
- Added `rf_restart_rx_if_enabled()` helper to avoid code duplication
- Restored `rf_set_channel()` as low-level PHY configuration helper

Signed-off-by: Baptiste Coffin <baptiste.coffin_1@nxp.com>
2026-06-17 10:05:49 -04:00
Camille BAUD
dbed72de7f drivers: lora: Add LR11xx native driver
Add a basic driver for LR1121

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-06-17 10:05:37 -04:00
James Bennion-Pedley
d9bc08b6a6 soc: wch: add CH32V305 and CH32V317
Adds WCH CH32V305 and CH32V317, completing the SOC family

Signed-off-by: James Bennion-Pedley <james@bojit.org>
2026-06-17 10:04:46 -04:00
Kirill Shypachov
9043f4b08a drivers: mspi: stm32: fix OSPI condition style
Add the missing space before the OSPI instance validation brace.

Signed-off-by: Kirill Shypachov <kshypachov@outlook.com>
2026-06-17 12:00:33 +02:00
Kirill Shypachov
eeae30eb72 drivers: mspi: stm32: make OSPI instance macros portable
Wrap each node-label arm of OSPI_INST_NUM() in
COND_CODE_1(DT_NODE_EXISTS(...)) so DT_NODELABEL(octospiN) is only
expanded when that node exists in the current DTS. The macro
previously referenced octospi1 and octospi2 unconditionally, which
broke the build on parts that do not have both instances. An
unknown node now resolves to 0 instead of silently defaulting to 1.

Guard the OSPIM-only helpers (DT_OSPI_IO_PORT_PROP_OR and
OSPI_INST_IO_{LOW,HIGH}_PORT) with #if defined(OCTOSPIM) and
provide neutral zero stubs otherwise, so the driver compiles on
STM32 parts without the OCTOSPI I/O Manager (e.g. STM32L4/L5).

Add a BUILD_ASSERT in MSPI_STM32_INIT to reject at compile time a
DTS node that is neither octospi1 nor octospi2 (the trailing 0
case).

Zero-initialize s_MemMappedCfg so no uninitialized fields are
passed to HAL_OSPI_MemoryMapped().

Signed-off-by: Kirill Shypachov <kshypachov@outlook.com>
2026-06-17 12:00:33 +02:00
Kirill Shypachov
332093a255 drivers: mspi: stm32: derive OSPIM port defaults from node label
Add OSPI_INST_NUM() to determine the hardware OSPI instance
number (1, 2, ...) from the devicetree node label instead of the
DT_INST ordinal index. The ordinal depends on enumeration order
and does not necessarily match the hardware instance, so the
default OSPIM port values could be assigned to the wrong
controller.

Use OSPI_INST_NUM() and the new OSPI_INST_IO_{LOW,HIGH}_PORT()
helpers for the clk, ncs and IO port defaults, replacing the
(index == 0) assumption that index 0 is always OCTOSPI1.

Collapse the identical OCTOSPI1 and OCTOSPI2 branches in
mspi_stm32_ospi_config() into a single assignment and keep only
the instance validity check.

Drop a duplicate DataDtrMode assignment in
mspi_stm32_ospi_prepare_cmd().

Signed-off-by: Kirill Shypachov <kshypachov@outlook.com>
2026-06-17 12:00:33 +02:00
Kirill Shypachov
36b504f06f drivers: mspi: stm32: read OSPIM port config at compile time
Fix reading the OSPIM port settings from devicetree. The values
were resolved with a runtime dev_id passed to devicetree macros,
so the macros always fell back to defaults instead of the DTS
values. Read the ports from the device config, populated at
build time, instead.

Add an STM32U5 errata 2.6.1 workaround: set DQSE in WCCR for
memory-mapped writes, otherwise every memory-mapped write
returns an AHB error (Bus Fault).

Enable the bus inactivity timeout when the OCTOSPI I/O Manager
runs in multiplexed mode (OCTOSPI1/OCTOSPI2 share CS, CLK and
IO0-IO3). Without it one peripheral can hold the bus
indefinitely; the timeout forces nCS release. The value 0x34
was chosen empirically. This is gated on OCTOSPIM/MUXEN, not on
the U5 series.

Signed-off-by: Kirill Shypachov <kshypachov@outlook.com>
2026-06-17 12:00:33 +02:00
Kirill Shypachov
50d480515f drivers: mspi: stm32: add OSPIM port fields to config struct
Extend the mspi_stm32_conf structure with fields to store the
OSPIM module port settings (clk, dqs, ncs, io low/high) that
are read from the devicetree.

Signed-off-by: Kirill Shypachov <kshypachov@outlook.com>
2026-06-17 12:00:33 +02:00
Kapil Bhatt
06ea49c1b9 drivers: wifi: Enable Wi-Fi keep-alive by default
Enable Wi-FI keep-alive by default. If not configured,
devices may experience unintended disconnections from certain APs.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-06-17 09:49:51 +02:00
Anas Nashif
c516cb7c14 drivers: modem: wncm14a2a: bound socket-notify parsing to linearized len
on_cmd_socknotifyev() scanned for quote delimiters using `len` (the
attacker-controlled frame length) as the loop bound, while the data was
linearized into a fixed 40-byte `value` buffer. A long response walked
past the buffer and the value[p2] = '\0' store wrote out of bounds.

Bound the scanning loops by out_len (the linearized length) instead.

Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-17 08:07:19 +02:00
Anas Nashif
a1cbced641 drivers: modem: hl7800: bound +CGCONTRDP address field copies
The +CGCONTRDP handler computed each address field length from
delimiter positions in the network-supplied response and used it
unbounded in strncpy() into the fixed temp_addr_str stack buffer (and
the smaller dns_v4_string), allowing a malicious network to overflow the
stack.

Bound each field length against the destination buffer before the copy.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-17 08:07:19 +02:00
Anas Nashif
ea91f93756 drivers: modem: hl7800: fix off-by-one NUL write in response handlers
Numerous AT response handlers called net_buf_linearize(dst, sizeof(dst),
...) and then wrote dst[out_len] = 0. net_buf_linearize() can return a
count equal to its destination-length argument, so when a field exactly
filled the buffer the terminating NUL was written one byte past the end,
corrupting adjacent context fields. One site additionally passed the
wire length as the destination size, allowing a full overflow.

Pass sizeof(dst) - 1 (and a correct bound for the IMSI and KCELLMEAS
sites) so the NUL write always stays in bounds, matching the already
correct handler.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-17 08:07:19 +02:00
Michael Zimmermann
8a7ae0bed1 modules: hal_silabs: rename gecko kconfigs
- Kconfigs in modules/ should not define configs with an SOC_ prefix.
  Furthermore, these options are SDK specific, not SoC specific.
- The simplicity_sdk configs do the same.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2026-06-17 08:05:45 +02:00
Jose Alberto Meza
486a442bb0 drivers: i3c: npcx: fix NULL deref of target_config in ISR
data->target_config is NULL until i3c_target_register() is called by
the application layer. The I3C bus master can assert a STOP condition
during board init before registration occurs, firing the ISR while
target_config is still NULL.

Both npcx_i3c_target_isr() and npcx_i3c_target_xfer_end_handle()
unconditionally dereferenced data->target_config->callbacks, causing
an MPU Instruction Access Violation when the resulting garbage pointer
was used as a function pointer.

Guard the callbacks pointer derivation with a NULL check on
target_config in both sites. Existing per-callback NULL guards
downstream already handle the NULL case correctly.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2026-06-17 08:03:58 +02:00
Sylvio Alves
59bf0091b5 drivers: serial: esp32: clear all uhci escape bits
The escape_conf bits reset to 1 and were left set, escaping 0xC0 and
0xDB on the async path even with SLIP off. Clear them, then enable.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-17 08:03:15 +02:00
Jilay Pandya
b70f8bf048 drivers: max30101 replace a bunch of BUILD_ASSERTs
use min-len/max-len for asserting the correct length of the
array, drop corresponding build asserts

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2026-06-17 08:02:10 +02:00
Andreas Petter
52da13e0ea drivers: led_strip: ws2812_rpi_pico_pio: fix SM start offset
The driver discarded the load offset returned by pio_add_program() and
started the state machine with pio_sm_init(pio, sm, -1, ...). The -1 is
silently masked to PC 31 by pio_encode_jmp(), which only works by
accident while the ws2812 program is the sole program in the PIO
instance: top-down placement puts it at offsets 28..31, and PC 31 then
happens to hit the program's final jmp back to its start.

As soon as another program is loaded into the same PIO instance first
(lower init priority), the ws2812 program is placed at a lower offset.
The SM then starts inside foreign code, falls through into empty
instruction memory and loops there forever, so the data pin stays
silent without any error being reported.

Store the offset in a data struct of the parent PIO program device and
pass it to pio_sm_init() as the initial PC, with error handling for
exhausted instruction memory. Parent-before-child init order is given
by the devicetree dependency ordinals; a device_is_ready() guard is
added as a safety net.

Signed-off-by: Andreas Petter <andreas@ibpetter.de>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-17 08:01:37 +02:00
Fabio Baltieri
ec003017df drivers: led: add a Linux LED native_sim driver
Add a native_sim driver to control a Linux LED on the host using the
Zephyr LED APIs.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-06-16 23:16:34 +02:00
Peter Mitsis
794134a5ab drivers: timer: simplify intel_adsp_timer
Simplifies the sys_clock_set_timeout() calculation used to determine
the next correct cycle at which to trigger the timer interrupt. There
is no risk that number of cycles we are adding will exceed MAX_CYCLES.

--

Furthermore, should the current cycle count match the 'last_count',
it prevents the timer from firing one tick too early. That firing
would not lead to miscount of ticks, nor mis-execution of handlers.
However it could lead to one extra timer interrupt being processed
unnecessarily.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2026-06-16 23:16:20 +02:00
Armando Visconti
2b61140427 drivers: sensors: st: fix shub using 8-bit i2c_addr
Init the sensorhub targets using 8-bit i2c_addr for those drivers
when their STMEMSC API requires it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2026-06-16 23:15:38 +02:00
a3e079872c drivers: serial: wch: only report TX ready if the interrupt is enabled
`uart_irq_tx_ready` should report true if transmit is empty
and the transmit interrupt is enabled. This isn't documented in
drivers/uart.h but is required by code such
`subsys/modules/modbus_serial.c` and implemented in drivers such as
`uart_sam.c` and `uart_stm32.c`.

Fix.

Signed-off-by: Michael Hope <michaelh@juju.nz>
2026-06-16 23:15:28 +02:00
Alain Volmat
64f35afdcf drivers: clock_control: stm32: add stm32h5 handling
Allow PLL1 to PLL3 for the STM32H5 family.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-06-16 12:58:12 -05:00
Gaston Donikian
d25ce05021 drivers: gnss: u-blox: add M10 GNSS driver
Add a driver for the u-blox M10 GNSS receiver.
It is heavily modeled on the F9P implementation.

Signed-off-by: Gaston Donikian <gastondonikian@gmail.com>
2026-06-16 12:56:31 -05:00
Alexandra Covaci
abae121477 drivers: rtc: microchip: Add RTC MSS drivers
Add RTC MSS driver for Microchip mpfs_icicle.

Signed-off-by: Alexandra Covaci <Alexandra.Covaci@microchip.com>
2026-06-16 12:55:58 -05:00
Andrej Butok
cda67435f2 drivers: crc: nxp: add CRC-32/MPEG-2 support
Adds CRC-32/MPEG-2 support to the NXP CRC drivers.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-06-16 17:50:14 +02:00
Andrej Butok
8c5eb06bfa crc: add CRC-32/MPEG-2 implementation
- Adds the CRC-32/MPEG-2 variant
  (ISO/IEC 13818-1 Annex A, ITU-T H.222.0)
  to both the software CRC subsystem and the CRC device API.
- Adds crc32_mpeg2() and crc32_mpeg2_update().

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-06-16 17:50:14 +02:00
Sylvio Alves
3166069477 drivers: flash: esp32: install flash funcs at driver level
Install flash functions at driver init, once the scheduler
is running, since early boot leaves the chip on the no-OS path.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-16 17:47:22 +02:00
Guillaume Gautier
d4972dc2ed drivers: spi: stm32: fix for stm32h7 in rtio
For STM32H7, disable IRQ in RTIO when tranfer is completed to prevent
spurious IRQ to stall the system.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-06-16 17:45:15 +02:00
Guillaume Gautier
f35c46b7be drivers: spi: stm32: remove fifo-enable
For st,stm32h7-spi compatible, always use the TSIZE register and the FIFO
for polling and interrupt mode. This increases performance compared to not
using it, and it reduces code complexity. This removes the need for the
fifo-enable property.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-06-16 17:45:15 +02:00
Guillaume Gautier
1628f86398 drivers: spi: stm32: simplify the use of fifo for st,stm32h7-spi compat
For st,stm32h7-spi compatibles, when fifo-enable property is set, the
driver was setting the TSIZE register with the size of each buffer in the
transaction, leading to several disable/enable of the SPI instance.
Now, it sets the complete size of the transaction without intempestive
disabling of the SPI.

To add flexibility, the FIFO threshold is now configurable from a dts
property.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-06-16 17:45:15 +02:00
Guillaume Gautier
7e23b63959 drivers: spi: stm32: rework dma transfer
This commit simplifies the flow of the STM32 SPI DMA transfer.

For the "st,stm32h7-spi" compatible, do not set the TSIZE register for a
DMA transfer (to define the size of the transfer). This setting was
leading to several disable/enable of the SPI instance in case multiple
buffers were used in the transaction, and it didn't bring noticeable
performance benefit. At the same time, do not use the SPI FIFO because
it's a hurdle to use without the TSIZE.

Rework the flow of initial operation to better match the procedure
described in the Reference Manuals.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-06-16 17:45:15 +02:00
Guillaume Gautier
ab34f00777 drivers: spi: stm32: wait for both dma tx and rx done
When waiting for DMA transfer done, wait for both TX and RX, instead of
only one of them.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-06-16 17:45:15 +02:00
Nicolas Pitre
860bbbcbdb drivers: timer: nrf_rtc_timer: switch to absolute tick-aligned deadlines
sys_clock_set_timeout() computed the compare value as

    cyc = ticks * CYC_PER_TICK + unannounced;
    cyc = DIV_ROUND_UP(cyc, CYC_PER_TICK) * CYC_PER_TICK;
    target = last_count + cyc;

The DIV_ROUND_UP forces the fire onto the next tick boundary *after*
the requested point, but the driver never subtracts the unannounced
sub-tick offset back out. When the caller arms partway through a tick
(the common case), the timer therefore fires one tick later than the
kernel asked for -- k_timer_start(K_TICKS(N), ...) ends up firing at
roughly N+2 ticks instead of N+1.

Adopt the absolute tick-aligned deadline pattern already proven in
arm_arch_timer.c and riscv_machine_timer.c:

  - Track last_elapsed: the tick count the kernel last observed via
    sys_clock_elapsed(). Reset to 0 in the handler at announce.
  - sys_clock_set_timeout() computes the target as
      target = last_count + (last_elapsed + ticks) * CYC_PER_TICK
    and clamps the cycle delta from last_count at MAX_CYCLES so the
    24-bit compare register is satisfied relative to the current
    counter.
  - The handler reads the current counter (not the scheduled expire
    time) to compute dticks, advancing last_count to the actual tick
    boundary just past now in one shot. This subsumes the previous
    "wrap protection" branch: a large unannounced delta naturally
    produces a target in the past, compare_set forces an immediate
    IRQ, and the handler catches up in a single invocation.
  - sys_clock_elapsed() records the delta in last_elapsed.

A v1 of this change (commit 67a29d7f98 ("drivers: timer:
nrf_rtc_timer: switch to absolute tick-aligned deadlines"), since
reverted) kept a separate "if unannounced >= COUNTER_HALF_SPAN,
target = last_count" branch. That broke the handler invariant:
dticks evaluated to zero, last_count never advanced, and the ISR
re-pended in an infinite loop once the counter naturally crossed
COUNTER_HALF_SPAN (~4m17s on nrf52). The structural change above
removes the need for any such recovery branch.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-06-16 17:44:04 +02:00
Fin Maaß
7aec7f2bde drivers: ethernet: dwmac: add support for the stm32f series
add support for the stm32 f series in the
dwmac driver.

Assisted-by: Github Copilot:Claude Haiku 4.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-16 10:28:11 +02:00
Fin Maaß
3e2831ac18 drivers: ethernet: dw: add support for dwc_ether_mac10_100_1000_universal
add support for the dwc_ether_mac10_100_1000_universal,
that is used, f.e. on the stm32 f series.

Assisted-by: Github Copilot:Claude Haiku 4.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-16 10:28:11 +02:00