Commit graph zephyr/drivers
Author SHA1 Message Date
Daniele Cloralio
d5a0172b94 drivers: video: gc2145: Return -ENOSYS for unsupported selection targets
Return -ENOSYS instead of -EINVAL for selection targets other than
VIDEO_SEL_TGT_CROP, since these operations are not implemented by
the driver.

This lets video_set_compose_format() proceed with format configuration
through set_format instead of aborting with -EINVAL.

Signed-off-by: Daniele Cloralio <d.cloralio@arduino.cc>
2026-09-23 19:18:13 +02:00
Hongquan Li
892da8e13a drivers: intc_gicv3_its: avoid sleep during early quiescence
Avoid k_msleep while ITS initializes in PRE_KERNEL_1. The system
clock and scheduler are not ready, so delayed quiescence can halt boot.

Use k_busy_wait for the existing one millisecond polling interval.
This retains the timeout behavior without a scheduler dependency.

Fixes #119809

Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
2026-09-23 19:17:53 +02:00
Jukka Rissanen
f1faf89e5a drivers: wifi: native_sim: Instantiate from devicetree
Make the native_sim Wi-Fi driver devicetree-instantiated and opt-in, and
take its MAC address from devicetree instead of Kconfig.

Previously CONFIG_WIFI_NATIVE_SIM defaulted to y for any ARCH_POSIX build
with the supplicant, so it was pulled into unrelated builds (e.g.
tests/net/wifi/wifi_nm and tests/net/wifi/configs). The fallback MAC was
chosen by Kconfig, and CONFIG_WIFI_NATIVE_SIM_SUPPLICANT_CONF_FILE was
dead (host_wifi_drv_init() ignored it now that only the Zephyr
supplicant runs).

Add a "zephyr,native-sim-wifi" binding (including ethernet-controller.yaml
for the MAC properties) with a required "host-interface" string, and
instantiate the driver with DT_INST_FOREACH_STATUS_OKAY /
ETH_NET_DEVICE_DT_INST_DEFINE. The driver now depends on
DT_HAS_ZEPHYR_NATIVE_SIM_WIFI_ENABLED, so it is built only when a node is
present - add one via an overlay to enable it.

The host interface name comes from the "host-interface" property and the
fallback MAC from "local-mac-address" / "zephyr,random-mac-address" (the
driver still overrides it with the host interface MAC at init). Remove
the WIFI_NATIVE_SIM_INTERFACE_COUNT, _DRV_NAME, _RANDOM_MAC, _MAC_ADDR
and _SUPPLICANT_CONF_FILE options and the now-unused config_file argument
of host_wifi_drv_init().

The interop test gains a native_sim.overlay defining the node
(host-interface = "zwifi", random MAC).

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-09-23 19:17:14 +02:00
Jukka Rissanen
f90db21f19 drivers: wifi: native_sim: Fix nl80211 connect command race
Connecting sometimes hung with an endless flood of
"nl80211: send_and_recv->nl_recvmsgs failed: -4 (Try again)". -4 is
libnl NLE_AGAIN: the non-blocking netlink socket has no data and
hostap's send_and_recv() busy-loops until the command's ACK arrives.

The host adapter runs two threads: the eloop thread (host_handler)
services the nl80211 event sockets, including bss->nl_connect, while the
Zephyr supplicant thread issued the authenticate/associate/deauthenticate
ops with send_and_recv() on that same bss->nl_connect socket. When a
connect command ran on the Zephyr thread while the eloop thread was also
reading bss->nl_connect, the eloop could consume the command's ACK,
leaving send_and_recv() spinning on NLE_AGAIN forever. It was
intermittent because it is a race over which thread reads the socket
first.

Run those three MLME commands on the thread that owns the netlink
sockets instead. A small command-handoff (cmd_fd/cmd_done_fd socketpair
plus pending_cmd) lets the Zephyr caller publish a request, wake the
eloop, and block until the eloop thread has executed the op; the
argument is passed by pointer since both threads share one address
space. With a single thread doing the netlink I/O there is no concurrent
reader to steal the ACK.

Only the bss->nl_connect commands are marshalled. Scan and the other
ops use global->nl, which the eloop does not service, so they are not
raced and stay on the Zephyr thread; moving the scan path onto the eloop
thread was observed to starve event processing and perturb scan timing.

