Commit graph zephyr/drivers
Author SHA1 Message Date
Sylvio Alves
a3a341406d drivers: misc: esp_hosted_mcu: drop two field comments
The comments named coprocessor build options, which the
undefined Kconfig symbol check reports because it cannot tell
a comment from code. They mean nothing in this tree.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-24 15:38:41 -07:00
Sylvio Alves
13860e699c drivers: wifi: esp32: define the 5 GHz capability in the tree
The 5 GHz gate used a soc capability defined only by the HAL.
Add it to the esp32c5 caps, the only part that has it, under
the SOC_ESP32 prefix the soc folder uses.

Read the modem sleep frequency from the HAL as well, dropping
a second option that the HAL provided.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-24 15:38:41 -07:00
Sylvio Alves
b9e54989a3 drivers: clock_control: esp32: gate the xtal console re-source
The switch to the crystal re-sources the console uart to xtal
without checking that the console is a uart at all. With the
usb serial jtag console the uart number is the rom usb device
index, which maps to the lp uart. The hal aborts on it on the
c5, c6 and p4; on the c61 it silently reconfigures uart2
instead.

Guard the block on CONFIG_ESP_CONSOLE_UART like the pll branch
already does, and move the preceding tx drain inside the guard
so it no longer passes the rom device index, or -1 when no
console is chosen, to the rom helper.

Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-09-24 15:14:56 -05:00
Ricardo Rivera-Matos
a0f89415f3 drivers: audio: cs35l56: Adds basic CS35L56 codec driver
Adds support for basic CS35L56 smart amplifier functionality. This
only supports the integrated DSP running in ROM mode.

Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
2026-09-24 15:14:10 -05:00
Benjamin Cabé
62bd1f7f81 drivers: sensor: tdk: check accel LPF configuration return value
The return value of icm4xxxx_set_accel_ln_bw() was dropped, so the
following "if (err < 0)" guard re-tested the stale gyro result and
could never catch a failure. Assign the result to err so that a
failing accel low-pass filter configuration aborts initialization.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 15:13:37 -05:00
Benjamin Cabé
5faa912726 drivers: sensor: icm45686: submit prepared FIFO flush write
The FIFO flush branch of the stream completion handler prepared the
FIFO_CONFIG2 write SQEs but never submitted them, leaving the flush
stranded in the bus RTIO queue until an unrelated submission ran it.
Submit the bus context right after preparing the write.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 15:13:37 -05:00
Benjamin Cabé
1163d4c006 drivers: sensor: icm45686: fix NULL deref in stream event handler
The event handler dereferenced data->stream.iodev_sqe to fetch the
read config before the NULL/canceled guard that exists precisely to
handle a missing submission. Defer the assignment until after the
guard. The same defect in icm566xx is fixed as well.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 15:13:37 -05:00
Benjamin Cabé
b846b11c2a drivers: sensor: icm45686: add missing 15.625 dps gyro shift case
icm45686_get_shift() did not handle ICM45686_DT_GYRO_FS_15_625, so
decoding any gyro channel failed with -EINVAL (and left the FIFO
decoder's shift uninitialized) when that full-scale range was
selected in devicetree. Add the missing case with shift 4, following
the existing progression.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 15:13:37 -05:00
Benjamin Cabé
6bd6fbcf29 drivers: sensor: icm45686: add missing break in APEX channel_get
The SENSOR_CHAN_APEX_MOTION case in icm45686_channel_get() had no
break statement, so it fell through to the default case and always
returned -ENOTSUP even though valid APEX data had been written to
the output values. Add the missing break so the channel returns 0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 15:13:37 -05:00
Benjamin Cabé
052d0f097a drivers: sensor: icm45686: validate WHO_AM_I register value
The driver read the WHO_AM_I register under a "Confirm ID Value
matches" comment but never compared the result, so init succeeded on
any device that ACKed. Store the expected per-variant ID in the
config and return -ENODEV on mismatch.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 15:13:37 -05:00
Daniel DeGrasse
15723416fd drivers: flash: flash_intel_pflash: use SOC_NV_FLASH_CHILD_NODE macro
Move intel pflash driver to use new SOC_NV_FLASH_CHILD_NODE macro

Signed-off-by: Daniel DeGrasse <daniel.degrasse@analog.com>
2026-09-24 13:42:11 -05:00
Mathieu Choplain
856c909e7f drivers: gpio: stm32: don't require POWEROFF for wake-up pins
Now that wake-up pins can be used for something other than poweroff,
drop the wake-up configuration path's dependency on CONFIG_POWEROFF.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 17:15:14 +02:00
Mathieu Choplain
4fddde620f soc: st: stm32: pwr_wkupctrl: rename and move the exported function
The function exported by this module was branded as `gpioport` and its
signature was in `stm32_gpio_shared.h`, even though the function can
work with all GPIO port controllers disabled since it only operates
on PWRC registers.

Rebrand the function as `pwrc` instead of `gpioport` and move it to the
`stm32_common.h` header instead, for lack of a better location...

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 17:15:14 +02:00
Mathieu Choplain
67ba68db25 drivers: {gpio,pinctrl}: stm32: enable GPIO port manager explicitly
Create a dedicated Kconfig option which controls compilation of the
STM32 GPIO port manager module, and select this option explicitly in
the Kconfig for the STM32 GPIO and PINCTRL drivers which require this
module.

This replaces the previous approach where the SoC common CMakeLists
would add the GPIO port manage module to the build automatically if
either of the STM32 GPIO or PINCTRL module was enabled; an explicit
select at Kconfig level makes the dependency more visible.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 17:15:14 +02:00
Fin Maaß
bc33dd4eb9 drivers: entropy: add RISC-V Zkr driver
Add an architectural entropy driver based on the seed CSR of the RISC-V
Zkr extension. Like the ARM64 driver it has no devicetree node, it is
enabled when the harts implement Zkr and is returned by
entropy_get_default_device() if no zephyr,entropy node is chosen.

Each access to the seed CSR delivers 16 bits of entropy or a status
telling that none is available yet. In that case the driver retries a
limited number of times if it is allowed to busy-wait. The entropy is
returned as delivered by the hardware, without conditioning.

The seed CSR is accessed with csrrw as read-only accesses trap, and the
value is truncated to the 32 bits of the CSR, since QEMU returns it
sign-extended on RV64.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-09-24 17:12:58 +02:00
Alejandro Sánchez
6059212397 drivers: virtio: avoid enabling MMIO IRQ after failed init
The VirtIO MMIO init wrapper enables its IRQ even when
virtio_mmio_init_common() returns an error, leaving an interrupt
unmasked for a transport that failed initialization.

Return immediately on failed common initialization so the IRQ is only
enabled after the transport initializes successfully.

Assisted-by: ChatGPT:GPT-5.6 Sol
Signed-off-by: Alejandro Sánchez <alesangreat@gmail.com>
2026-09-24 17:12:25 +02:00
Farsin Nasar V A
d61822a318 drivers: rtc: microchip: Update g1 driver
- Connect all RTC IRQ lines for PIC32CZ CA using
  LISTIFY instead of only index 0.
- PIC32CZ CA supports multiple RTC interrupt lines,
  while the existing code connects only the first IRQ line.
- Increase the RTC synchronization timeout from 5 ms
  to 10 ms to accommodate the synchronization delay on PIC32CZ CA.
- Also update the timeout message to correctly indicate RTC
  synchronization rather than an RTC reset.

Signed-off-by: Farsin Nasar V A <farsin.nasarva@microchip.com>
2026-09-24 17:12:13 +02:00
Paulo Santos
a5482ba689 modem: cellular: vendor: request Kconfig CMUX MTU for the rest
Four vendor scripts still asked the module for a hardcoded N1 of 127
while the CMUX transmit cap follows CONFIG_MODEM_CMUX_MTU, so raising
that symbol left the host willing to emit frames the module was told
never to expect. Convert them as the other thirteen already are.

Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
2026-09-24 17:11:43 +02:00
Vladyslav Goncharuk
cb9fc9837a drivers: watchdog: suspend Xen domain watchdog
Stop active Xen domain watchdog timers during device PM suspend and
recreate them on resume. The PM path keeps the watchdog setup state
owned by the public watchdog API: suspend only records PM state and
tears down the Xen timers temporarily, while disable remains the path
that clears installed channel configuration.

Reject setup, disable, and timeout installation while the device is
suspended. This prevents public API calls from racing with PM resume and
losing a Xen timer ID or re-arming a watchdog that the application meant
to disable.

Use a non-blocking take of the device-wide setup/teardown semaphore in
the PM callback and return -EBUSY if another watchdog operation owns it.
The suspend path also uses non-blocking per-channel locks before
tearing down active Xen timers, so it reports -EBUSY instead of waiting
for an in-flight feed operation.

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Assisted-by: Codex:gpt-5
2026-09-24 17:11:18 +02:00
Vladyslav Goncharuk
0ebf3e5f4b drivers: watchdog: add Xen domain watchdog backend
Expose Xen domain watchdog timers through Zephyr's watchdog driver API.
The backend maps each Zephyr channel to the Xen watchdog ID returned by
xen_sched_watchdog(), converts Zephyr millisecond timeouts to Xen's
second-based timeout values, and takes the number of exposed channels
from devicetree.

Xen owns the actual timer and applies the domain watchdog policy when
the guest misses a feed, so unsupported Zephyr features are rejected
explicitly: callbacks, windowed timeouts, pause options, reset semantics
other than domain reset, and timeout windows shorter than one second.

Track installed and active channel state with atomics so feed operations
can run without taking the setup/teardown semaphore. Feed and teardown
of the same channel use a per-channel semaphore, so teardown blocks in
the scheduler while a feed hypercall is in progress instead of spinning
on a manually tracked in-flight count.

Map watchdog API failures to the documented errno values. Timeout
installation reports -ENOMEM when no channel is available, and feed
reports -EINVAL for invalid or inactive channels.

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Assisted-by: Codex:gpt-5
2026-09-24 17:11:18 +02:00
Vladyslav Goncharuk
30bbddef80 drivers: xen: add scheduler watchdog wrapper
Add xen_sched_watchdog() as the Zephyr Xen wrapper for the Xen
SCHEDOP_watchdog scheduler operation. The Xen ABI returns a newly
created watchdog identifier as the hypercall return value, while later
updates and destroy requests pass the existing identifier in the request
structure.

Keeping that convention inside drivers/xen gives watchdog users a normal
errno-style helper: callers pass an ID pointer, receive the Xen-assigned
ID through that pointer, and see zero on success. The wrapper rejects an
ambiguous destroy request where both the ID and timeout are zero, and it
also treats a zero ID returned by the create path as an I/O error so the
caller cannot later leak an untracked Xen watchdog timer.

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Assisted-by: Codex:gpt-5
2026-09-24 17:11:18 +02:00
Benjamin Cabé
c270dace74 drivers: i2c: mchp_xec: use inclusive terminology
Update comments, log messages, Kconfig prose, and driver-local
identifiers to use the controller/target terminology ratified by
coding guideline A.2 and already used by the Zephyr I2C API.

Identifiers mirroring the Microchip XEC datasheet
(e.g. MCHP_I2C_SMB_* register/bitfield macros, MCHP_GIRQ_* macros,
XEC_I2C_* register offset/bit macros in v2) are kept unchanged.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 17:10:49 +02:00
Benjamin Cabé
ff6b8fa880 drivers: sensor: fxos8700: fix off-by-one in SPI burst read
The SPI burst read discarded 3 leading bytes, but the device's address
phase is only 2 bytes long, so every sample was shifted by one register.
Skip 2 bytes instead, matching the single-byte read and write paths.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:fable-5
2026-09-24 17:09:31 +02:00
Sebastian Wagner
0f7aa710fe drivers: adc: ade7913: Added support for ADE7913
Add support for the Analog Devices ADE7913 three-channel, 24-bit
    sigma-delta ADC. The driver supports raw signed 24-bit synchronous
    and asynchronous reads in single-channel and burst modes. Raw-value
    conversion is left to the application.

Signed-off-by: Sebastian Wagner <1sebastianwagner1@gmail.com>
2026-09-24 13:48:19 +02:00
Mathieu Choplain
00f0eb822b drivers: clock_control: stm32h7: fix incorrect VCO configuration logic
There are two VCO parameters the driver configures: the input range
and the operation mode (VCOL/VCOH). While the two parameters may appear
independent, they are not because the valid input ranges depend on the
selected VCO mode, which itself depends on the target vco_ck frequency.
As such, the current logic which evaluates only refx_ck to determine the
input range and "deduces" the operation mode from input range is not
correct.

While we could keep two independent routines, it seems simpler to merge
both `get_vco_input_range()` and `get_vco_output_range()` into a single
`get_vco_parameters()` routine which computes both parameters from the
refx_ck and target vcox_ck (or returns an error if the configuration is
not legal) since separate routines, if preserved, would accept the same
parameters anyways.

While at it, take advantage of the new st,vcoh-frequency-range property
to ensure the legal configuration evaluation is valid on a per-product
basis.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-09-24 13:48:07 +02:00
Kai Cheng
609fc049e7 drivers: bluetooth: userchan: size RX frame buffer from BT_BUF_RX_SIZE
The rx_thread assembles a whole HCI packet in a single static frame
buffer before handing it to the host. That buffer was hardcoded to 512
bytes. A full ACL data packet can be larger than this: the host's
receive buffer is CONFIG_BT_BUF_ACL_RX_SIZE bytes and defaults up to
1300 for Classic, and an A2DP media packet fills it. When such a packet
arrives, frame_size reaches the buffer size, the driver logs "HCI Packet
is too big for frame (512 bytes). Dropping data" and discards it. The
host then sees the truncated stream and rejects it with "Unexpected
L2CAP continuation", so no A2DP media is ever received.

Size the frame buffer from BT_BUF_RX_SIZE, which the host already uses
for its RX buffers: it includes the H4 type octet and the maximum of the
ACL, event and ISO receive-buffer sizes, so the buffer holds every
packet type get_rx() accepts, including ISO packets whose MTU can exceed
both 512 and the ACL RX size.

Verified on native_sim with a real Bluetooth dongle (HCI User Channel):
before the fix A2DP media reception failed as described above; after it,
an A2DP SBC stream from a phone is received continuously (packets both
below and above the old 512-byte limit) with no dropped-frame or L2CAP
continuation errors.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-09-24 13:47:36 +02:00
Sergei Ovchinnikov
5fbbb8dc0a drivers: mfd: npm10xx: nPM10 v2.0 register map changes
RESET.LONGPRESS changed its fields' reset values which is reflected in the
defaults for their respective Devicetree properties.
RESET.CONFIG now contains a bit disabling the long-press reset behaviour
that can be overridden with user OTP. Write only the relevant mask for this
register.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2026-09-24 13:47:28 +02:00
Sergei Ovchinnikov
e478c3b855 drivers: charger: npm10xx: update CHARGER.STATUS to the 2.0 map
The new register map widens CHARGER.STATUS.STATE from three to four bits
to report the constant-current and constant-voltage phases separately.
The flags above the field move up one bit each.

Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
2026-09-24 13:47:28 +02:00
David Jewsbury
3b2e842239 drivers: nrf_auxpll: add support for optional FICR CTUNE configuration
Setting the FICR in the driver isn't required for
nrf7120 as it is set during systeminit().

Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
2026-09-24 13:46:32 +02:00
Benjamin Cabé
99b2b3da53 drivers: dma: amd_acp_host: Reject start from an invalid state
The channel state validation in start computed -EINVAL but fell
through and started the transfer anyway, returning success. Bail
out like the channel range check above it.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-24 13:44:03 +02:00
Benjamin Cabé
b5f549b937 drivers: intc: mtk_adsp: Fix enable state query
intc_mtk_adsp_get_enable() OR-ed the enable register with the IRQ bit,
returning true whenever any interrupt in the block was enabled. AND
the register with the requested IRQ bit instead.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-09-24 13:43:59 +02:00
Guillaume Gautier
d713a3253a drivers: spi: stm32: Enable EOT interrupts after sending first data
Enable EOT interrupts after finishing filling the TxFIFO. Otherwise, the
interrupt can be triggered before the tx_len data is decremented, which
leads to a stall.
Also explicitly disable the EOT before starting the transfer.
It solves an issue seen on WBA with the spi_loopback test.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Guillaume Gautier
80c360e2a2 drivers: spi: stm32: abstract H7-specific transfer operations
Add helper functions for transfer size, FIFO-related interrupts, and
status flags so the SPI driver can use a common workflow across STM32
series. These new helpers are empty (or return 0) for non-H7 variants.

This allows removing a bunch of preprocessor guards, making the driver
code more easily readable.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Guillaume Gautier
ae63a875a8 drivers: spi: stm32: Use IS_ENABLED instead of #ifdef for interrupts
Use the IS_ENABLED macro instead of #ifdef for CONFIG_SPI_STM32_INTERRUPT
when possible.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Guillaume Gautier
b002128532 drivers: spi: stm32: read RxFIFO before filling TxFIFO
Rework FIFO handling for full- and half-duplex transfers to prevent
RxFIFO overruns. Read pending RX data before sending new TX data and
drain the RxFIFO at end of transfer.

Use explicit equality checks for each transfer direction to make the
FIFO handling workflow clearer.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Guillaume Gautier
5e79ef4a04 drivers: spi: stm32: H7-like: fallback to non-FIFO mode
For H7-like devices, it is possible to set the SPI size transfer prior to
starting the communication. It is useful to increase performance,
especially when combined with the use of the FIFO threshold.
But this size is limited and can't be arbitrarily high (depending on SoCs
and SPI instances, it is typically either 65535 or 1023).
When the transfer size exceeds this limit, the driver now automatically
fallback to the unlimited transfer option instead of returning an error.

