Commit graph

1,620 commits

Author SHA1 Message Date
Pieter De Gendt
800ec66680 drivers: ethernet: eth_nxp_enet: Support MAC address configuration
Add support for a MAC address from NVMEM memory.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-28 08:32:37 +01:00
Gatien Chevallier
9d8e06fc92 drivers: ethernet: stm32: remove parts of MAC legacy implementation
Remove parts of the legacy implementation in eth_stm32_hal_common.c for
the loading of the MAC address when the device-tree is used. Use
net_eth_mac_load() for all these cases that were not destined for
production-ready products.

When cfg->mac_cfg.type == NET_ETH_MAC_DEFAULT, it means that neither
"zephyr,random-mac-address", "local-mac-address" or "nvmem-cells" were
used. For this case, keep the legacy property-less implementation to
avoid compilation errors and have a default, backward-compatible case.

Warning: this commit causes backward compatibility breakage for
implementations using "zephyr,random-mac-address" or "local-mac-address"
properties.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
2026-01-27 10:25:10 -06:00
Eric Ackermann
65d6752963 drivers: ethernet: Add Xilinx Axi Ethernet Lite
This commit adds support for the Xilinx AXI Ethernet Lite device,
also known as the emaclite.
The emaclite is a light-weight 10/100 MII Ethernet device.
It foregoes a DMA to reduce chip area.
Instead, it uses memory-mapped transmit/receive buffers.
A selection of features can optionally be enabled:
- a second ("pong") RX/TX Buffer
- MDIO support
- Interrupt support
This driver handles the MAC functionality of the core;
a driver for the MDIO part is introduced separately
as an MDIO driver.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2026-01-26 13:54:32 -06:00
Gaetan Perrot
ed545d2302 drivers: ethernet: lan9250: Make interrupt mask constant unsigned
Add a 'U' suffix to the interrupt status mask passed to
lan9250_write_sys_reg() to make the constant explicitly unsigned.

This avoids signed/unsigned ambiguity and addresses a SonarQube
static analysis warning.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:53:59 +01:00
Gaetan Perrot
f18da88e3f drivers: ethernet: lan9250: fix uninitialized variable warning
The lan9250_thread() function declares a local variable that may be
used without being initialized, triggering a -Wmaybe-uninitialized
warning when building with -Werror.

Initialize the variable at declaration to ensure deterministic
behavior and avoid build failures.

No functional change intended.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:53:59 +01:00
Gaetan Perrot
2719679c26 drivers: ethernet: lan9250: fix error handling
Several LAN9250 helper functions ignored return values from register
access and wait routines, potentially hiding SPI or timeout
failures.

Propagate error codes from read/write/wait helpers throughout the
driver so failures are detected and handled by callers.

This improves robustness and makes error conditions visible during
initialization, PHY access, RX/TX paths, and MAC configuration.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:53:59 +01:00
Marcelo Roberto Jimenez
e73e2f148c drivers: ethernet: xmc4xxx: BUG Fix: RX code dropping packets
The ethernet DMA driver code was causing the silent dropping of packets
with length 125, 126 and 127. The root cause of the problem is that the
DMA engine performs an extra four bytes transfer corresponding to the
Receive Status Word. For those particular packet lengths, the previous
code incorrectly calculated the last fragment size.