Tested on native_sim against the net-tools mac80211_hwsim setup: the
interop test passes 5/5 across repeated runs and rapid connect/disconnect
cycles no longer produce the "Try again" flood.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-09-23 19:17:14 +02:00
Jukka Rissanen
2f5657502b drivers: wifi: native_sim: Add Wi-Fi driver using host nl80211
Add a Wi-Fi driver for the native_sim board so the Zephyr Wi-Fi stack
(network manager / wpa_supplicant, net_mgmt, the wifi shell) can be
exercised on the host against the Linux mac80211_hwsim simulated radio.
It is meant for development and verification of the Wi-Fi APIs, not as a
driver for any real hardware.

The Zephyr wpa_supplicant is the sole SME. The driver's host side brings
up only the Linux nl80211 driver (compiled for the native_simulator
runner) and runs its event loop in a thread; it does not run a second,
host-side supplicant. It provides its own wpa_supplicant_event() that
forwards nl80211 driver events (scan results, auth, assoc, deauth,
disassoc, mgmt rx) to the Zephyr supplicant over an in-process
socketpair, read by the interface RX thread and dispatched to the
supplicant callbacks. The supplicant driver ops (scan, authenticate,
associate, set_key, get_capa, ...) call the nl80211 ops table directly.
Data frames, including the EAPOL 4-way handshake, flow over an AF_PACKET
socket bound to the host interface and the Zephyr networking stack.

Notes on the host integration:
- The Zephyr interface adopts the host radio MAC address, so frames
  addressed to the associated STA are accepted by the Ethernet L2 and
  the frames it transmits are not rejected by the AP.
- control-port-over-nl80211 is disabled in the driver capabilities so the
  kernel delivers EAPOL as data frames to the supplicant's l2_packet.
- The interface uses carrier-up plus dormant, leaving dormant on
  association so the handshake can use the data path, and re-entering it
  on disconnect.
- A small supp_api hook lets the supplicant connect path notify this
  proxy driver; the connection itself is driven by the Zephyr SME.

Tested on native_sim with mac80211_hwsim: scan, connect (open and
WPA2-PSK), status, disconnect and data transfer all work.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-09-23 19:17:14 +02:00
Hubert Miś
dd3b6ef9d7 drivers: led: sct2024: add write_channels function
Add implementation of optional led driver API function named
write_channels. The purpose of this function is to allow the caller
update multiple channels in a single call.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
2026-09-23 19:16:30 +02:00
Filip Stojanovic
73fabfce8a drivers: mspi: stm32: ospi: fix 24-bit address check
mspi_stm32_ospi_hal_address_size() returns HAL_OSPI_ADDRESS_* values,
but mspi_stm32_ospi_access() compares it against
HAL_XSPI_ADDRESS_24_BITS, which only exists in the XSPI HAL. This
breaks the build on STM32H7 (e.g. stm32h735g_disco with
samples/drivers/mspi/mspi_flash). Use HAL_OSPI_ADDRESS_24_BITS
instead.

Signed-off-by: Filip Stojanovic <filipembedded@gmail.com>
2026-09-23 19:15:56 +02:00
Mathieu Choplain
a2af5ceb51 drivers: entropy: stm32: make get_entropy_isr() re-entrant
The current `get_entropy_isr()` implementation is not re-entrant and has
in fact a very high chance of deadlocking because the logic that checks
if we should disable the RNG after generating entropy is inverted: the
RNG is considered as "acquired" for ISR polling when its interrupt is
ENABLED but get_entropy_isr() DISABLES the IRQ line...

Inverting the logic seems like it can fix the problem but it would still
be flawed: the sole information of whether IRQs are enabled or not isn't
sufficient to handle all cases.

Associate the RNG being enabled to a usage count (protected by spinlock)
to ensure that the RNG is enabled atomically, and we never disable it
from a high-priority ISR while a lower priority ISR was polling for
random bytes. This allows get_entropy_isr() to work re-entrantly with
a few modifications to the routine.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-23 19:15:15 +02:00
Henrik Brix Andersen
e301f0bee8 Revert "drivers: ethernet: sam_gmac: update config for phy-connection-type"
This reverts commit af9951f3b6.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-09-23 14:35:19 +02:00
Henrik Brix Andersen
3b52e49daa Revert "drivers: ethernet: sam_gmac: obtain MCK rate at runtime for SAMA7 SoCs"
This reverts commit 9d8edaa42d.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-09-23 14:35:19 +02:00
Chaitanya Tata
32f83075d1 drivers: wifi: nrf_wifi: Mark nRF70 driver as supported
The driver selected EXPERIMENTAL only for a subset of host SoCs. A
Kconfig symbol's maturity is a property of the whole driver, it cannot
be experimental on one SoC and supported on another. Drop the
conditional select and mark the nRF70 driver supported everywhere.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
2026-09-23 10:52:18 +01:00
Aksel Skauge Mellbye
c05bfdea59 drivers: adc: silabs: Add SAR ADC driver for Series 3
Implement driver for the ADC in Silicon Labs Series 3 SoCs.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-09-23 10:51:34 +01:00
Johan Hedberg
748dc62920 drivers: bluetooth: hci_da1469x: Build close() without the Host
close() has been compiled only with CONFIG_BT_HCI_HOST since the driver
was added, while the driver API table has always referenced it
unconditionally, so a build of this driver without the Bluetooth Host
fails with "'bt_da1469x_close' undeclared". The function disables the
CMAC interrupt and the CMAC core and uses nothing of the Host, so drop
the guard.