Although performance are inferior in this case, at least the transfer
takes place.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Guillaume Gautier
d719bb4c67 drivers: spi: stm32h7: seed one initial frame at transfer start
For H7-devices in full-duplex master mode, seed one initial SPI frame at
transfer start instead of relying on the TXP flag only for the first
transfer. Now only DXP and EOT flag are used (in both polling and IT).

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Guillaume Gautier
a680d22aa5 drivers: spi: stm32: dma fallback to it/polling when buffers are cached
In the STM32 SPI driver, buffers in cache are not supported in DMA mode.
Instead of returning an error in such cases, fallback to interrupt or
polling mode so that the transfer still takes place.
Replace the error message by a warning.

Also move the asynchronous check after the cache one to avoid falling
back to polling mode while in asynchronous mode.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-09-24 12:03:09 +02:00
Ren Chen
0b7405c74a soc: ite: ec: it51xxx: rename hardware crypto Kconfig option
The dedicated DLM region is shared by hardware crypto
algorithms (SHA, RSA...etc), rather than being used
exclusively by SHA-256. Therefore, this change renames
`SOC_IT51XXX_SHA256_HW_ACCELERATE` to
`SOC_IT51XXX_HW_CRYPTO_ACCELERATE`.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-09-24 10:04:09 +02:00
Ren Chen
3d193e6f57 drivers: crypto: it51xxx_sha: add interrupt support
This commit introduces SHA completion interrupt handling
instead of disabling global interrupts and polling the status
register. It also stores the register base and synchronization
state (semaphore) in the device configuration and device
data structures, respectively.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2026-09-24 10:04:09 +02:00
Tim Pambor
bf539dc736 drivers: ethernet: dwc_mac: nxp: list the implemented MMC counters
List the MMC counters of the Ethernet controller found in the NXP MCX
E31 and S32K3 series so they are reported as vendor specific Ethernet
statistics.

