Commit graph zephyr/drivers
Author SHA1 Message Date
bernard Puel
e4a3278633 drivers: crypto: stm32_hash: add HASH1 interrupt-mode processing
Add interrupt-driven HASH processing for SHA-224/SHA-256, on top of
the existing polling-only HAL_HASHEx_SHAxxx_Start() driver. The
calling thread now blocks on a semaphore given from the HASH ISR
instead of busy-polling status registers, freeing the CPU while the
peripheral computes the digest. This is purely devicetree-gated (no
Kconfig toggle): it activates automatically whenever the node has an
interrupt line, and falls back to polling for algorithms without a
HAL _Start_IT() variant (SHA-384/SHA-512).

Unlike other STM32 families already wiring up this same HASH IP
(F4/F7/H5/C5, e.g. `interrupts = <80 0>;` on H7), the STM32MP13
devicetree node had no `interrupts` property at all. Add it the same
way, using GIC SPI 81, derived from the CMSIS HASH1_IRQn (=113)
constant converted to GIC SPI numbering (SPI = IRQn - 32,
cross-checked against this SoC's I2C5 entry). No binding change is
needed: DT_INST_IRQN()/DT_INST_IRQ_HAS_IDX() work directly off the raw
devicetree data regardless of whether `interrupts` is declared in the
compatible's own binding, exactly as already relied upon for the other
families.

Also wire up the interrupt-driven path for HAL2-based series (C5, and
future ones): HAL2 exposes a single, algorithm-agnostic
HAL_HASH_Compute_IT() instead of one _Start_IT() per algorithm, so
every algorithm exposed on the node goes through it, unlike the
SHA-224/SHA-256-only restriction of the legacy HAL. Completion is
signalled through HAL2's renamed HAL_HASH_DigestCpltCallback() (the
error callback keeps its legacy name, HAL_HASH_ErrorCallback()), and
readiness is queried through HAL_HASH_GetState() rather than a direct
->State field read, since HAL2 does not expose that field under the
same name. HAL2 already resets its internal phase/state on a
completed digest, so the Phase-reset workaround below does not apply
to it. Compile-tested on nucleo_c562re (STM32C5, HAL2); not exercised
on real HAL2 hardware in this series since STM32MP13 uses the legacy
HAL.

Fix a pre-existing correctness bug found while testing: the vendor HAL
leaves hhash->Phase at HAL_HASH_PHASE_PROCESS after a completed
one-shot digest instead of resetting it to READY. A second
hash_compute() call on the same session therefore silently continued
the previous message's internal digest state instead of starting
fresh, producing a wrong digest with no reported error. Force Phase
back to READY after every completed computation, on both the polling
and interrupt paths.

Enable the HASH node at board level in stm32mp135f_dk.dts and add the
board to tests/crypto/crypto_hash's platform_allow. It is left out of
integration_platforms since stm32mp135f_dk requires an external
flasher not yet wired into CI, so it does not build/run automatically
in Twister's default sweep; the interrupt-mode path is instead
exercised through the samples/drivers/crypto/hash_bench benchmark.

Verified with `west build -b stm32mp135f_dk tests/crypto/crypto_hash`,
`west build -b nucleo_c562re tests/crypto/crypto_hash` and a generic
STM32H573 crypto hash test build.

Assisted-by: Claude:sonnet-5
Signed-off-by: bernard Puel <bernard.puel@st.com>
2026-09-23 10:35:20 +01:00
Benjamin Cabé
33adec4c88 drivers: adc: add missing userspace verifier for adc_get_decoder
adc_get_decoder() is declared __syscall but adc_handlers.c never
provided a verifier, so the syscall was not dispatched.