Compile-tested for da1469x_dk_pro: the driver object in a
CONFIG_BT_HCI_RAW configuration, which failed before, and 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-23 10:51:10 +01:00
YunHung Hua
435d639fff drivers: usb_c: ps8xxx: check alert GPIO setup results
ps8xxx_init_work_cb() ignores the results of gpio_pin_configure_dt() and
gpio_pin_interrupt_configure_dt() for the alert pin. If either fails,
the TCPC is still marked initialized and no alert is ever delivered.

Log the error and abort initialization, so tcpc_init() keeps returning
-EAGAIN, the same way the rt1715 and fusb307 drivers do.

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-23 10:50:22 +01:00
Tony Han
9d8edaa42d drivers: ethernet: sam_gmac: obtain MCK rate at runtime for SAMA7 SoCs
Adding code for obtaining the clock rate of MCK at runtime for Microchip
SAMA7 SoCs.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-09-23 10:49:54 +01:00
Tony Han
af9951f3b6 drivers: ethernet: sam_gmac: update config for phy-connection-type
Update configutations for phy-connection-type for the following:

SAMA7G5 GMAC_UR_MIM:
  Value |  Name  | Description
  ------|--------|----------------------------------------------
    0   |  MII   | Selects MII mode when GMAC_NCR.MIIONRGMII=1.
    1   |  RMII  | Selects RMII mode when GMAC_NCR.MIIONRGMII=0.
    2   |  RGMII | Selects RGMII mode when GMAC_NCR.MIIONRGMII=0.

SAMA7D6 & SAM9X7 GMAC_UR_MIM:
  Value |  Name  | Description
  ------|--------|--------------------
    0   |  -     | Reserved
    1   |  RMII  | Selects RMII mode.
    2   |  RGMII | Selects RGMII mode.

SAMA5D2 GMAC_UR_RMII:
  Value | Description
  ------|--------------------------------
    0   | MII mode is selected (default).
    1   | RMII mode is selected.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-09-23 10:49:54 +01:00
YunHung Hua
6a5ca44762 drivers: usb_c: fusb307: configure the VCONN discharge GPIO as output
The optional vconn-disc-gpios pin is driven with gpio_pin_set_dt() to
switch the external VCONN discharge path, but the driver never
configures it. The pin stays in its reset state, usually an input, so
setting it has no effect on the pin, and a GPIO_ACTIVE_LOW flag from
devicetree is not applied either, because gpio_pin_configure_dt() is
what records it.

Configure the pin as an inactive output at init when it is defined,
the same way ucpd_numaker.c handles its discharge pins.

Build-tested only; not exercised on FUSB307 hardware.

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-23 10:49:22 +01:00
YunHung Hua
921df89f63 drivers: usb_c: fusb307: check alert GPIO setup results
fusb307_init_work_cb() ignores the results of gpio_pin_configure_dt()
and gpio_pin_interrupt_configure_dt() for the alert pin. If either
call fails, for example because the interrupt line is already in use,
the driver still marks the TCPC as initialized and no alert is ever
delivered.

Log the error and abort the initialization instead, as is already done
when gpio_add_callback() fails. The TCPC then stays marked as not
initialized, so tcpc_init() returns -EAGAIN.

Build-tested only; the error paths were not exercised on FUSB307
hardware.

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-23 10:49:22 +01:00
YunHung Hua
bf70f7ba18 drivers: usb_c: rt1715: configure the VCONN GPIOs as outputs
The optional vconn-ctrl-gpios and vconn-disc-gpios pins are driven with
gpio_pin_set_dt() to switch the external VCONN supply and discharge
path, but the driver never configures them. The pins stay in their
reset state, usually an input, so setting them has no effect on the
pin, and a GPIO_ACTIVE_LOW flag from devicetree is not applied either,
because gpio_pin_configure_dt() is what records it.