The controller of the MCX N and MCX A series has no MMC counters.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
fd198c5af3 drivers: ethernet: dwc_mac: rockchip: list the implemented MMC counters
List the MMC counters of the Ethernet controller found in the Rockchip
RK3588 so they are reported as vendor specific Ethernet statistics.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
72a713cf21 drivers: ethernet: dwc_mac: rockchip: improve device macro readability
Separate the parts of RK3588_GMAC_DEFINE() with empty lines, put each
member of the struct dwmac_config initializer on a line of its own and
move the closing brackets of the multi-line initializers to their own
line. No functional change.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
6f7a38fba5 drivers: ethernet: dwc_mac: stm32: list the implemented MMC counters
List the MMC counters of the Ethernet controller found in the STM32
series so they are reported as vendor specific Ethernet statistics.

The STM32F1, F2, F4 and F7 series implement six counters, the STM32C5,
H5, H7, H7R/S and MP13 series add the four LPI counters and the STM32N6
series further adds the six frame preemption counters.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
d60563d325 drivers: ethernet: dwc_mac: xmc: list the implemented MMC counters
List the MMC counters of the Ethernet controller found in the Infineon
XMC series so they are reported as vendor specific Ethernet statistics.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
be25e79113 drivers: ethernet: dwc_mac: qos: add MMC vendor statistics
Expose the MAC management counters of the QoS core as vendor specific
Ethernet statistics, the same way the 10/100/1000 core does: the
platform glue lists the counters it implements and platforms without a
list report no vendor statistics.