The new code avoids that pitfall by decrementing the total frame size as
the fragments are being collected, while avoiding the creation of an
extra fragment on the extracted network packet.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 13:49:34 +01:00
Gatien Chevallier
84dc327084 drivers: ethernet: stm32: handle MAC address with net_eth_mac_load()
This new API handles if the MAC address should be fetched from NVMEM,
is static or be randomly generated. Use it so that the driver can
fetch the MAC address from the OTP fuses, when possible.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
2026-01-22 14:07:37 +00:00
Yangbo Lu
b2ac268a66 drivers: ethernet: dsa: make dsa_tag_netc driver native
The DSA tag protocol driver should be native for packet
tagging and untagging. There is possibility other vendors/IPs
use it. So, just defined DSA tag structures in header file
instead of using hal header file.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-01-22 08:41:00 +00:00
Yangbo Lu
05c1fecb5b drivers: ethernet: dsa: move dsa_tag_netc driver out of subsys
Moved dsa_tag_netc driver out of subsys. Maintained it in
drivers/ethernet/dsa as vendor driver.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-01-22 08:41:00 +00:00
Yangbo Lu
cd5bc5caa5 drivers: ethernet: dsa: improve DSA_NXP_NETC_GCL_LEN Kconfig option
Renamed DSA_NXP_NETC_GCL_LEN to DSA_NXP_IMX_NETC_GCL_LEN for
naming consistency, and wrapped it in DSA_DRIVERS condition.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-01-22 08:41:00 +00:00
Gaetan Perrot
981872e203 drivers: ethernet: nxp_imx_netc: netc_blk: make ierb_init() void
ierb_init() never reports an error and cannot fail in practice.
Returning an int led to a dead error.

Convert ierb_init() to a void function, drop the unused return value
checks, and provide a no-op implementation for SoCs that do not
require IERB initialization.

This simplifies the control flow and removes an unnecessary error
condition.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-22 08:40:44 +00:00
Gaetan Perrot
5e16700cb2 drivers: ethernet: phy: phy_dm8806: fix error handling
The return value of gpio_pin_set_dt() and
gpio_pin_interrupt_configure_dt() was not stored before being
checked, causing the error condition to always evaluate to false.

Store the return value and properly handle potential GPIO errors
during PHY reset.

No functional change intended.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-20 20:06:06 -05:00
Gaetan Perrot
1efa88e51a drivers: ethernet: phy: phy_tja11xx: remove dead error handling
phy_tja11xx_get_link_state() always returns 0, making callers' error
checks ineffective.

Remove the unused return variable and drop the dead conditional in
invoke_link_cb() to silence static analysis warnings and simplify
the code.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-20 13:16:02 +00:00
Charles Hardin
fb9c9f034b drivers: ethernet: lan9250: Add promiscuous mode support
Handle both multicast packets and promiscuous mode in the driver. This
will allow the lan9250 to be added to a bridge as well as process
multicast packets being received.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2026-01-19 18:47:57 -06:00
Fin Maaß
9ff85c87d5 drivers: ethernet: nxp: remove redunant tx mutex
remove redunant tx mutex, as the networking
subsystem already provides one since
f65ac5effb02bdc4cb70b205545971e70c53c282

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-19 15:11:50 +01:00
Fin Maaß
77cbd69a3e drivers: ethernet: stm32: remove redunant tx mutex
remove redunant tx mutex, as the networking
subsystem already provides one since
61c392c5b1

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-19 15:11:50 +01:00
Fin Maaß
d043dd3cdf drivers: ethernet: sensry: remove redunant tx mutex
remove redunant tx mutex, as the networking
subsystem already provides one since
61c392c5b1

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-19 15:11:50 +01:00
Fin Maaß
999223f36e drivers: ethernet: numaker: remove redunant tx mutex
remove redunant tx mutex, as the networking
subsystem already provides one since
61c392c5b1

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-19 15:11:50 +01:00
Fin Maaß
6fc50ff4f0 drivers: ethernet: litex: remove redunant tx mutex
remove redunant tx mutex, as the networking
subsystem already provides one since
61c392c5b1

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-19 15:11:50 +01:00
Etienne Carriere
82ef82dff1 drivers: ethernet: stm32: factorize clock handles
Factorize STM32 interface clocks configuration in a single array.
This change eases later integration of other SoCs with different
clocks names while the driver only has to enable (possibly disable)
the clocks on a single sequence.