Configure both pins as inactive outputs at init when they are defined,
the same way ucpd_numaker.c handles its discharge pins.

Build-tested only; not exercised on RT1715 hardware.

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-23 10:48:55 +01:00
YunHung Hua
0a067bd1ba drivers: usb_c: rt1715: check alert GPIO setup results
rt1715_init_work_cb() ignores the results of gpio_pin_configure_dt()
and gpio_pin_interrupt_configure_dt() for the alert pin. If either
call fails, for example because the interrupt line is already in use,
the driver still marks the TCPC as initialized and no alert is ever
delivered.

Log the error and abort the initialization instead, as is already done
when gpio_add_callback() fails. The TCPC then stays marked as not
initialized, so tcpc_init() returns -EAGAIN.

Build-tested only; the error paths were not exercised on RT1715
hardware.

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-23 10:48:55 +01:00
Hsiu-Chi Tsai
7542ac4b2d drivers: dma: rpi_pico: give each channel its own interrupt status
err is declared once outside the loop that walks the pending channels,
and the path without an error flag never clears it. When one interrupt
has several channels pending and a lower-numbered one carries an error,
every higher-numbered channel handled in the same pass gets that -EIO
in its callback although its own transfer succeeded.

The hardware keeps the error flags per channel, and the other drivers
that share one interrupt across channels compute the status inside the
loop: dma_silabs_ldma sets it per channel, dma_sam_xdmac reads its own
error register for each one.

The MIPI DBI PIO driver runs up to four channels on one device for its
split configurations, which is where this is reachable.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-09-23 10:48:33 +01:00
Hsiu-Chi Tsai
6666f9b7e0 drivers: mipi_dbi: rpi_pico_pio: queue the DMA status, not the channel
The message queue holds the result of a transfer: the PIO completion
handler puts a zero in it, and mipi_dbi_pico_pio_start_wait_reset_sm()
returns whatever it reads back. The DMA handler puts the channel number
there instead when status is negative.

An error on channel 0 is therefore delivered as 0 and the write reports
success. Channels come from dma_claim_unused_channel(), which hands out
the lowest free one, so channel 0 is the likely one for the first split.
Any other channel returns a positive number where the API expects a
negative errno.

The loop above already identifies which split owns the channel, so the
number itself is not needed in the message.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-09-23 10:47:19 +01:00
Hsiu-Chi Tsai
8966916369 drivers: mipi_dbi: rpi_pico_pio: initialise the transfer mutex
mipi_dbi_pico_pio_write_helper() locks data->lock, but nothing calls
k_mutex_init() on it and the instance data is a zero-filled static
struct, so the wait queue is never set up.

An uncontended lock and unlock survive that: a zeroed wait queue does
not read as empty, peek returns NULL, and the unpend guards on it. The
first thread that blocks reaches sys_dlist_append(), which writes
through a NULL tail. Single-threaded use is why this has held so far.

It goes at the top, before the GPIO configuration that can return
early. mipi_dbi_spi.c and mipi_dbi_bitbang.c both initialise their own
lock the same way, the latter since 115854.

Signed-off-by: Hsiu-Chi Tsai <hctsai@linux.com>
2026-09-23 10:47:19 +01:00
Xiaolu Sun
628c432817 drivers: i2c_sedi: Fix buffer use-after-return after timeout
When an asynchronous transfer times out, its completion callback can
give the semaphore before the abort path disables interrupts. This
leaves a stale completion token that a subsequent transfer can consume,
allowing it to return while the controller is still using the caller's
buffer. If the buffer is stack-allocated, this can cause a
use-after-return.

Reset the completion semaphore and error state after aborting the
failed transfer, while still holding the transfer mutex. This discards
any completion notification that raced with the timeout and ensures
the next transfer waits for its own completion.

Signed-off-by: Xiaolu Sun <xiaolu.sun@intel.com>
2026-09-23 10:46:59 +01:00
Silesh C V
88be48dcac drivers: clock_control: alif: add S32K and 128K parent clocks
Alif SoCs feed some peripherals from two clocks in the always-on power
domain (PD-0) that the driver cannot describe today: S32K_CLK and
128K_CLK. Add parent identifiers for both and describe them in
devicetree.

