Commit graph

1,620 commits

Author SHA1 Message Date
Balaji Vasudevan
50c2d3bee3 net: phy: add KSZ9131 RGMII delay configuration support
Add the microchip,rgmii-delay binding for KSZ9131 PHYs and use it
on the SAMA7G54-EK board DTS.

GMAC0 on SAMA7G54-EK is connected to a KSZ9131 PHY over RGMII and
requires internal delay configuration equivalent to rgmii-id for
reliable gigabit operation.

Add KSZ9131 RGMII DLL delay configuration using Clause-22 indirect
MMD access.

The KSZ9131 PHY uses MMD device 2, registers 76 and 77, to control
RXC and TXC DLL delay bypass. Configure these registers according
to the requested RGMII delay mode:
- none
- id
- rxid
- txid

Delay setting would be skipped for variants that do not support RGMII
like KSZ9131MNX

Signed-off-by: Balaji Vasudevan <balaji.vasudevan@microchip.com>
2026-03-18 18:21:02 +09:00
Alberto Escolar Piedras
0a1c9eec56 drivers: ethernet: tap: Remove uses of net logging helper macros
These macros are private to the net subsystem, let's not use them in
drivers

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-03-17 18:21:28 -04:00
Tim Pambor
7c7624743d ethernet: dwmac: Configureable RX refill thread priority
Add a Kconfig option to configure the RX refill thread priority.
The default is set to 0, which is the same as the previous hardcoded
value. This allows users to set a different priority if needed.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-17 18:19:30 -04:00
Tim Pambor
0466dfaabb ethernet: dwmac: Fix RX refill thread priority
Thread priority was passed to options argument of k_thread_create,
instead of the priority argument.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-17 18:19:30 -04:00
Tim Pambor
a444599bbc ethernet: dwmac_stm32h7x: add support for STM32H5 series
H5 series SoCs have a similar Ethernet MAC to the H7 series,
but with some differences with respect to configuration of phy
interface type. As they use a Cortex-M33 core, they have no cache,
so that dma descriptors are always in non-cached memory.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-16 19:07:55 -05:00
Tim Pambor
ad286e4cd0 ethernet: dwmac_stm32h7x: add support for STM32H7RS series
H7RS series SoCs have a similar Ethernet MAC to the H7 series,
but with some differences with respect to configuration of phy
interface type.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-16 19:07:55 -05:00
Tim Pambor
d664a564dd ethernet: dwmac_stm32h7x: support configuration of phy connection type
Configure phy connection type to value specified in device tree.

Utilize definitions from STM32 Low-Level APIs instead of open coding
values.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-16 19:07:55 -05:00
Stanislav Poboril
71d1dd85d1 drivers: ethernet: phy: nxp_t1s_phy: add NXP 10BASE-T1S driver
Add driver for 10BASE-T1S digital PHY found on some NXP SoCs.

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2026-03-16 10:07:00 -04:00
Stanislav Poboril
e36f597c96 boards: frdm_mcxa577: add enet_qos support
1. adjusted enet_qos driver to cope with features missing on mcxa577
2. enabled enet_qos support
3. verified samples/net/zperf

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2026-03-16 10:07:00 -04:00
Stanislav Poboril
92b97cc596 drivers: ethernet: eth_nxp_enet_qos_mac: support for half-duplex mode
Mode is no longer fixed to full-duplex, it is set to half-duplex or
full-duplex in PHY callback.

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2026-03-16 10:07:00 -04:00
Julian Paul
64a7ee6b58 drivers: ethernet: phy: microchip_t1s: optional plca_node_count
Plca nodes with node_id not 0 do not manage transmit windows and
should therefore not be required to provide plca_node_count.
This change makes plca_node_count optional for (node_id != 0)
and if omitted sets the default value to 0.
The behaviour for node with id 0 stays the same.

Signed-off-by: Julian Paul <julian.paul@siemens.com>
2026-03-16 12:31:42 +01:00
James Bennion-Pedley
27821b8ea5 drivers: ethernet: Support CH32V Ethernet Peripheral
This adds initial support for the CH32V ethernet peripheral.
The driver supports both internal and external PHY configurations.

Signed-off-by: James Bennion-Pedley <james@bojit.org>
2026-03-16 07:17:30 +01:00
Tim Pambor
ad9e3a7d7c drivers: ethernet: dwmac: Fix cbprintf warnings
Fix warnings about using char * for %p argument in cbprintf. It's
recommended to cast it to void * because it may cause misbehavior
in certain configurations.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-13 16:35:26 +01:00
Sylvio Alves
c64a74e711 espressif: adapt to hal_espressif IDF master sync
Adapt all Espressif SoC and driver code to the updated
hal_espressif module synced with IDF master branch.