Implement get_stats_type instead of get_stats to avoid an expensive
read of all vendor statistics from the hardware: the Ethernet L2
fetches the common statistics for every packet, while the counter
registers only need to be read when the vendor specific statistics are
requested.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
3aa28e3b56 drivers: ethernet: dwc_mac: 1000: add MMC vendor statistics
Expose the MAC management counters (MMC, also called RMON counters) of
the 10/100/1000 core as vendor specific Ethernet statistics. They are
available whenever CONFIG_NET_STATISTICS_ETHERNET_VENDOR is enabled.

Which counters exist depends on the IP version and its configuration,
so the platform glue lists them with DWMAC_MMC_COUNTERS_DEFINE().
Platforms without a list report no vendor statistics. The keys follow
the names the Linux stmmac driver reports through ethtool.

The counters are 32 bits wide like the reported values, so they are
read as they are and left to roll over; reset on read and the counter
interrupts are not used.

Implement get_stats_type instead of get_stats to avoid an expensive
read of all vendor statistics from the hardware: the Ethernet L2
fetches the common statistics for every packet, while the counter
registers only need to be read when the vendor specific statistics are
requested.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
60472c7f67 drivers: ethernet: dwc_mac: qos: mask the MMC interrupts
The MAC management counters run from reset and their interrupt mask
registers reset to zero, that is unmasked. A counter reaching half or
full scale sets the MMC interrupt flag in MAC_Interrupt_Status. As that
flag has no enable bit in MAC_Interrupt_Enable, it drives the interrupt
line regardless and stays set until the counter is read.
dwmac_mac_irq() never reads the counters, so the interrupt would never
deassert.

Mask all MMC interrupts unconditionally.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
7abdb54744 drivers: ethernet: dwc_mac: 1000: mask the MMC interrupts
The MAC management counters run from reset and their interrupt mask
registers reset to zero, that is unmasked. A counter reaching half or
full scale sets the MMC interrupt flag in DMASR. As that flag has no
enable bit in DMAIER, it drives the interrupt line regardless and stays
set until the counter is read. dwmac_isr() never reads the counters, so
the interrupt would never deassert.

Mask all MMC interrupts unconditionally.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00
Tim Pambor
fdcc8a8b79 drivers: ethernet: dwc_mac: add the MMC register definitions
Add the registers of the MAC management counters (MMC, also called RMON
counters): the control register, the interrupt status and mask registers
and the counters.

The block has the same layout in the 10/100/1000 core and in the QoS
core, at offset 0x100 and 0x700 respectively, so the registers are
defined once relative to a per core DWMAC_MMC_BASE.

Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-09-24 10:00:41 +02:00