S32K_CLK is the output of the ANA MISC_CTRL[SEL_32K] multiplexer, which
runs it from either the LFRC or the LFXO oscillator. Describe the two
oscillators as fixed clocks and the multiplexer output as a node
switched to one of them, so that the rate follows the selection instead
of being restated as a literal. SEL_32K is configured outside Zephyr
today. The bit resets to the LFRC, which is what the multiplexer node
records. A board or application which needs to select the LFXO instead
has to repoint the node at it.

128K_CLK is derived from the LFRC rather than being an independent
oscillator and runs at four times its rate, so it is described as a
fixed factor of that node.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Silesh C V <silesh@alifsemi.com>
2026-09-23 10:46:26 +01:00
Silesh C V
c878e62700 drivers: clock_control: alif: program the mux for gateless clocks
alif_clock_control_on() returned early whenever the encoded clock ID
carries no enable bit, which happens before the block that programs the
clock source mux. A clock that is always on but still has a selectable
source was therefore left on whatever source the reset value or the boot
firmware selected.

The enable control and the source control are independent in the clock
ID encoding and either may be absent. Program the source whenever the
encoding describes a mux, enable the clock only when the encoding
describes an enable bit, and take the early exit only when the clock has
neither.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Silesh C V <silesh@alifsemi.com>
2026-09-23 10:46:26 +01:00
Tim Pambor
090adcfd0b drivers: ethernet: mchp_gmac_g1: remove invalid vendor statistics access
eth_mchp_get_stats() accesses the vendor member of struct net_stats_eth
as an embedded structure, but it is a pointer to an array of key-value
pairs. The driver fails to build with
CONFIG_NET_STATISTICS_ETHERNET_VENDOR=y.

The driver provides no vendor statistics and the pointer is already
NULL because the device data is zero-initialized, so remove the block.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-23 10:45:51 +01:00
Tim Pambor
f2e4ac9db3 drivers: ethernet: adin2111: remove unused variable in port send
adin2111_port_send() declares the port data pointer when
CONFIG_NET_STATISTICS_ETHERNET is enabled, but nothing uses it since
commit 18c00a714f ("drivers: ethernet: remove redundant tx stats").
Building the driver with Ethernet statistics enabled fails with
-Werror=unused-variable.

Remove the variable.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-23 10:45:51 +01:00
Johan Hedberg
cbe92bf15e Bluetooth: HCI: Provide the public address to drivers before open()
Store the public identity address that the Host hands to the driver's
setup() op also in the common HCI driver data, through the new
bt_hci_set_public_addr() API, before the HCI transport is opened. The
driver reads it with bt_hci_get_public_addr() and can apply it during
open(), i.e. from vendor-specific initialization that does not depend
on the Host's command APIs being available.

bt_hci_get_public_addr() returns BT_ADDR_ANY while no public address
has been set, which is what setup() receives in that case, so a driver
moving from one to the other keeps the check it has, and driver data
that has never been written needs no flag to say so. BT_ADDR_NONE is
the name that suggests itself for this, so the choice is spelled out
where a driver author looks: on both functions, with the check a driver
is expected to make, on the field, on the setup() parameter, which did
not document its value until now, and in the Kconfig help. The test
pins the value.

The channel is set on every bt_enable() and cleared when there is no
public identity, so that an address an earlier enable left behind is
not applied to the controller by a later one.

The setup() path keeps receiving the address as before; both channels
coexist until the drivers implementing setup() have migrated. So that
enabling the new channel no longer pulls in the mechanism it replaces,
BT_HCI_SET_PUBLIC_ADDR stops selecting BT_HCI_SETUP; the drivers that
apply the address in setup() (BlueNRG ACI, STM32WBA, CYW208XX) now
select BT_HCI_SETUP themselves, matching the conditions their setup()
implementations are compiled under.

Both functions are declared unconditionally, as coding guideline rule
A.1 requires of a header, so that their callers can select on the
option with IS_ENABLED() rather than the preprocessor, and defined in
a source file that is compiled only when the option is enabled, so
that a call that is not guarded fails to link rather than quietly
doing nothing. Only the field they work on is conditional, so a driver
that does not announce the capability pays nothing for it.

The driver API group version goes to 0.3.0 for the two functions added
to it.