Main changes:
- clock control: delegate peripheral clock gating to HAL
  layer using new clock/reset APIs
- SPI/GDMA: adapt to restructured DMA HAL with new channel
  allocation and configuration interfaces
- ethernet: add RMII clock configuration and PHY management
- GPIO: simplify using direct HAL function calls
- flash: adapt to updated SPI flash HAL interfaces
- linker scripts: update IRAM/DRAM mappings for new HAL
  object files
- DTS: fix ESP32-S2 PSRAM dcache1 address to match actual
  MMU mapping region (0x3f800000 DRAM1 instead of 0x3f500000
  DPORT which lacks 8-bit access capability)
- west.yml: update hal_espressif revision

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-03-13 11:38:18 +01:00
Fin Maaß
52c254af76 net: add Kconfig option for checksum offloading
Adds a Kconfig option to detect if checksum offloading
is supported by any driver and one to activate it.

Main benefit is that `net_if_need_calc_rx_checksum()` and
`net_if_need_calc_tx_checksum()` are now inline and therefore the
compiler can optimize more, when checksum offloading is not supported.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-11 17:52:13 +00:00
Tim Pambor
a067aaa446 drivers: ethernet: dwmac_stm32h7x: align MAC address config with HAL driver
Update the dwmac_stm32h7x ethernet driver to use the same default
MAC address as the STM32 HAL driver.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-10 17:59:18 -07:00
Tim Pambor
741ce732c0 drivers: ethernet: dwmac_stm32h7x: support MAC address config
Update the dwmac_stm32h7x ethernet driver to use a MAC address
configuration struct.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-10 17:59:18 -07:00
Tim Pambor
e3808554d7 drivers: ethernet: dwmac_mmu: support MAC address config
Update the dwmac_mmu ethernet driver to use a MAC address
configuration struct.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-10 17:59:18 -07:00
Tim Pambor
fe3dad209b drivers: ethernet: dwmac: Allow to report errors from platform init
Change return value of dwmac_platform_init to int and return error code
in case of failure. This allows to report errors from platform init and
fail the driver probe if platform init fails.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-10 17:59:18 -07:00
Tony Han
3c07a68ae2 drivers: net: sam_gmac: set GMAC_NCFGR.GBE when working in Gigabit mode
Set register bit GMAC_NCFGR.GBE to configure GMAC for 1000Mbps operation.
Gigabit mode is not supported by SAM E70/S70/V70/V71 family, it is
supported by SAMA7G54.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-03-10 09:38:25 +01:00
Sebastiaan Merckx
920922db8a drivers: ethernet: nxp_enet: align nxp_eth_mod_init init priority
The initialization priority was hardcoded to 0. However, the initialization
takes a relatively long time (1 to 2 seconds on RW612). With this change,
the initialization priority properly follows CONFIG_ETH_INIT_PRIORITY.

Signed-off-by: Sebastiaan Merckx <sebastiaan.merckx@verhaert.com>
2026-03-09 11:16:59 -05:00
Fin Maaß
580a4d3c36 drivers: ethernet: sam_gmac: reuse cfg and data struct
reuse cfg and data struct in the ptp driver part.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-06 15:13:00 +01:00
Fin Maaß
10b98bf7b9 drivers: ethernet: xmc4xxx: reuse cfg and data struct
reuse cfg and data struct in the ptp driver part.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-06 15:13:00 +01:00
Fin Maaß
def8ae0708 drivers: ethernet: Remove NULL checks for iface initialization
WIth the rework of the vlan handeling, the iface init
will only be executed once per instance, so we don't need
that check anymore.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-06 10:07:27 +01:00
Nhat Ta
ea64ea10cb drivers: ethernet: phy: add Maxlinear GPY111 phy driver
This commit add phy driver support for Maxlinear GPY111. This driver
implements vendor specific behaviour rgmii delay time setup, which is
not present in the generic MII driver.

Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-03-05 04:38:09 +01:00
Nhat Ta
cc4debfeca drivers: mdio: initial support for mdio rmac driver
This commit add mdio driver support for ra8x2.

Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-03-05 04:38:09 +01:00
Nhat Ta
d188d066a3 drivers: ethernet: Put DMA buffer to nocache
This commit put ethernet buffers and descriptors to nocache .

Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-03-05 04:38:09 +01:00
Nhat Ta
65fbe9c9aa drivers: ethernet: initial support for ethernet rmac driver
This commit add ethernet driver support for ra8x2.

Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-03-05 04:38:09 +01:00
Alberto Escolar Piedras
0003f896ae drivers: ethernet: Fix net API use
In e6daacf3c9 the mayority of the
ethernet drivers code was changed to use the Zephyr native net_
prefixed symbols, but some were forgotten.
Without this fix/change the code still builds as we are by now setting
CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things
fail to build.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-02-27 13:56:24 +01:00
Fin Maaß
e1520eec5b drivers: ethernet: ETH_IVSHMEM: add missing depends on DT_HAS_*
add missing depends on DT_HAS_* for the
ETH_IVSHMEM driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-26 16:52:49 +00:00
Mori Fumita
4e5ddc96dc drivers: ethernet: nxp: return -EINVAL when disabling promiscuous mode
Promiscuous mode is enabled during initialization and cannot be
disabled at runtime.
Return -EINVAL when a request attempts to disable promiscuous mode.

