Extend the fixed-clock driver for PSC3M6. Map the 250M DPLL LP0/LP1
paths under SOC_SERIES_PSC3, guard the WCO startup error path
against PSOC4.
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Richard Mc Sweeney <Richard.McSweeney@infineon.com>
Signed-off-by: Niranjan M <niranjan@aerlync.com>
Add DWC2 vendor quirk for xmc4xxx SoC family.
The driver does not seem to support DMA mode on the older core versions.
The symptoms are: stalled setup transfers, no responses to IN tokens on
control or other IN endpoints.
Disable internal DMA mode by default for XMC4XXX SoC series.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add the tickless Hexagon system timer driver on top of the generic
tickless core (system_timer_generic.h). The H2 hypervisor exposes a
free-running 64-bit nanosecond counter via vmtimerop(hvmt_gettime) and
an absolute-deadline timeout via vmtimerop(hvmt_settimeout); the driver
supplies only these cycle-domain primitives and lets the generic core
own all tick accounting.
hvmt_settimeout matches on equality only: a deadline at or before the
current time is mapped by the hypervisor to BIGBANG, which disables
the timer rather than firing it immediately. This classifies Hexagon
as a TIMER_CORE_BACKEND_COMPARE_EXACT backend, whose core-side verify
loop re-arms a deadline the counter has already passed, removing the
need for a driver-side minimum-delay fallback.
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
The GEM driver cast pointers to and from uint32_t in several places,
which truncates on 64-bit targets such as the ZynqMP Cortex-A53 and
warns with -Wpointer-to-int-cast / -Wint-to-pointer-cast there.
Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
The HAL based stm32 ethernet driver has no support for PTP on the
stm32mp13, so use the dwc_mac driver when PTP support is needed,
like on the stm32f1, f2 and f4.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The STM32MP13 has two instances of the MAC, so rework the glue to
define a device per enabled devicetree instance, with the pins,
clocks, descriptor rings, MAC address configuration and interrupt in
a per-instance configuration wrapped around the core's one.
The PHY interface of each MAC is selected in SYSCFG_PMCSETR, which is
a set-only register with SYSCFG_PMCCLRR as its clear-only counterpart.
Both are written directly, as the PMCCLRR bits read back as the current
configuration and the read-modify-write the LL helpers do on it would
clear the bits of the other MAC. Which set of bits a MAC uses is
derived from its register address rather than its devicetree instance
number, so a board enabling only the second MAC keeps working. MII,
RMII and RGMII are supported, with st,ext-phyclk selecting the MAC
kernel clock as the RMII reference or RGMII 125 MHz clock.
The descriptor rings go into the nocache section like on the other
series, which the MMU maps strongly ordered, with the physical
addresses the core expects on MMU platforms filled in.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Report the rates of the ethernet kernel clocks and PTP clocks, which
all live in ETH12CKSELR, so the PTP clock drivers can derive the
timestamp increment from the actual rate. A PLL that is not ready
gives an error rather than a zero rate.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The ETHxMAC gates run on hclk6, the ETHxCK gates on the ETHx kernel
clock. The DWC MAC MDIO driver needs the former to derive the CSR
clock divider from.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add an auto-register boolean devicetree property to the regset target
library binding and call regset_target_lib_register() during
regset_target_lib_init() when enabled. This allows I2C target devices to
be automatically registered on the bus at init time without requiring
manual registration.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Assisted-by: Antigravity:gemini-1.5-pro
Replace direct NVIC pending-state calls with k_irq_set_pending()/
k_irq_is_pending()/k_irq_clear_pending(), dropping the dependency on
cmsis_core.h where nothing else needed it.
This driver called arm_gic_irq_set_pending() directly; the portable
API removes the GIC-specific dependency.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Thanks to the bindings reorganization, a variable is now generated
properly for `zephyr,dsa-port`: use it!
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
als31300_convert_to_gauss() built a scale factor by dividing the 500 G
from the part number by the 4096 codes of the 12-bit ADC. Both halves of
that are wrong.
The raw reading is a sign-extended 12-bit quantity, so it spans 2048
codes either side of zero, not 4096. That alone made every
sensor_channel_get() magnetometer reading half the actual field.
More fundamentally, the datasheet does not define the scale as a ratio
of range to code span. It gives sensitivity directly -- 4 LSB/G typical
for the ALS31300-500 -- and states the conversion as
gauss = raw / sensitivity
with a worked example of -1018 LSB / 4 LSB/G = -254 G. The 500 G in the
part number is the "Optimized Sensing Range" (BIN), not the endpoint of
the code range: at 4 LSB/G the 2048 codes actually reach 512 G. Deriving
the scale from 500/2048 therefore implies 4.096 LSB/G, leaving a
systematic 2.3% error in a part whose own sensitivity error spec is
2.5% (3 sigma) on X/Y.
Use the specified sensitivity instead. Raw -1018 now converts to
-254.5 G, reproducing the datasheet example, and raw 2000 lands exactly
on the 500 G range endpoint. Document while here that the driver only
supports the -500 variant, since the -1000, -2000 and -JOY parts are
trimmed to different sensitivities.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:claude-opus-5
The RTIO decoder encoded readings as (value << shift), but Zephyr's Q31
sensor convention is real = q31 * 2^shift / 2^31, so an encoder has to
scale by 2^(31 - shift) to agree with the shift it publishes in the
decoded data header.
The driver advertises a shift of 16 for both magnetic field and
temperature, so every reading came out of the decoder at twice its true
value. Encode with (31 - shift) instead, matching what e.g. the BME280
decoder already does.
On the magnetometer path this was masked until now: the scale factor in
als31300_convert_to_gauss() was low by the same factor of two, so the
two errors cancelled and only the streaming temperature channel was
visibly wrong. The next commit fixes the scale factor.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:claude-opus-5
MSI-X table is device memory. Map it with K_MEM_CACHE_NONE so
vector and control register writes are not cached on architectures
that require uncached MMIO for MSI-X programming.
Signed-off-by: Li Wan <wanli@kylinos.cn>
Convert the RISC-V machine timer to system_timer_generic.h. The mtime
counter with its absolute mtimecmp compare is a COMPARE_ORDERED backend:
the driver keeps only timer_driver_cycle_get() (mtime) and
timer_driver_set_compare() (set_mtimecmp), and the core takes over the
cycle-to-tick accounting, the deadline math, the range clamp and the
announce. smp_timer_init() primes the per-hart comparator through
timer_core_smp_prime() rather than reaching into the core's baseline.
The public cycle counter applies the DT clock divider to raw mtime, so
the driver keeps its own sys_clock_cycle_get_32/64() and says so with
TIMER_CORE_HAVE_CYCLE_GET_32/64.
Tested with timer_api and context on qemu_riscv64.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
MTIP is level sensitive: it stays asserted for as long as mtime is past
mtimecmp, and writing mtimecmp is the only way to clear it. The ISR never
did, relying instead on sys_clock_set_timeout() being called after the
announce to move the compare forward.
That holds only as long as something does call it. On SMP with a per-hart
mtimecmp, every hart takes the interrupt when a shared deadline expires,
but sys_clock_announce_locked() returns early on all but one of them, so
only the announcing hart gets its compare rewritten. The others return
from the ISR with the compare still in the past and take the interrupt
again immediately, once per hart until each has had a turn as announcer.
It is not specific to SMP either. Nothing guarantees the kernel arms
another deadline: with no timeout pending it may legitimately choose not
to, and a driver has no business depending on that to stop its own
interrupt.
Push the compare out of reach on entry instead, so the interrupt fires
once for the deadline it was armed with. The arming path overwrites it
with the real deadline in the normal case.
Fixes: #115442
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
ETHER_EVENT_RX_COMPLETE is driven by the EDMAC's FR (Frame Received)
bit in EESR, a level/sticky status bit meaning "at least one frame
arrived", not a count. If several frames complete reception between
two interrupt services, the ISR still only gives rx_sem one credit.
The RX thread drained exactly one frame per credit, so under bursty
traffic completed-but-undrained frames piled up in the 8-entry RX
descriptor ring until it filled, causing the EDMAC to genuinely drop
incoming frames.
Drain the RX ring in a loop per wakeup instead of assuming one credit
equals one frame; the loop is inherently bounded by the ring size.
Also fix a related bug this exposed: renesas_ra_eth_rx() fell through
to call R_ETHER_RxBufferUpdate() with an uninitialized buffer pointer
whenever R_ETHER_Read() legitimately reported no data available; it
now returns NULL immediately in that case.
Signed-off-by: Henrik Maier <hwmaier@gmail.com>
renesas_ra_eth_tx() used k_sem_take(&ctx->tx_sem, K_NO_WAIT), so once
the TX descriptor ring filled up under sustained bulk traffic, every
subsequent send() returned -ENOBUFS immediately. Zephyr's net_if_tx()
only logs a rate-limited warning on a negative send() status and
drops the packet, with no retry or backoff. TCP was left to detect
and recover the loss itself via duplicate-ACK fast retransmit or,
when a burst overran the ring by more than one frame, a full RTO
timeout - both cap achievable throughput well below link rate.
Use K_MSEC(ETHER_TX_TIMEOUT_MS), a pre-existing but previously-unused
timeout constant, so the driver blocks briefly for a descriptor to
free up instead of dropping immediately. This gives real backpressure
so TCP's sending rate gets throttled to the actual link drain rate.
Signed-off-by: Henrik Maier <hwmaier@gmail.com>
renesas_ra_eth_tx() called R_ETHER_Write() twice for every packet:
once unconditionally, and again after taking the TX semaphore. The
first call bypassed the semaphore gate entirely, transmitting from
the buffer before the descriptor slot was actually reserved. Move
the semaphore take before the single R_ETHER_Write() call.
Signed-off-by: Henrik Maier <hwmaier@gmail.com>
Fix two error-path bugs in the Agilex FPGA bridge driver:
1. smc_callback() used the result of k_malloc() without checking it.
On heap exhaustion the copy loop dereferences a NULL pointer, and
fpga_config_ready_check() would pass the NULL response buffer to
fpga_reconfig_status_validate(). Return -ENOMEM instead, after
releasing the semaphore so the waiting caller does not block
forever.
2. smc_send() leaked the command and response buffers when
sip_svc_send() failed. Free them before returning -EBUSY.
Signed-off-by: Arbab Haider <arbabhaider649@gmail.com>
Update the existing UART PDL driver to work with the CYT4DN SoC in
the TRAVEO family. This adds CYT4DN-specific clock, interrupt, and
DMA handling using the INFINEON_TRAVEO_FAMILY Kconfig option.
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
Extend the gpio_ports[] table from prt21 up to prt30 for the wider
port range on newer CAT1C SoCs, and generate it with LISTIFY()
instead of a copy-pasted GPIO_PORT_OR_NULL() list. Absent ports
still resolve to NULL, so behaviour is unchanged.
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
Add interrupt controller driver for the Infineon CAT1 CPUSS system
interrupt multiplexer found on TRAVEO T2G series SoCs. The driver
implements the MULTI_LEVEL_INTERRUPTS interface, mapping
system interrupts to NvicMux lines.
Signed-off-by: Sanjay Vallimanalan <sanjay@linumiz.com>
added support for infineon peripheral clock group driver where
driver is enabled for peripheral group instead of peripheral
dividers. so this makes easy to control the clock configuration
and driver also supports to method to define the peripheral clock
divider settings:
- use clock-div dts property for define divider value for static
frequency meaning it is not changing at runtime. divider value is
set at peripheral clock driver init time.
- second method is runtime clock frequency setting for that absence
of clock-div property in the respective peripheral divider is fall
into this method
Peripheral will define clock property with peripheral divider node
along with the peripheral clk/peripheral mux id.
Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
added clock driver support for Infineon Traveo series MCU
this driver handles oscillators, pll configuration and
high frequency clocks.
Traveo series MCU has 3-cores,1 Cortex-M0P and 2 Cortex-M7/M4.
Cortex-M0P is main CPU which is going to set clock for M7/M4
cpus, enable M7/M4 cpus. So driver is designed that the clock
configuration part is handled by Cortex-M0P, only other cpus
are just consumer of the configured clock. Currently this driver
supports ECO oscillator configuration, other oscillators will be
supported in future.
Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
Signed-off-by: Christoph Seitz <christoph.seitz@infineon.com>
eeprom_range_is_valid() tested only (offset + len) <= size. off_t is
signed and len unsigned, so a negative offset with a compensating len
wrapped the sum into range while the subsequent memcpy() addressed
memory before mock_eeprom, letting an unprivileged thread read or write
kernel SRAM. Reject negative offsets and bound-check without overflow.
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
When enumerating BARs, a 64-bit BAR occupies two consecutive BAR
register slots (low 32-bit in slot N, high 32-bit in slot N+1).
The loop increments `reg` to skip the high-word slot, but it did
not increment `bar` accordingly. As a result, the loop consumed
two register slots while only counting one BAR, causing subsequent
iterations to read the wrong register (e.g. BAR2 was treated as a
second independent BAR on a Type 1 bridge that only has two slots).
This produced an incorrect size value and a spurious
"Failed memory allocation" error for the phantom BAR..
Fix it by incrementing `bar` alongside `reg` in both early-continue
and normal-exit paths when a 64-bit BAR is detected.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Init left each channel's timer in dual 8-bit PWM mode with
timerCompare = 0, always enabled and its output routed to the pin.
Since a FlexIO timer has no start bit, the pin free-ran at
flexio_clk / prescaler / 2 until the first pwm_set_cycles().
Park it disabled with output zero so the pin stays driven low;
pwm_set_cycles() reprograms it anyway.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
The verifiers for uart_poll_out_u16(), uart_tx_u16() and
uart_rx_enable_u16() checked for the 8-bit driver op rather than the
16-bit one the implementation calls, so the check passed for drivers
that provide only the 8-bit op.
Check the matching _u16 op instead. Those ops only exist under
CONFIG_UART_WIDE_DATA, so uart_poll_out_u16() falls back to a plain
object check when it is disabled. uart_poll_in_u16() uses the object
check unconditionally because its implementation already tests the op
for NULL.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
The networking stack splits TCP transmit packets into separate
net_buf fragments for protocol headers and payload.
no memcopy TX in xilinx_axienet requires one DMA SG entry per fragment,
so the maximum fragment count must reflect how the stack actually
builds packets.
Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
Clock source selection for the 32 kHz clock is now handled by the clock
control driver. Remove the redundant clock source configuration from the
WUT timer driver and rely on the clock control subsystem to provide the
selected source.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Clock source selection for the 32 kHz clock is now handled by the clock
control driver. Remove the redundant clock source configuration from the
WUT driver and rely on the clock control subsystem to provide the
selected source.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Clock source selection for the 32 kHz clock is now handled by the clock
control driver. Remove the redundant clock source configuration from the
RTC driver and rely on the clock control subsystem to provide the
selected source.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Move 32 kHz clock source selection into the clock control driver.
This centralizes clock configuration management and allows peripherals
such as the RTC to rely on the clock control subsystem for 32 kHz
clock source configuration.
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
- Fixes building of NXP SRC rev2 hwinfo driver for frdm-imxrt1152.
- The NXP SRC rev2 hwinfo driver unconditionally referenced
SRC_SRSR_WDOG4_RST_B_M7_MASK. But not every RT11xx SoC exposes
a fourth watchdog.
- Guards the WDOG4 reset bit.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
On the C6, UART_SCLK_DEFAULT is PLL_F80M, and programming the UART
clock mux/divider while the PLL is still settling after a cold boot
intermittently latches a wrong effective clock: the port then corrupts
essentially every frame (CRC failures at the frame rate, occasional
merged frames when a delimiter byte is hit) for the entire session.
Warm resets never reproduce it - the PLL is already settled - and
re-running uart_configure() with identical values once the clock tree
is stable heals the port instantly, which pins the fault to the latch,
not the programmed values. Observed on ~50% of cold boots on affected
hardware; bench-validated 2026-08-26.
Source the UART from the always-stable XTAL instead, following the
same reasoning as the existing P4 handling (keep a settle-independent
source) and IDF practice under DFS. The fractional divider keeps
standard rates within ~0.02% from the 40 MHz XTAL.
Signed-off-by: Linus Ruettimann <linus@noxblanc.com>
Add a counter child driver for the Micro Crystal RV-3028 RTC.
The driver provides access to the RV-3028 counter functionality through
the Zephyr counter API and uses the RV3028 MFD parent driver for
register access.
Signed-off-by: Janez Ugovsek <janez@ugovsek.info>
pin_interrupt_configure() cleared the configured pin's stale edge with
WRITE_BIT(base->ISR, pin, 1), which expands to base->ISR |= BIT(pin).
ISR is write-1-to-clear, so that read returns every latched flag on the
port and writing the value back clears them all, discarding the pending
interrupts of every other pin on the same port.
Clear the single flag with a plain write.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Marvin Gnad <marvin.gnad@gmail.com>
Mirror the arch_mem_map() change and give arch_mem_unmap() the same
treatment: change the prototype to return int instead of void, so
architecture code has a consistent way to report unmapping failures.
Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Previously arch_mem_map() was a void function, so architecture
code had no consistent way to report mapping failures to callers
other than panicking or asserting. Change arch_mem_map() to
return int.
Note that this mostly maintains the k_panic() calls unless
the error is easy to handle (like invalid arguments). Each
architecture will need to be amended in the future to properly
handle the error conditions. Also some of the users are
converted to do k_panic() after failure. This is to keep
the signature change commit easier to review.
Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Rename CONFIG_FLASH_INFINEON_PSOC4 to CONFIG_FLASH_INFINEON_PDL to
support both PSoC4 and PSC3 families. Replace SoC-series ifdefs with
devicetree properties (infineon,explicit-erase, infineon,
cache-invalidate, erase-value) to describe hardware capabilities.
Add explicit erase support for PSC3, per-instance mutex for thread safety,
and cache invalidation after flash operations. Update Kconfig to select
appropriate erase flags. PSoC4 hardware auto-erases on write, while PSC3
requires explicit erase.
Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
The MSPM0 pinctrl driver called DL_GPIO_initPeripheralFunction() and
DL_GPIO_initPeripheralAnalogFunction() from TI DriverLib to configure
IOMUX PINCM registers. These are single-register writes that can be
expressed directly using sys_write32(), removing the dependency on the
vendor HAL.
The IOMUX base address is obtained from the pinctrl node reg property
via DT_INST_REG_ADDR(0), which now returns the correct hardware address
after the DTS reorganization.
The pinctrl_soc_pin_t iomux field already encodes configuration bits at
positions that match the PINCM hardware register layout, so values can
be written directly without translation.
Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
MODEM_CELLULAR_EVENT_PPP_DEAD had no case in the await registered state,
so it was discarded. A vendor with no network script enters that state
after a successful dial, with PPP attached and the carrier on, so a drop
reported there as an LCP phase change went unnoticed: the driver settled
into the registered state and stayed there, never re-dialling, because
the periodic script keeps passing on a module that is itself healthy.
Entering that state also clears the dormant flag, taking the interface
operationally up over a dead PDN.
An in-band NO CARRIER is not addressed here, as it raises no event in
this state. The interface stays dormant until the registered state
clears it, so the net_if_carrier_off modem_ppp performs takes it from
dormant to down, which notifies nothing and leaves the PPP L2 phase
unchanged.
Handle the event as the registered state already does, entering await
ppp dead so its existing timeout re-dials.
Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
The modem cellular driver was sending `AT+CGSN` expecting an IMEI to be
returned, but `AT+CGSN` returns the serial number, not the IMEI, which
are not the same as each other for the nRF93M1.
Signed-off-by: Jordan Yates <jordan@embeint.com>