The host identity test gains a scenario that creates a public identity
before bt_enable() and checks what the driver is handed while the
transport is opened, including that an enable without a public identity
hands it nothing rather than what the previous one left. The scenario
enables the capability through a prompt the test adds to it, since the
option is otherwise selected by drivers only. Its fake driver gains a
close() op, which the test needs in order to cycle the transport.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-09-23 10:45:13 +01:00
Muhammad Waleed Badar
6a281447f9 drivers: usb: uhc_dwc2: fix cache maintenance on translated DMA addr
Cache maintenance was being done on the DMA address after
uhc_dwc2_quirk_dma_addr_xlate() translated it, which is not
CPU-visible on some platforms and causes a data abort. Move
cache maintenance before the translation in ch_process_control(),
ch_start_control(), and ch_start_bulk().

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-23 10:43:40 +01:00
Muhammad Waleed Badar
da58a09420 drivers: usb: uhc_dwc2: fix dma_addr type mismatch in cache calls
dma_addr is an integer type, not a pointer, so comparing it
against NULL and passing it directly to sys_cache_data_invd_range()
/sys_cache_data_flush_range() was incorrect.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-09-23 10:43:40 +01:00
Johan Hedberg
d1a597400d Bluetooth: HCI: psoc6_bless: Set the public address from open()
Send the vendor-specific set-public-address command from within open(),
through the HCI lockstep helper and the driver's own send path, instead
of implementing the setup() driver API op on top of the Host's
bt_hci_cmd_send_sync(). The response is consumed in the driver's event
handler by feeding received packets to the lockstep helper before
delivering them to the host.

The driver no longer calls any Host command API, so the address is now
also configured in controller-only builds, where bt_enable_raw() only
opens the driver and never called setup(), and it no longer selects
BT_HCI_SETUP. 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.

open() aborts the receive thread it started when the 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. It now reports a
failed Cy_BLE_SoftHciSendAppPkt() to its caller instead of logging and
returning success, which the helper needs in order to tell a command
that was not submitted from one that went unanswered.

Build-tested on cy8cproto_063_ble 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-23 10:43:25 +01:00
Thomas Chiantia
1a0e0ab809 drivers: gpio: sam0: add drive strength flag
Add SAM0_GPIO_DRIVE_STRONG, a SAM0 specific GPIO devicetree flag that
sets PORT PINCFG.DRVSTR on pins configured as outputs.

gpio_sam0_config() rebuilds PINCFG from zero on every call, so a drive
strength selected through pinctrl is cleared as soon as the pin is
configured through the GPIO API. Carrying it on the gpios specifier
selects the stronger driver where the pin is declared, alongside the
existing SAM0_GPIO_DEBOUNCE.

On SAM D5x/E5x this raises the rated output current from 2 mA to 8 mA
at VDD >= 3.0 V (DS60001507, Table 54-13).

Assisted-by: Claude:claude-opus-5
Signed-off-by: Thomas Chiantia <thomas.chiantia@proton.me>
2026-09-23 10:43:07 +01:00
Camille BAUD
95995e52c6 drivers: gpios: bflb: Gate RC32K mux changes correctly
The specific combination only applies for the BL61x

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-09-23 10:42:16 +01:00
Camille BAUD
ddb2efa68f drivers: gpios: bflb: Allow both input and output at the same time
Allow both input and output modes at the same time.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-09-23 10:42:16 +01:00
Tim Pambor
6390b4fe03 drivers: ethernet: dwc_mac: nxp: add support for the S32K3 series
The NXP S32K3 series integrates the same DWC Ethernet QoS controller as
the MCXE31x, with the same interrupt lines and clock domains and without
a reset line, but is described by the nxp,s32-gmac compatible and uses
the RTD HAL headers. Extend the driver to also support the S32K3 series.

The NXP S32 GMAC driver does not support PTP, so use the dwc_mac driver
by default on S32K3 if PTP support is required.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-23 10:41:20 +01:00
Tim Pambor
dd6b971aac drivers: clock_control: nxp_s32: attach the EMAC clock muxes
The receive, transmit and timestamp clocks of the S32K3 EMAC each come
from an MC_CGM mux that has to be switched to the right source before
the MAC leaves reset. The driver can only gate clocks and the boot clock
configuration leaves these muxes on FIRC, so the EMAC cannot be clocked
through clock control.

When the EMAC node is enabled, turning on one of the EMAC0 RX, TX or TS
gates now first switches the mux of that domain and sets its divider:

- RX and TX take the clocks the PHY drives into the pads: the 50 MHz
  reference divided by 2 for RMII, or the separate 25 MHz clocks for
  MII, following the phy-connection-type of the EMAC node.