Signed-off-by: Mori Fumita <mfumita@electromag.com.au>
2026-02-25 18:45:03 +01:00
Mori Fumita
5425bb5b01 drivers: ethernet: nxp: Advertise ETHERNET_PROMISC_MODE capability
ETHERNET_PROMISC_MODE is not advertised in
eth_nxp_enet_get_capabilities() even though promiscuous
mode is enabled during initialization when
CONFIG_NET_PROMISCUOUS_MODE=y.

Advertise ETHERNET_PROMISC_MODE in
eth_nxp_enet_get_capabilities() and accept
ETHERNET_CONFIG_TYPE_PROMISC_MODE in
eth_nxp_enet_set_config().

Signed-off-by: Mori Fumita <mfumita@electromag.com.au>
2026-02-25 18:45:03 +01:00
Fin Maaß
2e5d7620b4 drivers: ethernet: set init prio to the same value
set the init prio of ethernet, mdio and the ethernet phy
to the same value, that way the prio from the dt is used.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-24 15:36:30 +01:00
Venkatesh Odela
712e30e3c7 drivers: ethernet: phy: Fix missing configurations
Add indirect read/write method for accessing extended register
set beyond 0x1F. Implement configuration for strap quirk, reset
and restart ensures reliable PHY initialization and operation.

Signed-off-by: Abin Joseph <abin.joseph@amd.com>
Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-02-23 11:35:14 +00:00
Sayed Naser Moravej
251fe8177b drivers: ethernet: add support for WIZnet w6100
This PR adds support for W6100 spi ethernet controller.
This driver is tested on the w6100-evb-pico
https://docs.wiznet.io/Product/Chip/Ethernet/W6100

Signed-off-by: Sayed Naser Moravej <seyednasermoravej@gmail.com>
2026-02-22 16:13:25 +00:00
Fin Maaß
b83997f20f drivers: ethernet: stm32: HAL_ETH_Init never returns HAL_TIMEOUT
In the V2 hal `HAL_ETH_Init()`  never returns `HAL_TIMEOUT`, so
remove that check.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-20 13:31:24 +01:00
Fin Maaß
4a69098aa9 drivers: ethernet: stm32: don't init hal_ret when not needed
hal_ret doesn't need to be assigned a value twice
before it is being used, so remove the unneeded first ones.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-20 13:31:24 +01:00
Marcelo Roberto Jimenez
9c872c664a drivers: ethernet: xmc4xxx: Fixes the checksum of bridged packets
Due to checksum offloading, the checksum field of a packet must be
zero before sending it to packet to the ethernet controller,
otherwise the computed checksum will be incorrect.

If the packet is bridged, it already has the correct checksum in
place, which will cause the automatically computed checksum to
incorrectly become zero.