Add the verifier, guarded by CONFIG_ADC_STREAM to match z_impl. The
device is checked with K_SYSCALL_OBJ() rather than
K_SYSCALL_DRIVER_ADC() because get_decoder is optional and z_impl
tolerates a NULL callback. The out-parameter is checked with
K_SYSCALL_MEMORY_WRITE().

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-09-23 10:35:02 +01:00
Benjamin Cabé
d3c8b72744 drivers: pwm: do not copy out unset capture values on error
z_vrfy_pwm_capture_cycles() left its period/pulse locals uninitialized
and copied them out without consulting the return value.
z_impl_pwm_capture_cycles() leaves both untouched on all of its error
paths, so the values written back were not ones it had set.

Zero-initialize both locals and copy out only on success.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-09-23 10:34:49 +01:00
Benjamin Perseghetti
eab647e6a3 drivers: ethernet: nxp_enet_qos: pipeline the transmit DMA
The transmit DMA runs with a single beat burst length and completes
each frame, including its transmit status writeback, before touching
the next descriptor. Every frame then pays descriptor and data fetch
latency as dead time on the wire. Raise the burst length to 16 beats
and enable operate on second frame so the DMA prepares the next frame
while the current one transmits. Measured on MCXN947 at 100 Mbit full
duplex this moves a saturating UDP upload from 84.8 to 95.5 Mbps of
goodput, the theoretical maximum for the wire at that frame size.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-23 10:34:19 +01:00
Benjamin Perseghetti
bfef52e3fc drivers: ethernet: nxp_enet_qos: pipeline TX over a persistent ring
The transmit path holds one frame in flight and rebuilds the
descriptor list on every send, so the wire idles between frames and
loaded senders see -EBUSY drops. Drive the descriptors as the
persistent ring the hardware supports: program the ring length once,
stage each frame at the head, advance the tail pointer, and reclaim
completed frames in order from the interrupt. The transmit watchdog
guards the oldest outstanding frame, the carrier-loss abort reclaims
every outstanding frame after the queue flush, and each frame reads
its PTP timestamp from its own last descriptor.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
2026-09-23 10:34:19 +01:00
Muhammad Waleed Badar
2afc59f6d9 drivers: display: co5300: add SPI bus support
Add support for communicating with the CO5300 display controller over
SPI. Implement SPI command and framebuffer write functions and select
the appropriate transport configuration based on the Devicetree bus.

Also add the SPI Devicetree binding and select SPI automatically when a
CO5300 instance is connected to an SPI bus.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-23 10:31:50 +01:00
Muhammad Waleed Badar
baf982b412 drivers: display: co5300: remove use of framebuffer extra copy
Drop the co5300 driver's internal shadow framebuffer and the associated
even-coordinate/address alignment logic for the MIPI DSI write path.
co5300_mipi_dsi_adjust_coordinates() and its supporting framebuffer
allocation, placement, and alignment machinery (CO5300_FRAMEBUFFER_DECL,
addr_align, frame_ptr/frame_pitch, BUILD_ASSERTs) are removed, and
co5300_mipi_dsi_display_write() now writes directly from the caller-
supplied buffer using the caller's descriptor instead of a locally
adjusted one.

Move window-set and tearing-effect synchronization out of the per-bus
write callbacks (co5300_mipi_dsi_display_write/co5300_mspi_display_write)
and into the shared co5300_write() entry point, so both backends get
consistent handling without duplicating the logic.

Remove the now-unused pitch-align, addr-align, and ext-ram devicetree
properties from the chipone,co5300-mipi-dsi binding, and drop the
corresponding ext-ram/addr-align/pitch-align overlay properties from
the zc143ac72mipi shield.

Required alignment is now handled at the LVGL level instead: enable
LV_Z_AREA_X_ALIGNMENT_WIDTH and LV_Z_AREA_Y_ALIGNMENT_WIDTH (set to 2)
in the zc143ac72mipi shield's Kconfig.defconfig so LVGL rounds
invalidated areas to even boundaries before they reach the driver,
removing the need for the driver to compensate internally.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-23 10:31:50 +01:00
Muhammad Waleed Badar
bd41be62f6 drivers: display: co5300: configure color order with pixel format
Some CO5300 panel variants require the red and blue color channels to be
swapped. Configure the address mode together with the pixel format, as the
required RGB/BGR setting depends on the selected pixel format.