- TS takes PLL_PHI0 undivided. It is locked to the crystal, keeps
  running regardless of the PHY and the link speed, and satisfies the
  self-test of the EMAC timestamp memory, which needs at least 1.5 times
  AIPS_SLOW_CLK, more than the PHY clocks provide. MCX N and MCX A feed
  their timestamp clock from a crystal-locked PLL as well.

The HAL has no call to switch a single mux, so this goes through
Clock_Ip_Init() with a configuration holding only that mux and divider.

Turning the gates off and reading clock rates are unchanged, and the
NXP S32 GMAC driver, which does not use these gates, is not affected.

The RX and TX handling mirrors the same EMAC on the MCXE31x in the
MC_CGM driver.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-23 10:41:20 +01:00
Tim Pambor
d96f79487e drivers: ethernet: mdio: nxp_s32_gmac: depend on ETH_NXP_S32_GMAC
The NXP S32 GMAC MDIO driver was tied to the SoC family, so it was
enabled on any S32 SoC with a snps,dwmac-mdio node regardless of the
Ethernet driver in use. Depend on ETH_NXP_S32_GMAC instead, so the MDIO
driver is only built together with the S32 GMAC Ethernet driver and is
left out when the generic dwc_mac driver is selected, which brings its
own driver for the same node.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-23 10:41:20 +01:00
Benjamin Cabé
995439cfc0 drivers: clock_control: renesas_ra: pick the CPU clock by node
The RA8x1 cpu@0 node carries cpu-power-states but has no label, so
DT_NODELABEL(cpu0) does not resolve and the CPU power states are
invisible on ek_ra8m1, ek_ra8d1, fpb_ra8e1 and mck_ra8t1. Labelling it
alone would make the CGC driver select cpuclk0, which only the dual-core
RA8x2 parts define, so test the single-core cpuclk node before the
cpu0/cpu1 discrimination and add the label in the same commit.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-09-23 10:40:37 +01:00
Zhaoxiang Jin
991206c1a5 west.yml: update hal nxp to SDK 26.09.00-rc1
update hal nxp to SDK 26.09.00-rc1

SDK 26.09 renames the core#1 divider field of MCXW70's
scg_sys_clk_config_t from divPlat to divCore1, pairing it with the
existing divCore for core#0. The bit position and meaning are unchanged,
so follow the rename in clock_control_nxp_mcxw7x.c to keep the SoC
building. The devicetree property stays sys-clk-div-plat.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-09-23 10:39:55 +01:00
Benjamin Cabé
96a816ccd1 drivers: usb: uhc_dwc2: reserve event bits for every host channel
Each channel gets an event bit at UHC_DWC2_EVENT_PORT_PEND_CHANNEL plus
its index, so the enumerator has to be last. It sat in the middle, and on
a controller with several channels those bits collided with the suspend,
resume and dequeue events. Found on an STM32N6570-DK, which has 16.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-23 10:38:24 +01:00
Sylvio Alves
67d593d034 net: wifi: utils: Add a frequency to channel conversion helper
wifi_shell.c carried a private wifi_freq_to_channel() and the
hwsim driver open coded the same conversion twice, as a plain
(freq - 2407) / 5. Neither matches wifi_utils_chan_to_freq() at
channel 14: 2484 MHz maps back to channel 15, which has no
frequency, so a radio set up from a frequency alone ends up off
the medium.

Add wifi_utils_freq_to_chan() as the inverse of the forward
helper. A candidate channel is only returned once it converts
back to the frequency asked for, so the two directions cannot
drift and a frequency between two channel centers is rejected.
No band argument is needed because a center frequency is unique
across the bands. Drop the shell copy and use the helper in both
places.

The shell copy resolved neither the 5 GHz channels 32, 68 and 96
nor any 6 GHz channel, and printed the raw frequency in the
channel column for those. They now resolve, and a frequency that
belongs to no channel prints as 0 rather than as itself.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-23 10:38:13 +01:00
Sylvio Alves
c5184d9b9c drivers: wifi: bflb: Use the channel to frequency helper
Replace the local 2.4 GHz channel to frequency macros with
wifi_utils_chan_to_freq(). The remaining conversions in this
driver go through the vendor HAL and are left alone.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-23 10:38:13 +01:00
Sylvio Alves
8fdeafd46d drivers: wifi: airoc: Use the channel to frequency helper
Drop the two local mhz_from_2g_channel() and
mhz_from_5g_channel() helpers in favour of
wifi_utils_chan_to_freq(), so the band tables are built from the
same conversion as the rest of the tree.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-23 10:38:13 +01:00
Sylvio Alves
33ae670a3b drivers: wifi: siwx91x: Use the channel to frequency helper
Replace the open coded channel to frequency conversion with
wifi_utils_chan_to_freq().