Suggested-by: Fin Maaß <f.maass@vogl-electronic.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-01-19 10:03:16 +01:00
Etienne Carriere
c623c4544d drivers: ethernet: stm32: finalize move of clocks to controller node
Remove helper macro used to transition from MAC clocks defined
by the MAC node to definition in the controller (parent) node.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-01-19 10:03:16 +01:00
Etienne Carriere
d965feeea4 drivers: ethernet: stm32: prepare move of MAC clocks to parent node
Prepare move of STM23 ethernet MAC clocks to the controller node (parent
node). For sake of simplicity, define a filed for all possible clocks in
struct eth_stm32_hal_dev_cfg, a later change will replace the whole
with a single STM32 clock instance (struct stm32_pclken) array pointer.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-01-19 10:03:16 +01:00
Etienne Carriere
6e095400c2 drivers: ethernet: stm32: use STM32_DT_INST_CLOCK_INFO_BY_NAME()
Update STM32 ethernet driver to use STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macro to always get all clock information, not only the bus ID
and bit position.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-01-19 10:03:16 +01:00
Fabio Baltieri
69c7befe26 drivers: eth_nxp_enet_qos: add promisc mode support
Add support for ETHERNET_CONFIG_TYPE_PROMISC_MODE.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-01-16 20:56:56 +00:00
Charles Hardin
cc29ac7871 drivers: ethernet: lan9250: remove/simplifiy the runtime structure
Remove the unused variable tid_int and lock. Also, match the other drivers
by dropping the back reference to the device structure and just pass
in the dev for the thread and dereference the context from there.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2026-01-13 14:12:00 -06:00
Mathieu Choplain
239fab93bc kconfig: treewide: use auto-generated Kconfig compatible macro variables
Replace some manually-defined DT_COMPAT_<> Kconfig macro variables with
their automatically generated counterparts. In most cases, this is
straightforward as the manually defined macro is named identically to the
one generated by the build system.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-13 13:30:54 +01:00
Fin Maaß
eaca1fcf7f drivers: ethernet: nxp: netc: fix ethernet_hw_caps
ETHERNET_CONFIG_TYPE_FILTER is not supported
in the set_config, therefore remove
ETHERNET_HW_FILTERING from the
ethernet_hw_caps of this driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-12 12:40:31 -06:00
Fin Maaß
e6bd2151da drivers: ethernet: nxp: fix set_config case
the enum ethernet_config_type for the
multicast filter is ETHERNET_CONFIG_TYPE_FILTER.
ETHERNET_HW_FILTERING is only the according
ethernet_hw_caps.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-01-12 12:40:31 -06:00
Fin Maaß
540df685f4 drivers: ethernet: w5500: implement get_link
implement get_link from the ethernet phy
api.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-01-12 12:29:07 -06:00
Fin Maaß
b85c12049b drivers: ethernet: w5500: use timeout directly
use Kconfig timeout directly.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-01-12 12:29:07 -06:00
Sandro Scherer
7c97becb3e drivers: ethernet: lan865x: fix seed for random backoff
To activate changes in mac address registers
the top register has to be written

Signed-off-by: Sandro Scherer <sandro.scherer@siemens.com>
2026-01-09 07:55:37 -06:00
Tim Pambor
2e9ba24515 drivers: ethernet: dwmac: Fix Kconfig for stm32h7
DWMAC driver was no longer selectable for stm32h7
series because of CONFIG_ETH_DWMAC dependency on
DT_HAS_SNPS_DESIGNWARE_ETHERNET_MMU_ENABLED, which
is only used for MMU based platforms.

Restructure Kconfig to have user-selectable options
for the platform-specific DWMAC drivers and select
the common DWMAC driver accordingly. This way
platform-specific dependencies can be tracked on
these options, simplifying the logic.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-01-08 09:29:34 +01:00
Gaetan Perrot
0f59ae35d4 drivers: ethernet: eth_virtio_net: remove invalid NULL check
Remove a NULL check on the device pointer that occurs after the
pointer has already been dereferenced.