Use the red-blue-swap Devicetree property to select the appropriate color
channel order for each supported pixel format.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-23 10:31:50 +01:00
Muhammad Waleed Badar
c0894a9dca drivers: display: co5300: add support for mspi bus
Add support for driving the CO5300 display controller over the MSPI
bus in addition to the existing MIPI DSI backend. Bus-specific write
paths are now selected at build time via DT_ANY_INST_ON_BUS_STATUS_OKAY(),
with a common co5300_write() entry point dispatching to the appropriate
transfer function through the config->cmd_write/display_write callbacks.

Kconfig.co5300 now selects MIPI_DSI or MSPI depending on which bus
the enabled devicetree node is actually on.

Co-authored-by: Pavel Maloletkov <pavllick@gmail.com>
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-23 10:31:50 +01:00
Farsin Nasar V A
3f8d0f6c10 drivers: comparator: microchip: Update AC G1 driver
Update AC G1 driver implementation to support PIC32CM_JH

Signed-off-by: Farsin Nasar V A <farsin.nasarva@microchip.com>
2026-09-23 10:31:07 +01:00
Jianping Wu
497035c7bd soc: add soc support for gd32c2x1
Add soc support for gd32c2x1.

Signed-off-by: Jianping Wu <jianping.wu@gigadevice.com>
2026-09-23 10:30:12 +01:00
Kristian Angelov
f551c4969e sensors: xgzp68xxd: New driver
Adds support for the CFSensor XGZP68XXD family of pressure sensors

Signed-off-by: Kristian Angelov <kristiana2000@abv.bg>
2026-09-23 10:30:01 +01:00
Benjamin Cabé
d7535c17a0 drivers: adc: stm32: fix unused variable with PM_DEVICE
parent_config in adc_stm32_suspend_setup() is only used when an ADC
has an internal regulator or deep power-down mode, so series without
either (e.g. F4) fail to build with CONFIG_PM_DEVICE=y. Mark it
__maybe_unused.