The old code clamped every frequency above 2472 MHz to 2484 MHz,
so a channel beyond 14 was reported as channel 14. The helper
returns 0 for a channel that is not valid in the band, and such a
channel is now left out of the reported list instead of being
emitted with a zero center frequency.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-23 10:38:13 +01:00
Sylvio Alves
7d1095411f drivers: wifi: hwsim: Use the channel to frequency helper
Replace the open coded 2.4 GHz channel to frequency arithmetic,
which was spread over a macro in one file and five separate
expressions in the others, with wifi_utils_chan_to_freq().

None of the copies handled channel 14, so they reported it as
2477 MHz instead of 2484 MHz. The base frequency define stays for
the two frequency to channel conversions in wifi_hwsim_supp.c,
which a later commit converts as well.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-23 10:38:13 +01:00
Konstantinos Papadopoulos
89f428a2e0 drivers: gnss: u-blox: fix gnss warm/cold start for F9P & M10 drivers
When gnss start/stop api first implemented, wrong reset type was set
in driver implementation for warm and cold start operations,  causing
unwanted loss of RAM/BBR CFG layers.

Signed-off-by: Konstantinos Papadopoulos <kostas.papadopulos@gmail.com>
2026-09-23 10:37:55 +01:00
Sergiy Kibrik
032166627b drivers: xen: add xen_flask_op hypercall wrappers
This set of subops is used to access and modify some parameters of
FLASK security server and access vector cache.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
2026-09-23 10:36:28 +01:00
Camille BAUD
ad44a35053 drivers: adc: bflb: Handle sample count correctly and misc fixes
Handle sample count correctly by using 'extra_samplings'

Add a timeout to sampling

Misra quality

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-09-23 10:36:06 +01:00
bernard Puel
ee6a49f824 drivers: crypto: add SHA-3 support
Add SHA3-224/256/384/512 support to the public hash API and to the
STM32MP13 HASH driver, on top of the existing SHA-2 polling/interrupt
paths added previously.

- include/zephyr/crypto/hash.h: add CRYPTO_HASH_ALGO_SHA3_{224,256,
  384,512} to enum hash_algo.
- drivers/crypto/crypto_stm32_hash.c: dispatch the four SHA-3 variants
  through both the polling (HAL_HASHEx_SHA3_xxx_Start()) and interrupt
  (HAL_HASHEx_SHA3_xxx_Start_IT()) HAL entry points, gated by a new
  STM32_HASH_USE_SHA3 macro defined whenever the devicetree node
  advertises st,has-sha3-algorithm. DT_DRV_COMPAT and the new macro
  are now defined ahead of the "crypto_stm32_hash_priv.h" include so
  the private header can see STM32_HASH_USE_SHA3.
- drivers/crypto/crypto_stm32_hash_priv.h: size
  STM32_HASH_MAX_DIGEST_SIZE from STM32_HASH_USE_SHA3, keeping it at
  32 bytes (SHA-256) on nodes without SHA-3 support and growing it to
  64 bytes (SHA3-512) only where needed.
- drivers/crypto/crypto_mbedtls_shim.c: map the new enum values to the
  corresponding PSA_ALG_SHA3_xxx algorithms in the mbedTLS software
  shim. Also fix mbedtls_hash_session_setup() to return -ENOTSUP
  (instead of -EINVAL) for an unrecognized/disabled algorithm,
  matching the convention already used by every other hash driver
  (stm32_hash, esp32_sha, ...) so that ztest's "skip on -ENOTSUP"
  pattern works uniformly regardless of which PSA_WANT_ALG_* bits
  happen to be enabled.
- drivers/crypto/Kconfig: imply PSA_WANT_ALG_SHA3_{224,256,384,512}
  from CONFIG_CRYPTO_MBEDTLS_SHIM, so all four SHA-3 variants are
  exercised through the software shim the same way the SHA-2 family
  already is.

Verified with `west build -b stm32mp135f_dk tests/crypto/crypto_hash`
(hardware and mbedTLS-shim variants) and a stm32h573i_dk build (no
SHA-3 HW, compiles fine and exercises the -ENOTSUP skip path).

Assisted-by: Claude:sonnet-5
Signed-off-by: bernard Puel <bernard.puel@st.com>
2026-09-23 10:35:20 +01:00