This check can never be true and is therefore misleading.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-03 10:19:52 +01:00
Tim Pambor
f35189eeef drivers: eth: phy: adin2111: support C45 register access
Implement read_c45 and write_c45 functions to support clause 45
register access. This enhancement allows to access C45 registers
even when the MDIO controller does not natively support clause 45.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-12-26 10:17:32 -06:00
Tim Pambor
c9f8e8c856 drivers: eth: phy: adin2111: Use C45 access by default
Use clause 45 MDIO access by default and only fallback to the phy
internal clause 45 bridge if the MDIO controller does not support
clause 45 transactions.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-12-26 10:17:32 -06:00
Jeremy Truttmann
26a08c86f6 net: ethernet: Allow to disable the auto-start of ethernet interfaces
Adds CONFIG_ETH_NET_IF_NO_AUTO_START to allow
pre-configuration of Ethernet interfaces (e.g., filters, mac)
before they become operational. When enabled, net_if_up() must be
explicitly called by the application.

Signed-off-by: Jeremy Truttmann <jetstreeam.code@outlook.com>
2025-12-19 10:22:14 +02:00
Alberto Escolar Piedras
f64dc213fb drivers: ethernet: dsa_nxp_imx_netc: 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>
2025-12-18 18:52:13 +00:00
Fin Maaß
97a2d6bc47 drivers: ethernet: microchip_enc424j600: use timeout directly
use Kconfig timeout directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-18 12:06:25 +01:00
Fin Maaß
a7d48d94b4 drivers: ethernet: microchip_enc28j60: use timeout directly
use Kconfig timeout directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-18 12:06:25 +01:00
Fin Maaß
f017a99f07 drivers: ethernet: microchip_lan865x: use timeout directly
use Kconfig timeout directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-18 12:06:25 +01:00
Fin Maaß
2cf2f8c58a drivers: ethernet: microchip_lan9250: use timeout directly
use Kconfig timeout directly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-18 12:06:25 +01:00
Charles Hardin
1a738a56c5 drivers: ethernet: w5500: update the driver to use mac config bindings
Since the w5500 is used in arduino shields it should use the current
code patterns since it will be examined as a reference for other
drivers. So, this is just trying to catch up to the changes that have
been made in the microchip, litex, and virtio drivers.

Use the net_eth_mac_load code pattern from those other drivers and
update a few things to the code guidelines as well.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-12-17 13:57:52 -05:00
Charles Hardin
4c983d00f6 drivers: ethernet: lan9250: cleanup some un-needed code
From the prior change b38a46bade adding
in the mac configuration in the device tree it is appropriate to
remove the local mac address bindings. This is done in this commit.

There is no intended functional change

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-12-17 13:57:52 -05:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00
Fin Maaß
c8c6379b86 ethernet: stm32: remove phy init and config from HAL_ETH_Init
the phy is already configured by the phy driver in zephyr
and we don't want to overwrite it in the HAL_ETH_Init
function in the stm32 HAL.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-16 10:04:23 -06:00
Fabio Baltieri
318e43503f drivers: ksz8081: fix reset pin polarity
The reset pin, like most reset pins, is active low. Fix the driver to
treat it as active low and simplify the pin control logic while at it.
Fix all current boards using the wrong pin definition and add a note for
out of tree users.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-12-15 07:29:21 -05:00
Alberto Escolar Piedras
f0ecb0a17f drivers: ethernet: intel_igc: Use net namespaced APIs
In e6daacf3c9 the mayority of the
Zephyr ethernet drivers were changed to use the Zephyr native
net_ prefixed types, but this one was 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>
2025-12-11 17:06:04 +01:00
Sven Ginka
c4a4d8aa87 drivers: ethernet: dsa_nxp_imx_netc: fix zephyr random mac
zephyr,random-mac-address defaults to 0 or 1, which is always
available in generated code. so we can use the value itself.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-12-11 05:51:07 -05:00
Fin Maaß
0a5ad3aaa8 drivers: ethernet: remove imply MDIO
remove `imply MDIO` from the
ethernet drivers, that don't directly use mdio
and only use the ethernet phy api, now that the
phys select MDIO.

in 648c8252b575879c2e926d0b051febf2cb1672d1 the
`select MDIO` ones were remove, unfortunatly I forgot
the implyed ones.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-11 05:47:14 -05:00