In this patch we give bridged packets the special attention they
need.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-02-20 07:04:25 +01:00
Fin Maaß
a25f99ae16 drivers: mdio: ethernet: integrate the mdio area into the ethernet area
integrate the mdio driver area into the
ethernet driver area. mdio itself is defined as part
of the ethernet specification.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-19 10:03:31 -06:00
Parthiban Veerasooran
697705ef71 drivers: ethernet: phy: microchip_t1s: fix link state & callback handling
Previously, the PHY driver always invoked the link state callback on
every check, even when the link state had not changed, and did not
properly synchronize access to the link state (issue #103826). This could
lead to spurious notifications and potential race conditions.

This patch:
- Calls the registered callback only when the link state actually changes.
- Logs link-up and link-down events correctly.
- Introduces a semaphore to protect the PHY link state.
- Updates link state in phy_mc_t1s_update_link_state() with proper
  synchronization.

This ensures that both link state updates and callbacks reflect actual
changes, preventing unnecessary notifications and improving driver
correctness.

Fixes: #103826

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2026-02-16 11:12:14 +01:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Fin Maaß
d1a847fe97 drivers: ethernet: phy: remove redundant default condition
menuconfig ETH_PHY_DRIVER is already inside a
`if ETH_DRIVER`, meaning it already depends on it,
therefore the condition for the default y is not needed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-12 20:04:49 +01:00
Julien Racki
8c6670cbd0 drivers: ethernet: stm32: Set MDIO clock range after MAC reset
Call HAL_ETH_SetMDIOClockRange to set back the MDIO clock range
as it is set to 0 during the software reset.

Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2026-02-12 09:30:53 +01:00
Immo Birnbaum
c9671cf934 drivers: ethernet: xlnx_gem: unify spelling
Whenever a buffer descriptor or one of its properties is
referenced, either in macros, struct declarations or variable
declarations, use the spelling 'rx_bd'/'RX_BD'/'tx_bd'/'TX_BD'
instead of 'rxbd'/'RXBD'/'txbd'/'TXBD'.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2026-02-11 09:21:47 +01:00
Immo Birnbaum
c206ff165f drivers: ethernet: xlnx_gem: fix DMA operation on ZynqMP
Add fixes for ZynqMP-based targets:

- Consider the retrofitted 64-bit RX/TX buffer descriptor ring
  base address registers which didn't exist on the Zynq-7000 yet.
- Properly tie off the unused set of RX/TX BD ring base address
  registers as described in the ZynqMP TRM (UG1085 v2.4, chap. 34:
  'GEM Ethernet', 'Programming Model', 'Initialize the controller',
  p. 1064): indicate that there's no data to be transmitted via the
  unused TX BD ring, and that no data can be placed via the unused
  RX BD ring.
- Change the DMA layout: instead of having both the BD rings and
  the packet buffers in non-cached memory or the Zynq's OCM, place
  the BD rings in uncached memory but place the actual RX/TX packet
  buffers in cached memory instead.
- Add the required cache maintenance operations for this layout.
- Select the required facilities for nocache memory and cache
  maintenance support in the driver's Kconfig file.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2026-02-11 09:21:47 +01:00
Pavel Kohout
d7bf4ec707 drivers: ethernet: e1000: fix TX and RX buffer sizing
The e1000 Ethernet driver TX staging buffer is sized to NET_ETH_MTU
(1500 bytes), but the Ethernet L2 layer prepends headers (14 bytes
standard, 18 bytes with VLAN) before calling the driver's send function.
When transmitting MTU-sized packets, net_pkt_get_len() returns the full
L2 frame size (up to 1514+ bytes), causing a 14-18 byte out-of-bounds
write into adjacent RX buffers. This is remotely triggerable by inducing
large TX responses such as ICMP echo replies.

The RX staging buffer has the same issue - it is sized to NET_ETH_MTU
but receives complete L2 frames from the network which include headers.

Fix by sizing both TX and RX buffers to NET_ETH_MAX_FRAME_SIZE and
adding a defensive bounds check to the TX path.

Signed-off-by: Pavel Kohout <pavel.kohout@aisle.com>
2026-02-09 11:17:37 +01:00
Andrej Butok
ff8d194fdd soc: nxp: kinetis: fix SOC_SERIES inconsistency
- Fixes Kconfig SOC_SERIES naming for Kinetis SoCs,
  as required by HWMv2.
- Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/69317

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-02-06 08:58:07 -06:00
Fin Maaß
da7671ae7d drivers: ethernet: native: tap: remove intermediate ll_addr
Remove unneeded intermediate ll_addr.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-04 15:18:35 +00:00
Jeremy Truttmann
9f2844341f drivers: ethernet: eth_native_tap: set the link address on interface
Calling net_if_set_link_addr() is needed to update the link address
information of the interface.

Signed-off-by: Jeremy Truttmann <jetstreeam.code@outlook.com>
2026-02-04 13:56:16 +01:00
Venkatesh Odela
0c770e9177 drivers: ethernet: eth_xilinx_axienet: remove unused variable
remove unused variable

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-02-03 14:32:49 -06:00