Fixes a regression from commit 6d8da6d0a3 ("drivers: adc: stm32:
adapt driver to the new parent/child DT hierarchy").

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-22 13:50:32 -07:00
Johan Hedberg
700c57643a Bluetooth: HCI: ambiq: Do not close the transport mid-transfer
close() takes the controller down and aborts the receive thread with no
regard for an SPI transfer in progress. The receive thread holds
sem_spi_available for the duration of a transfer, and
k_thread_abort() does not give the semaphore back, so a close() that
lands in a transfer leaves it taken and the next send blocks forever.
Before that, the controller is put in reset and its clocks are turned
off with the transfer still in flight.

Hold the semaphore across both, so that close() waits for the transfer
in progress to finish before it touches the controller or the thread.
bt_apollo_controller_deinit() does no SPI transfer of its own, so it
cannot wait for the semaphore close() holds.

Holding the semaphore does not stop a send that is already under way,
though: the send path gives it back between its attempts, which it
repeats for up to five seconds, so that the receive path can drain the
controller in the meantime. The driver therefore keeps track of whether
the transport is open and of how often that has changed. open() and
close() update both while holding the semaphore, and the send path
gives up with -ENETDOWN if on getting the semaphore the transport is
closed or the count has moved on since the send began. The count is
what stops a send that slept through a close() and the open() after it
from delivering the old session's packet to the new one; the flag is
what stops a send that starts while close() is finishing. The count is
atomic because a send notes it before it has the semaphore: what
counts is the session the call began in, not the one in which it first
gets the semaphore. open() makes its update before the controller
initialization, which already sends through the same path.

A close() from the receive callback aborts the calling thread, which
never returns to give the semaphore back, so that case gives it back
before the abort.

Build-tested on apollo4p_blue_kxr_evb and apollo3_evb with the
peripheral_hr sample. Not run on hardware.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-09-22 18:04:29 +02:00
Johan Hedberg
e66b9c678e Bluetooth: HCI: ambiq: Configure the controller from open()
Send the vendor-specific NVDS configuration command from within open(),
through the HCI lockstep helper and the driver's own SPI send path,
instead of implementing the setup() driver API op on top of the Host's
bt_hci_cmd_send_sync(). The responses are consumed in the driver's
receive thread by feeding received packets to the lockstep helper
before they reach the host.

The command no longer depends on the Host, so the two code paths that
existed for it, one building the packet by hand for controller-only
builds and one going through the Host, collapse into one, and the
driver no longer selects BT_HCI_SETUP. The hand-built path was in fact
unreachable: bt_enable_raw() opens the driver without calling setup(),
so a controller-only build sent neither the NVDS command nor the reset
that follows it. Both now run there. A failing or unanswered command
fails open() with an error instead of failing the Host's HCI
initialization later, and is logged by the helper.

The reset that makes the NVDS parameters take effect is now sent in
every build. Only the controller-only path sent it before; builds with
a Host relied on the Host's own reset, which follows a few HCI
transactions later.

open() aborts the receive thread it started when the controller
initialization or the vendor command fails, so that a second
bt_enable() does not create a thread that is still running.

The raw send path is factored out of send() and takes the device, so
that it serves both the send() op and the helper.

Build-tested on apollo4p_blue_kxr_evb and apollo3_evb with the
peripheral_hr sample. Not run on hardware.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-09-22 18:02:46 +02:00
Holt Sun
a9e3d1ae54 drivers: counter: mcux_tpm: add capture support
Add support for the counter capture API to the MCUX TPM driver. The
driver stores capture callbacks per channel, maps Zephyr edge flags to
TPM input capture edges, enables the channel interrupt, and reports the
captured counter value from the TPM CnV register. Single-shot captures
disarm the channel from the ISR, continuous captures stay armed.

The ISR samples CnV before clearing CHF. Every selected edge latches
the counter into CnV, and the reference manual only guarantees that a
CHF interrupt is not lost across the clearing sequence, not that CnV
still holds the value the current interrupt was raised for.

Capture is mutually exclusive with alarms on the same channel because
both features share the counter channel namespace.

A TPM channel samples the signal present on its own TPMx_CHn pad, so
add optional pinctrl support and a counter-capture-cells specifier to
the binding. That lets a board mux the pad from devicetree and pick the
sampled channel without changing the public counter API.

A channel can alternatively capture from a trigger input rather than
from its pad, by setting TRIG[n] and routing TRGMUX to the TPM input
capture target. That would give a fully on-chip capture source, as
CTIMER has through INPUTMUX, but it needs a trgmux node that the MCXW7x
SoC devicetree does not have yet, so it is left for a follow-up. This
patch wires only the pad path and takes no mux subsystem dependency.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-09-22 18:00:41 +02:00
Holt Sun
787a8c5003 drivers: counter: mcux_tpm: add reset API support
Implement the counter_api reset callback for the NXP TPM counter
driver. Writing any value to the CNT register resets the counter to
its initial value while leaving the timer running.

Without this callback counter_reset() returns -ENOSYS, which the
shared counter test suites call unconditionally during setup.

Signed-off-by: Holt Sun <holt.sun@nxp.com>
2026-09-22 18:00:41 +02:00
Sylvio Alves
cb48d35de9 drivers: display: esp32: forward brightness to the panel
The controller only streams pixels and has no backlight of its
own, so a brightness request has nowhere to land and callers get
-ENOSYS even when the attached panel can set one.

Add the set_brightness callback and hand the value to the panel,
the same way blanking and orientation are already forwarded.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-22 17:57:58 +02:00
Sylvio Alves
25152c54fb drivers: display: let the esp32 dsi driver own no framebuffer
A caller that renders into its own full size frames has them scanned
out directly, so the driver framebuffers are never read. Every other
display driver accepts zero here; this one required at least one and
wasted a frame worth of external memory.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-22 17:57:58 +02:00
Sylvio Alves
36348ede1b drivers: display: esp32: hold the caller off a live frame
A caller that hands in its own full size frames rotates through
them, so the driver has to make it wait for the frame it is about
to reuse. The wait was gated on the driver owning more than one
framebuffer, which is not what decides it: the frames belong to
the caller. With one driver framebuffer the wait was skipped and
the next frame was drawn into one still being scanned out,
tearing the picture.

Drop the gate and give each adopted frame a link list item of its
own, so a flip never repoints the item the panel is reading. A
partial update waits the same way before it draws into the buffer
the previous frame left behind.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-22 17:57:58 +02:00
Guillaume Gautier
eaecfafc54 drivers: adc: stm32: rename macros that uses device tree values
Rename driver-specific dt macros for consistency. Prefix the macros with
ADC_STM32_ or ADC_SUB_STM32_, then depending if they use an inst or a
node_id: DT_INST_ or DT_.

Alos use inst as argument in DT_INST* macros instead of index and node_id
instead of node to be consistent with devicetree.h convention.

No functional change.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-22 17:56:13 +02:00
Guillaume Gautier
6d8da6d0a3 drivers: adc: stm32: adapt driver to the new parent/child DT hierarchy
Rework adc_stm32.c to consume the new two-level DT structure.

Config structures:
- adc_stm32_cfg (parent): now owns all shared/capability fields
  (clk_cfg, clk_prescaler, resolution table, sampling_time_table,
  sequencer_type, oversampler_type, internal_regulator,
  has_deep_powerdown, has_channel_preselection,
  has_differential_support, has_injected_support).
- adc_sub_stm32_cfg (child): reduced to instance-specific fields
  (base address, parent pointer, irq_cfg_func, clk_cfg for F1/F4,
  pcfg, differential_channels_used).
- Add adc_stm32_get_parent_cfg() helper to retrieve the parent config
  from a child device.

Move runtime accesses to shared DT properties from the child config to
the parent config, and keep only instance-local settings in the child
device configuration.

For series with shared IRQ lines, generate a single common ISR per
IRQn and elect one owner per IRQn using DT_DEP_ORD. Only the owner
node installs and enables the interrupt.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Assisted-by-AI: GitHub Copilot (GPT-5.4)
2026-09-22 17:56:13 +02:00
Guillaume Gautier
b1214ebe4f drivers: i2s: stm32_sai: use the newly defined dma macros
Instead of defining custom DMA macros in the SAI driver, use the generic
newly created ones from the DMA driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-22 17:56:13 +02:00
Guillaume Gautier
be2ca806d9 include: drivers: dma: stm32: remove slot argument from dma macro
The slot argument from macros STM32_DT_INST_DMA_SLOT* was useless.
With it the macro was basically a redefinition a the Zephyr macro.
It is now removed to be similar to other STM32 DMA macros that call
DT_INST_DMAS_CELL_BY_NAME.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-22 17:56:13 +02:00
Guillaume Gautier
89a0b76898 include: drivers: dma: stm32: rename macros with DT_INST for consistency
Typically Zephyr device tree macros that take a inst as argument
start with DT_INST_.
For the STM32 DMA driver we currently have several macros taking an inst as
argument but missing this prefix.
For consistency, it is added to these macros. The goal is to also define
DT_ variants of these macros that take a node_id as argument.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-22 17:56:13 +02:00
Guillaume Gautier
81d6f2c336 include: drivers: clock: stm32: rename macros with DT_ for consistency
Typically Zephyr device tree macros that take a node_id as argument
start with DT_ and those that take an inst start with DT_INST_.
For the STM32 clock driver we currently have two macros named
STM32_DT_INST_CLOCK_INFO_BY_NAME and STM32_CLOCK_INFO_BY_NAME.
For consistency, the latter is renamed STM32_DT_CLOCK_INFO_BY_NAME.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-22 17:56:13 +02:00
Guilherme Freire
6b11b8b4cc drivers: pwm: add driver for NXP's i.MX PWM block
The i.MX PWM block on the i.MX8M family had no Zephyr driver. The
existing `fsl,imx27-pwm` driver covers the same IP but is built on the
legacy device_imx.h HAL, which only supports i.MX6SX and i.MX7D.

Add a driver on top of the MCUX ipwm HAL, binding to `nxp,ipwm`. The
prescaler comes from devicetree and fixes the counter rate reported
by `pwm_get_cycles_per_sec()` polarity is mapped onto `PWMCR.POUTC`.

No interrupt is used, as a single PWMSAR write sustains the output.
`set_cycles()` only guards against a full sample FIFO, returning
`-EAGAIN` rather than blocking the caller. Changing the period or the
polarity stops the counter and drains the FIFO first, since queued
samples no longer match the new configuration.

Signed-off-by: Guilherme Freire <guilherme.almeida@toradex.com>
2026-09-22 17:55:56 +02:00
Guilherme Freire
49d9cbc1e3 drivers: clock_control: mcux_ccm: add i.MX8M PWM root clocks
The i.MX8M PWM instances are fed by their own CCM target roots, which
the CCM driver could not resolve: the existing `IMX_CCM_PWM_CLK`
identifier belongs to the FlexPWM block on i.MX RT and returns the IPG
frequency.

Add `IMX_CCM_PWM1_CLK..PWM4_CLK` under a separate peripheral ID and
resolve them from `PWMn_CLK_ROOT`, decoding the mux and applying the
pre- and post-dividers.
`EXT_CLK_1/EXT_CLK_2` are board inputs whose rate the SoC cannot
report, so they return `-ENOTSUP` rather than a guess.

Signed-off-by: Guilherme Freire <guilherme.almeida@toradex.com>
2026-09-22 17:55:56 +02:00
Fin Maaß
9bcce09eb7 drivers: interrupt_controller: riscv: aplic: improve aplic_init
aplic_init only directly calles aplic_msi_init or
aplic_direct_init, so we can set that function directly
as the init function.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-22 17:53:57 +02:00
Fin Maaß
722a11ebd0 drivers: interrupt_controller: riscv: aplic: return void
all these functions that are changed always
return 0, so change the return type to void,
as always returning 0 deliver no information.
Especially as the return value is already ignored
everywhere where these functions are used.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-22 17:53:57 +02:00
Fin Maaß
144137fed1 drivers: interrupt_controller: riscv: aplic: use asserts
use asserts for checks, as the irq configuration
comes from the devicetree and we don't need
that check in production, it should be enough
if it is checked in testing.

ALso most of these functions itself are used in
where the return value is quietly ignored, so
asserts actually help finding wrong configuration.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-22 17:53:57 +02:00
Fin Maaß
a7cc927ffb drivers: interrupt_controller: riscv: aplic: handle max_prio
if the prio is bigger than the max prio, use
the max prio as prio, just like we do in the
regular plic driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-22 17:53:57 +02:00
Mathieu Choplain
419a8c15d6 drivers: gpio: stm32: enable level-triggered interrupts on STM32WL3
The STM32WL3 series uses the same implementation as STM32WB0 series and
thus supports level-triggered interrupts. Enable the capability at
driver level by loosening the allowlist.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-22 10:31:38 +02:00
Gaurang Gunde
49c392538f drivers: eeprom: Add support for 9-bit addressing mode
The AT25040 EEPROM chip is 512 bytes and the way it accepts the 9th
address bit is via the opcode. The 8 address bytes can only address
256 bytes. To address 512 bytes, you need the 9th address bit or'd
into the opcode

Signed-off-by: Gaurang Gunde <ggunde@axon.com>
2026-09-22 10:28:12 +02:00
Fin Maaß
1a7dee4242 drivers: timer: arm_arch: start the counter before seeding the core
sys_clock_driver_init() seeded the timer core's announce baseline from
the counter and only then enabled the timer. QEMU's Cortex-A9 global
timer model reports the time since machine start while the timer is
disabled and restarts the count from zero once it is enabled, so the
baseline ended up ahead of the counter for the first few milliseconds
of the run. Every sys_clock_elapsed() in that window computed a wrapped
delta that clamps to UINT32_MAX ticks, so a timeout queued then was
placed about 2^32 ticks out and never expired. Which timeouts land in
the window depends on the boot timing, so an unrelated change in code
layout made tests/net/lib/mqtt_sn_client hang in its first test case
on qemu_cortex_a9.

Enable the timer before timer_core_init() so the baseline is taken from
the running counter, and keep the compare interrupt masked until the
core has armed the first deadline.

Assisted-by: Claude Fable 5.1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-22 10:26:50 +02:00
Paolo Bazzanella
995b3f3fa0 fix: renesas: flash: add missing semicolon
File was missing a semicolon, without which it didn't compile if
CONFIG_FLASH_RENESAS_RA_HP_CHECK_BEFORE_READING was set

Signed-off-by: Paolo Bazzanella <pbazzanella@qubicaamf.com>
2026-09-22 08:58:06 +03:00
Flavio Ceolin
c3ea409fc4 drivers: bbram: validate write range in the syscall handler
The write path wraps the same way: offset SIZE_MAX with size 1 passes the
offset + size check in every driver and corrupts the byte below the BBRAM
region. Run the same range check before the write is dispatched.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-09-22 08:58:03 +03:00
Flavio Ceolin
8438d3b9c1 drivers: bbram: validate read range in the syscall handler
A user thread picks both offset and size, and the drivers bound the access
with offset + size against the capacity, which wraps for large offsets and
lets the read land below the BBRAM region. Reject a range that does not fit
the device before the read is dispatched.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-09-22 08:58:03 +03:00
YunHung Hua
74cb3cc7cc drivers: usb_c: ps8xxx: check gpio_add_callback() return value
ps8xxx_init_work_cb() ignored the result of gpio_add_callback(). When
the alert callback cannot be registered, the driver goes on to mark the
TCPC as initialized. Nothing reports the failure, and once the alert
work stops finding pending alerts, no later alert is ever serviced.
Reported by Coverity as CID 487607.

Log the error and abort the initialization instead. The TCPC then stays
marked as not initialized, so tcpc_init() returns -EAGAIN and the
Type-C layer does not start. The rt1715 and fusb307 drivers handle the
same failure this way.

Build-tested only; the error path was not exercised on PS8xxx hardware.

Fixes #84769

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-22 08:57:58 +03:00
Abin Joseph
c2c5ef4b0c drivers: dma: Introduce Write only mode support for ADMA
Add Write-only mode where instead of copying from a real source, a
channel repeatedly writes a fixed pattern to the destination address.
Mode is selected via a new private channel_direction value
XILINX_ADMA_DIR_WRITE_ONLY.

Signed-off-by: Abin Joseph <abin.joseph@amd.com>
2026-09-22 08:57:47 +03:00
Jordan Yates
f721b93ccb modem: standalone: hl78xx: remove chat introspection
Remove usage of functions that query the state of `struct modem_chat`
from inside the callbacks. The required information is now available
directly from the callback arguments.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-09-22 08:57:31 +03:00
Jordan Yates
07f96d4a88 modem: chat: update modem_chat_script_callback params
Update the type definition of `modem_chat_script_callback` to take a
pointer to a context variable. This context variable holds additional
internal information about the script that the callback might be
interested in.

The goal is to remove any need for the callback itself to query internal
state of the `modem_chat`, because anything it needs it has already
been given. Eventually, this will lead to callbacks being able to queue
a new script directly from the callback of the previous script.

Breaking API change.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-09-22 08:57:31 +03:00
Daniel Schultz
976bd443d1 drivers: serial: uart_aesc: Get rate from clock controller
Read the input clock rate from the clock controller. Allow to
also define the clock rate via the device-tree.

Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
2026-09-22 08:57:27 +03:00
Daniel Schultz
39918fff2d drivers: clock_control: Add Aesc Silicon clock ctrl driver
Add a very basic clock control driver for the Aesc Silicon IP.
Right now, it's main purpose is to calculate the domain specific
frequency by reading the reference clock and the domain
multiplier/divider values.

Also update the v4.5 release notes and mention this new driver.

Signed-off-by: Daniel Schultz <dnltz@aesc-silicon.de>
2026-09-22 08:57:27 +03:00
Marouen Ghodhbane
d68a11c7d8 timer: cortex_m_systick: allow configurable SysTick interrupt priority
Introduce a Kconfig option to let users configure the SysTick interrupt
priority like any other hardware interrupt in the system.
This allows adjusting the SysTick priority to reduce latency impact on
higher-priority interrupts when needed.

Note that the timekeeping code in the Systick driver tolerates at most
one counter wrap between updates, so the tick must not be held off longer
than the wrap period. The minimum timeout is now a fixed 10 us budget
(SYSTICK_MIN_DELAY_US) converted to cycles at the actual clock rate and
floored at two cycles, with zephyr,min-timeout-cycles on the systick node
still overriding it. Lowering SysTick below other interrupts makes its
worst-case hold-off the nested run time of every higher-priority
interrupt, and any missed wrap silently drops a full last_load of uptime
with no diagnostic.

This 10 us budget is far tighter than the older tick-based floor, so
non-default priorities are safe ONLY while the worst-case hold-off stays
below the wrap period, and in practice **must** be paired with a larger
zephyr,min-timeout-cycles on the systick node.

The default priority preserves the current behavior of using the highest
maskable/kernel IRQ priority (_IRQ_PRIO_OFFSET).

Signed-off-by: Marouen Ghodhbane <marouen.ghodhbane@nxp.com>
2026-09-22 08:57:18 +03:00
Fabrice DJIATSA
b52f016a07 drivers: i2s: stm32_sai: restore GPDMA burst length
The U5 HAL programs the burst as (SrcBurstLength - 1U), so 0 underflows
and configures a 64 beat burst instead of a single one, making the SAI
DMA transfer fail on start. Set the burst length in the driver

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-09-21 16:28:35 -04:00
Mathieu Choplain
a1dbd5760e drivers: dma: stm32: v1/v2: fix dma_get_status() pending_length value
`pending_length` is supposed to be the "Pending length to be transferred
in bytes, HW specific", but the DMAC keeps track of a number of elements
remaning instead, and the driver returned this value verbatim.

Read the number of elements pending and multiply it by source data size
before returning it to comply with the API specification.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-21 16:28:13 -04:00
Jamie McCrae
1909f76910 kconfig: Correctly have EXPERIMENTAL prompt
Fixes various issues with Kconfigs, including:
  - Using the wrong indentation
  - Not having [EXPERIMENTAL] in the prompt, or not having it at
    the end
  - Wrongly stating the CONFIG_EXPERIMENTAL is needed to enable
    an experimental Kconfig

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-09-21 16:27:52 -04:00
Jamie McCrae
64d8dbe48b kconfig: Fix formatting, correctly select DEPRECATED and have prompt
Fixes various issues with Kconfigs, including:
  - Redundent `default n` on bools
  - Not select deprecated on supposed deprecated symbols
  - Using the wrong indentation
  - Not having [DEPRECATED] in the prompt, or not having it at the
    end

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-09-21 16:27:52 -04:00
Fin Maaß
ab18059f55 drivers: ethernet: phy: use mutex
use a mutex for the generic ethernet phy instead of a semaphore.
Benefit of the mutex is that it is recursive .

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-21 16:27:46 -04:00