split the checksum Kconfigs into a user
changable Kconfig and a hidden one, that
will have the combined status, which we
then use in the driver. That way we don't
include the checksum offloading stuff,
when we don't need it.
Signed-off-by: Fin Maaß <info@finmaass.de>
as net_pkt_frag_ref, will not only unref
the current net buf but also all net bufs
after it, we are now keeping the reference of the
net_pkt.
This will also make it easier to add ptp support later,
because there we need the net_pkt at that point.
the ptp code btw also uses a k_fifo for it.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
rename REG_READ/WRITE to DWMAC_REG_READ/WRITE,
so we don't have conflicts, like we got on the esp32.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add a spinlock-protected `enabled` flag to the driver data struct to
eliminate the race between wdt_nrf_gswdt_disable() and
wdt_nrf_gswdt_feed(). The spinlock is held across both the state check
and mbox_send_dt() in the feed path, and across the flag update in the
setup and disable paths, ensuring a consistent view of the enabled
state. Sending feed when wdt was not enabled would cause watchdog
to start counting down the timeout.
Signed-off-by: Łukasz Stępnicki <lukasz.stepnicki@nordicsemi.no>
Wi-Fi driver for ST67W611M1 coprocessor.
It communicates with an SPI interface and depends on Zephyr's own
TCP/IP stack.
Communication with host is a mix of AT commands (scan, connect,...)
and raw L2 layer data frames.
Signed-off-by: Eliott Speyser <eliott.speyser@st.com>
Make AF_PACKET SO_TIMESTAMPING reporting depend only on
net_pkt_is_rx_timestamping(). This removes the timestamp-value heuristic
and makes the RX timestamp marker the single source of truth for whether
packet timestamp control data is valid.
Update in-tree Ethernet drivers that store RX timestamps to set the marker
before handing packets to the stack, and document the migration requirement
for out-of-tree drivers. Keep test coverage for the unmarked-packet case so
unmarked timestamps are not reported to socket applications.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
The STM32 HAL keeps the last RX timestamp in its RX descriptor list. If a
later packet has no RX timestamp context descriptor,
HAL_ETH_PTP_GetRxTimestamp() can return the previously cached value and
make Zephyr mark the packet as timestamped with stale data.
Poison the HAL RX timestamp cache before HAL_ETH_ReadData() and only accept
the timestamp if the HAL refreshes it with a non-sentinel value for the
packet currently being processed. This bases timestamp validity on
descriptor state instead of PHC age, which can falsely reject valid
timestamps when RX handling is delayed under heavy traffic.
PTP timestamping can consume an additional RX context descriptor on
STM32H5, so make the RX descriptor count configurable there and default it
to 8 when the STM32 PTP clock is enabled. Also select no-cache memory for
STM32 Ethernet whenever the architecture supports it.
Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
We don't want to reinitialise the clock control when
we boot the second core - so this commit introduces a
means to skip initialisation (i.e. assume it is already
initialised). This hidden Kconfig symbol will be set
when running from CPU1 when AMP on the rp2350 is
implemented.
Co-authored-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Dan Collins <dan@collinsnz.com>
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Signed-off-by: Andrew Fantino <fantino@qti.qualcomm.com>
XIP in Zephyr is a software configuration concept (CONFIG_XIP). The MSPI
feature gated by MSPI_XIP only memory-maps the device into the SoC
address space; the mapped region can be used for plain data access as
well as code execution. Rename the feature to MEMMAP to reflect what it
actually does:
- CONFIG_MSPI_XIP -> CONFIG_MSPI_MEMMAP
- CONFIG_FLASH_MSPI_XIP_READ -> CONFIG_FLASH_MSPI_MEMMAP_READ
- struct mspi_xip_cfg -> struct mspi_memmap_cfg
- enum mspi_xip_permit / MSPI_XIP_READ_* -> mspi_memmap_permit /
MSPI_MEMMAP_READ_*
- mspi_xip_config() -> mspi_memmap_config(), driver API entry
xip_config -> memmap_config
- MSPI_XIP_CONFIG_DT{,_INST,_NO_CHECK} -> MSPI_MEMMAP_CONFIG_DT{,...}
- MSPI_XIP_CFG_STRUCT_DECLARE / MSPI_XIP_BASE_ADDR_{DECLARE,INIT} ->
MSPI_MEMMAP_*
- devicetree property xip-config -> memmap-config
Vendor HAL symbols (am_hal_mspi_xip_*) and DesignWare register names,
where XIP is the hardware documentation terminology, are unchanged.
The MSPI API is experimental, so no deprecated aliases are provided;
a migration guide entry is added in a separate commit. Add missing
Doxygen comments on new API symbols. Add missing SPDX header to the
nrf54h20dk code_relocation_nocopy overlay touched by this rename.
Fixes#104657
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
Move most of the shared sources from drivers/video/ into subsys/video/.
The content left in drivers/video/ is now only used by drivers, or
drivers themselves.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Move all the content of <zephyr/drivers/video.h> to a separate include
file in <zephyr/video/video.h> except driver entry points, all with a
video_drivers_... prefix.
Video control IDs are now in <zephyr/video/controls.h> and included
from both <zephyr/drivers/video.h> and <zephyr/video/video.h>.
Video format FourCCs are now in <zephyr/video/formats.h> and included
from both <zephyr/drivers/video.h> and <zephyr/video/video.h>.
As a side effect, introduce a video subsystem in MAINTAINERS.yml
Signed-off-by: Josuah Demangeon <me@josuah.net>
Pair RX_INT on async RX disable/error paths. irq_rx_enable takes the
lock during async RX, but async_rx_disable does not call
irq_rx_disable, so the lock was left held after transfers.
Also restore UHCI on PM resume when peripherals are powered down in
light sleep. UHCI has no sleep-retention link (unlike UART/GDMA) and
comes back reset with its UART port detached.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Do not release the TX_INT_STREAM policy lock on TXFIFO_EMPTY; that
interrupt only means the TX FIFO has space. Keep the lock until
irq_tx_disable. Also take an RX_INT lock across irq_rx_enable/disable
so light sleep cannot run while IRQ-driven RX is armed.
Rename tx_ongoing to pm_lock_bits now that the mask covers RX as well.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
I2C_STM32_DOMAIN_CLOCK_SUPPORT was always evaluating to 0 in this
driver since DT_DRV_COMPAT isn't defined yet at the point it's used.
This meant the domain clock (pclken[1]) was silently ignored even on
boards whose devicetree defines a second clock.
As suggested by @erwango in the issue discussion, instead of trying
to fix the compile-time macro, this commit removes it entirely.
cfg->pclk_len is already set from DT_INST_NUM_CLOCKS(),
so it tells us at runtime, per instance, whether a second clock exists.
A few other STM32 drivers (i2c, i3c) already do it this way
Fixes#112469
Signed-off-by: Akansh Sinha <akansh.sinha.dev@gmail.com>
counter_get_frequency() is allowed to be called from a counter alarm or
top-value callback, which runs in the counter ISR. The Infineon TCPWM
counter driver implemented get_freq() by querying the peripheral clock
tree on every call via the PDL (Cy_SysClk_PeriPclkGetFrequency ->
Cy_SysClk_ClkHfGetFrequency).
On non-secure builds (TrustZone-M with TF-M) that PDL clock query is
serviced by the secure world through a PSA / secure-request round-trip.
Such calls are not permitted from interrupt context, so invoking
counter_ticks_to_us() / counter_get_frequency() from an alarm callback
made the secure request fail and the PDL assertion fault the core,
hanging the application. In thread context the same query works, and
secure builds read the clock registers directly, so the failure was
specific to the non-secure interrupt path.
The counter input clock is fixed once the peripheral divider is assigned
at init. Cache the frequency during device init (thread context) and
return the cached value from get_freq(). This makes
counter_get_frequency() safe to call from the counter ISR and also
avoids a clock-tree walk on every call.
Run the driver init at POST_KERNEL rather than PRE_KERNEL_1: on the CM55
the same clock query is relayed to the secure world over IPC and blocks
on a semaphore, which is not available before the kernel is up.
POST_KERNEL populates the cache once the kernel and the relay are ready,
and still before any application arms an alarm, so the cached value is
always valid when get_freq() runs from an ISR. Also fail init with -EIO
if the frequency reads back as 0.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
To reset channel preselection register (PCSEL), low-level function
LL_ADC_SetChannelPreselection has been used. This function does not clear
any bit as it uses bitwise OR and can only set the bit. Replace this with
stm32_reg_write() to clear whole register with 0.
Signed-off-by: Marin Jurjević <marinjurjevic@outlook.com>
Channel preselection condition uses bitwise operation on raw
register value to check if channel needs setup. Use BIT(channel_id)
macro to extract relevant bit instead of channel.
Signed-off-by: Marin Jurjević <marinjurjevic@outlook.com>
Instead of the vendor-specific `stm32_lp_tick_source` nodelabel, update
the STM32 LPTIM systimer driver to use the `zephyr,system-timer` chosen
as singleton instance selection.
Remove support for the old mechanism entirely, triggering instead
a build error during Kconfig parsing (to avoid unnecessary compilation).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
On some STM32 series, the VREFBUF's voltage scale can only be changed
while the regulator is disabled. Update the driver to support such
series by consuming the new "st,has-active-scale-change" property and
performing the regulator disable/enable sequence when changing voltage
scale on series without the property.
On series where the VREFBUF supports changing voltage scale while
enabled, the driver behavior should remain unchanged.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The DMA main soft-reset bit is self-clearing and clears the block
enable while it is in progress. The previous sequence wrote the
enable bit immediately after the reset request (separated only by a
dummy I/O-delay write), so the enable could be dropped if the reset
had not yet finished. Poll the self-clearing SRST bit until it reads
back zero before setting the enable bit.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
Add a Kconfig option, DMA_MCHP_XEC_DMAC_MAX_CHANNELS, defaulting to the
dmac node's dma-channels devicetree property,
Updated PCR and GIRQ properties of DMA node to use new macros
Also removed the XEC_DMA_DEBUG logic.
Signed-off-by: Manimaran A <manimaran.a@microchip.com>
Replace the CMSIS-style packed-struct register overlays
with register offset constants accessed via the Zephyr
sys_read32/sys_write32/sys_set_bit/sys_clear_bit helpers.
Signed-off-by: Scott Worley <scott.worley@microchip.com>
The TDP2004 is a four-channel linear repeater or redriver designed
to support DisplayPort 2.1 up to 20Gbps and AC coupled HDMI2.1 source
up to 12Gbps.
Signed-off-by: Julien Panis <jpanis@baylibre.com>
Replace SOC_FAMILY_TI_MSPM0 with HAS_MSPM0_SDK in the depends on
clauses for the clock_control and hwinfo MSPM0 drivers.
HAS_MSPM0_SDK is selected by all MSPM0 SoC series and is the correct
guard for SDK-dependent drivers. This avoids enumerating individual
SoC series and is consistent with how other SDK-gated code is guarded.
Drop the SOC_FAMILY_TI_MSPM0 dependency from the entropy driver
entirely as it is already guarded by DT_HAS_TI_MSPM0_TRNG_ENABLED.
Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
ifx_cat1_uart_irq_is_pending() read the latched interrupt-cause
register, but the ISR clears RX_NOT_EMPTY and TX_EMPTY before
invoking the callback. The cause register could then read
not-pending while bytes remained in the RX FIFO. Callers gating on
uart_irq_is_pending() then stopped servicing the FIFO and dropped
received data.
Report the pending state by reusing irq_rx_ready() and
irq_tx_ready(), gated by the interrupt enable mask.
Assisted-by: Copilot:claude-opus-4.8
Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
Add an in-process virtual Wi-Fi simulator (wifi_hwsim) for testing the
Zephyr Wi-Fi stack (wpa_supplicant / hostapd -> driver) without
physical hardware, modeled after Linux's mac80211_hwsim.
The driver instantiates N virtual radios from devicetree, each backed
by a net_if with Ethernet L2 and Wi-Fi offload. An in-process
frame-relay "medium" connects radios tuned to the same frequency.
Management frames (802.11) are handed to wpa_supplicant; data frames
(802.3) are delivered by L2 destination MAC, so a unicast frame reaches
only the matching radio while broadcast/multicast frames reach all
peers on the channel.
Because all radios share a single IP stack, a peer's source address is
also a local address. Injected data frames are flagged as loopback so
they are not dropped by the IP input anti-spoof check; deployments must
also disable the "destination is my own address" short-circuit
(CONFIG_NET_IP_ADDR_CHECK) so inter-radio data frames traverse the
medium.
Open, WPA2-PSK and WPA3-SAE associations work end to end. Since both
radios live in one process, the driver relays the association between
the STA and AP contexts as an EVENT_ASSOC carrying the STA's RSN IE (the
way a FullMAC firmware reports it) rather than serializing
(Re)Association frames. For a secured network the STA port is left
unauthorized so wpa_supplicant runs the real 4-way handshake, whose
EAPOL frames cross the medium as ordinary data frames. The AP's beacon
IEs (including the RSN element) are surfaced in scan results so a STA
can match a secured network, and the AP-side station ops are accepted
so the authenticator can authorize the station.
For WPA3-SAE the driver advertises WPA_DRIVER_FLAGS_SAE and relays the
SAE Authentication commit/confirm frames over the medium (built from the
SME auth_data on the STA, parsed back into EVENT_AUTH), so the real SAE
exchange runs before the 4-way handshake.
MAC addresses follow the standard Ethernet MAC config mechanism
(local-mac-address / zephyr,random-mac-address / NVMEM via
net_eth_mac_load()), falling back to a random locally-administered
address.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Claude:claude-opus-4.8
Add a bus emulator for the BMP581 so the driver can be exercised on
native_sim without hardware. It models the register file, the soft-reset
power-on-complete handshake, the chip-id and NVM-ready status, and the
temperature/pressure data registers, and implements the emul_sensor
backend (set_channel / get_sample_range) for the pressure and ambient
temperature channels.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
On the RP2040, interrupt 15 is used for the RX FIFO on core 0, and
interrupt 16 is used for the RX FIFO on core 1. By splitting the mailbox
node into separate ones for each core, the correct interrupt for each core
can be selectively enabled in an overlay.
This benefits AMP use cases with the RP2040 where each core runs its own
distinct application. Without this, only the interrupt for core 0 would be
enabled.
Signed-off-by: Eric Hay <erichay@live.ca>
Add device power management to the DesignWare I2C driver so instances
under a switchable power domain can be used safely with runtime PM.
Hardware bring-up is moved from initialize() to PM_DEVICE_ACTION_TURN_ON
via i2c_dw_turn_on(), which reuses the helpers introduced in the
previous commit (prepare, probe_hw, init_config). initialize() now
only performs one-time CPU-side setup: MMIO/PCIe mapping, semaphores,
IRQ connect, and default app_config, then calls pm_device_driver_init().
It also add pm_device_runtime_get()/put() when needed to prevent the CPU
from sleeping while the device is in use.
When CONFIG_PM_DEVICE or runtime PM is not enabled for an instance,
existing behavior is preserved: runtime get/put are no-ops, and
pm_device_driver_init() still invokes TURN_ON at the end of init when
the device is powered.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
In i2c_dw_initialize(), move the i2c_dw_prepare() call to after
MMIO/PCIe mapping instead of before it.
MMIO mapping and PCIe BAR setup are CPU-side bus operations and do not
require the peripheral clock, reset, or pinctrl to be enabled first.
Clock, reset, and pin configuration are still applied before any
controller register access (probe and init_config).
No change to the helpers themselves or to the overall initialization
sequence beyond this ordering fix.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Refactor i2c_dw_initialize() by extracting the hardware setup into
focused helpers without changing runtime behavior:
- i2c_dw_prepare(): enable clock, optional reset, and pinctrl
- i2c_dw_probe_hw(): COMP_TYPE check and high-speed mode detection
- i2c_dw_init_config(): controller register programming (SDA hold,
block mode, spike length, bitrate configuration, extended timeouts)
i2c_dw_initialize() still follows the same call order as before except
for :
- we are now doing the COMPT_TYPE + high-speed mode detection before
setting up the SDAHOLD timing register (register programming)
- we are now doing the controller register programming before the IRQ
registration (that was done in the middle of it before )
Register programming has been assembled into a single helper function to
make it easier to understand and maintain hence the diff in call order.
This is a preparatory step for introducing runtime power management for
the I2C driver.
Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
Store pointer to original target config instead of copying it.
The Zephyr I2C target API expects callbacks to receive the original
config pointer for CONTAINER_OF usage. Also fix ISR handling order
and remove unnecessary ACK commands handled by smart mode.
Signed-off-by: Fabin V Martin <Fabinv.Martin@microchip.com>
In ramcode_flash_cmd_read_status, the status polling loop continuously
reads SMFI_ECINDDR in RAM without any delay cycles. During flash erase
operations, tight polling can cause bus contention or premature register
evaluation on fast silicon and at higher compiler optimization levels,
resulting in intermittent erase failures (rc=-2).
Add a small delay loop inside the status polling loop to throttle
register reads.
Tested on board with it8xxx2 EC.
Signed-off-by: Keith Short <keithshort@google.com>
Fix few:
wuc_nxp_wuu.c:231:14: warning: duplicate 'const' declaration specifier
[-Wduplicate-decl-specifier]
warnings, DEVICE_API already includes the const qualifier. Only exposed
when compiling with COMPILER_SAVE_TEMPS=y for some reason.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add short delay after enabling the hardware flow control.
This setting is stored in the flash, but first time it is enabled
might cause next AT command to fail.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The TX_FULL flag requires a short hardware response time to update.
Add a 10us busy wait to ensure the flag is stable before reading it.
Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
For non-control out endpoints, do not submit the out event to upper
stack until the transfer buffer is completely filled.
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Re-initializing the suspend work when it's busy may cause kernel
panic. This change moves the suspend work initialization to the pre-init
function to ensure it is initialized only once.
Tested with: sudo dfu-util --detach
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
The PORT-based gpio_mcux_port_configure() rejects any configuration
that sets neither GPIO_INPUT nor GPIO_OUTPUT with -ENOTSUP. This makes
it impossible to release a pin with gpio_pin_configure(dev, pin,
GPIO_DISCONNECTED), which applications such as debug probes and
programmers need in order to tri-state shared target pins (SWD, ICSP,
UPDI) when a protocol is deactivated.
Handle GPIO_DISCONNECTED by clearing the pin's direction bit in PDDR
and setting the PCR MUX field to 0 (pin disabled / Alternative 0),
disconnecting the pin from the GPIO module. This also disables the
digital input buffer (cleared explicitly via IBE on parts that have
it), so the released pad is high impedance and draws no current when
left floating.
Signed-off-by: Leonardo José Consoni <leonardo@binho.io>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The TWT interval passed by the Wi-Fi management API is a uint64_t, but
nrf_wifi_twt_us_to_float() took a uint32_t, silently truncating any
interval above UINT32_MAX us (~71.6 min). On top of that, the encoder
worked in milliseconds and renormalised the mantissa via frexp(), which
pinned it near ~1000 and used only ~10 of the 16 mantissa bits, capping
the encodable interval at ~1000 * 2^31 us (~24 days).
Take the interval as uint64_t end to end and encode it directly in
micro-seconds using the full 16-bit mantissa and the 5-bit exponent
(max WIFI_MAX_TWT_EXPONENT). This removes the truncation and lets the
driver represent the complete range the API exposes, up to the IEEE
802.11 maximum of UINT16_MAX * 2^31 us, with exact micro-second
resolution. Intervals beyond the encodable maximum are saturated.
The over-the-air value is unchanged (mantissa * 2^exponent us), so the
firmware interface is untouched; only the host-side conversion changes.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Claude:claude-opus-4.8
Previously, the MRAMC uses the NRFX driver which
used the INFO.MRAM register to get the size of
the MRAM. In other parts of the driver, the size
is taken from the devicetree. Also, if running tf-m
the size would be taken from the devicetree. This
commit ensures there's only 1 source of truth so
we only ever use the devicetree. This will also
allow the user to select a smaller MRAM size if
they wanted.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
Add the MCUX_POWERQUAD_CLK clock identifier to the LPC syscon clock
dt-bindings header and add the corresponding clock enable case in
the syscon clock control driver. This allows the PowerQuad DSP
coprocessor peripheral clock to be managed through the Zephyr clock
control API.
Assisted-by: Claude Code:claude-opus-4-6
Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
remove checking phy dev in
init. the phy is only needed in the iface init,
and the iface init doesn't check if the
regular init was successfull.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The management frame packet pointer error cause drop all the action
frame, so can't process neighbor report response frame, cause 11kv
roaming failure.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>