Commit graph zephyr/drivers/ethernet
Author SHA1 Message Date
Tim Pambor
2382b45a66 drivers: ethernet: dwc_mac: 1000: log feature register
Add debug log for hardware feature register to
ease debugging of issues.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-06-26 13:03:09 -04:00
Tim Pambor
58f9c84805 drivers: ethernet: dwc_mac: 1000: align version register name
Update the name of the version register to match the naming convention
used for other registers in the driver and locate based on its address.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-06-26 13:03:09 -04:00
Tim Pambor
0ee22dc998 drivers: ethernet: stm32: fix clang error
Fix error reported by clang:
label followed by a declaration is a C23 extension

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-06-26 07:48:55 -04:00
Yangbo Lu
ed66226a5d drivers: ethernet: netc: control timestamping via PTP_CLOCK_NXP_NETC
Let's use unified CONFIG_PTP_CLOCK_NXP_NETC to control PTP
timestamping enablement.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-06-25 15:23:45 +02:00
Yangbo Lu
69dd347525 drivers: eth_nxp_enet: control timestamping via PTP_CLOCK_NXP_ENET
Let's use unified CONFIG_PTP_CLOCK_NXP_ENET to control PTP
timestamping enablement.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-06-25 15:23:45 +02:00
Yangbo Lu
49dda652d3 drivers: ethernet: select NET_L2_PTP_TIMESTAMPING for PTP clock
For PTP clocks which are explicitly part of Ethernet device
to provide PTP timestamping. We can select NET_L2_PTP_TIMESTAMPING
to provide Ethernet device driver complete dependency for PTP
timestamping support.

User doesn't have to take care of NET_L2_PTP_TIMESTAMPING enablement
in other places, and Ethernet device driver can control PTP
timestamping enablement via its PTP clock Kconfig option.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-06-25 15:23:45 +02:00
Yangbo Lu
a7033b23e6 net: l2: use NET_L2_PTP_TIMESTAMPING
Renamed NET_L2_PTP Kconfig option to NET_L2_PTP_TIMESTAMPING,
to make its function clear to user. Also made it depend on
PTP_CLOCK which was more reasonable.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-06-25 15:23:45 +02:00
Fin Maaß
bb4b888542 drivers: ethernet: dwc_mac: 1000: save rx_pkt and bytes
save rx_pkt and bytes, like in the qos mac, in case
we got already got fragments of later packets.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-25 15:22:05 +02:00
Iustin Stolniceanu
5d5d54e0bf drivers: ethernet: xlnx_gem: fix start/stop device signatures
The March-2026 Ethernet API migration (commit db984ee196) added
struct net_if *iface to the net_if_api start/stop declarations but
the eth_xlnx_gem_start_device and eth_xlnx_gem_stop_device definitions
were not updated, causing a build failure for any target that enables
the GEM driver (e.g. Zynq-7000 with zperf).

Add the missing parameter to both definitions.

Signed-off-by: Iustin Stolniceanu <iustin.stolniceanu@analog.com>
2026-06-25 06:19:27 -04:00
Fin Maaß
df4b6e21ae drivers: ethernet: dw_mac: qos: update core
align code to the recently added 1000 core.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-24 13:56:58 -04:00
Etienne Carriere
1f2cae602b drivers: ethernet: stm32: make MAC address array size consistent
Use NET_ETH_ADDR_LEN instead of raw 6 value to define MAC address
byte array size in STM32 ethernet drivers.

Assert at build time that the MAC address array size in HAL do match
those in Zephyr.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-06-24 11:44:15 +02:00
Fin Maaß
b766763927 drivers: ethernet: esp32: use DT_INST_ENUM_HAS_VALUE
use DT_INST_ENUM_HAS_VALUE for
phy_connection_type, that way we don't have to do
string operations.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-22 14:24:17 +02:00
Fin Maaß
9868b0eff3 drivers: ethernet: sensry: fix return type of prototype
We changed the return type of
sy1xx_mac_set_mac_addr, but forgot to change
the prorotype, but instead of fixing that we can
remove the prototype, as the function is only used
after it is been implemented.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-19 22:39:23 +02:00
Fin Maaß
18c00a714f drivers: ethernet: remove redundant tx stats
remove setting tx stats, that are already handled
by ethernet_send. It will already call
eth_stats_update_errors_tx on failiure
and on success via ethernet_update_tx_stats
it calls eth_stats_update_bytes_tx,
eth_stats_update_pkts_tx,
eth_stats_update_broadcast_tx and
eth_stats_update_multicast_tx.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-19 13:20:06 +02:00
Fin Maaß
aeb22a4a90 drivers: ethernet: use net_eth_carrier_set
use the new function
net_eth_carrier_set().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-19 11:09:59 +02:00
Fin Maaß
891969b1b1 net: ethernet: add net_eth_carrier_set
add a net_eth_carrier_set function, that
uses atomic_test_and_set_bit_to.

make net_eth_carrier_on and
net_eth_carrier_off inline and
based on net_eth_carrier_set.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-19 11:09:59 +02:00
Tim Pambor
7edde58510 drivers: ethernet: dwmac: validate buffer constraints
Add build-time validation of buffer constraints for the DWMAC driver.
This ensures that the configured buffer sizes and counts meet the
hardware requirements, preventing potential runtime issues due to
misconfiguration.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-06-18 14:40:12 -04:00
Anas Nashif
ea1fbf3588 driver: fix various typos
Fixed various typos under drivers/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-06-17 10:12:27 -04:00
Fin Maaß
7aec7f2bde drivers: ethernet: dwmac: add support for the stm32f series
add support for the stm32 f series in the
dwmac driver.

Assisted-by: Github Copilot:Claude Haiku 4.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-16 10:28:11 +02:00
Fin Maaß
3e2831ac18 drivers: ethernet: dw: add support for dwc_ether_mac10_100_1000_universal
add support for the dwc_ether_mac10_100_1000_universal,
that is used, f.e. on the stm32 f series.

Assisted-by: Github Copilot:Claude Haiku 4.5
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-16 10:28:11 +02:00
Fin Maaß
c9835defa4 drivers: ethernet: dwmac: put in its own dir
put the dwmac driver into a separate dir.

Signed-off-by: Fin Maaß <info@finmaass.de>
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-16 10:28:11 +02:00
Fin Maaß
8f9cd431af drivers: ethernet: dwmac: select CACHE_MANAGEMENT
If we have a Dcache select CACHE_MANAGEMENT

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-16 10:28:11 +02:00
Thomas Lang
2198bd83c8 drivers: ethernet: lan865x allow internal reset pullup
Fixes bug when using an internal pull up resistor on the reset pin

Signed-off-by: Thomas Lang <thomaslang2003@me.com>
2026-06-15 12:14:04 -04:00
Fin Maaß
8d201ae75a drivers: ethernet: remove logs for link up and down
Inside the work that is scheduled by net_eth_carrier_on
and net_eth_carrier_off there is already a log message,
when the carrier changes, we don't need to log the same
info in the ethernet drivers.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-15 10:32:01 +01:00
Fabian Blatz
b54e0ba58f drivers: ethernet: Add missing iface arg Cyclone V Ethernet
Adds the missing network interface arg for stop/start functions.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2026-06-13 08:35:00 +02:00
Sylvio Alves
1df3062e3a drivers: esp32: align with updated hal_espressif hal apis
Adopt the new HAL/LL interfaces: ADC_LL_* macros,
esp_clk_tree_* clock helpers, and rng_ll_* entropy reads
across the adc, i2c, pwm, mdio and entropy drivers.

Update the Radio blobs to latest version.

Update linkers to include new sleep cache calls.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-11 15:03:44 -04:00
Fin Maaß
3e5003c495 ethernet: w6300: remove redundant net_if_set_link_addr
net_if_set_link_addr is no longer needed in the
set_config.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-11 14:12:43 +02:00
Fin Maaß
2f6da492f1 ethernet: sensry: move net_if_set_link_addr
move net_if_set_link_addr into the iface init.
for the set_config it is no longer needed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-11 14:12:43 +02:00
Johan Hedberg
e6d36ffba3 drivers: ethernet: Use net_buf_drop() where applicable
Replace the two-line pattern:

  net_buf_unref(buf);
  buf = NULL;

with net_buf_drop(&buf) which performs both operations
atomically in a single step.

Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-06-10 07:48:40 +02:00
Ching Ping Sun
ea1954e81f driver: ethernet: DM9051 process return value of SPI calls
Previously, not all of the SPI return values are verified.
Here we add checks after calling the SPI functions.

Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
2026-06-09 10:34:35 +02:00
Fin Maaß
d7eb125f21 dsa: change the type of port_phylink_change argument
the ``void *user_data`` in port_phylink_change contains the
dsa port device. make this more explicit, so that we no longer
need to cast this.

This is now possible as this function
is no longer directly passed to phy_link_callback_set.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-09 10:29:44 +02:00
Fin Maaß
3e43f5bfd2 ethernet: dsa: nxp: remove log for link up
remove log for link up, as it would already be logged by the networking
subsystem, when
CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DBG=y.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-09 10:29:44 +02:00
Fin Maaß
c18bb2ca2e ethernet: dsa: handle nxp: remove setting the carrier
the dsa subsystem now sets the carrier,
therefore setting it in the nxp dsa port driver is redundant
and it can be removed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-09 10:29:44 +02:00
Martin Oliver Pitoňák
f4b990e2ef drivers: mdio: nxp_enet: Reset semaphore before transfer
Reset the semaphore before each MDIO transfer to discard any stale
k_sem_give() from the ISR that may have arrived after a previous
timeout. Without this, the next transfer would consume the stale
semaphore immediately and return incorrect data.

Signed-off-by: Martin Oliver Pitoňák <martin.pitonak@nxp.com>
2026-06-09 08:41:47 +02:00
Martin Oliver Pitoňák
c36e880e51 drivers: mdio: nxp_enet: Fix timeout not propagated in wait_xfer
The nxp_enet_mdio_wait_xfer() function ignores the return value of
k_sem_take(), causing it to always return 0 (success) even when the
MDIO transaction times out. This leads to callers receiving stale
data (0x0000) as a successful read result.

Fixes #99905

Signed-off-by: Martin Oliver Pitoňák <martin.pitonak@nxp.com>
2026-06-09 08:41:47 +02:00
Sylvio Alves
d540bf67b6 drivers: ethernet: esp32: add ESP32-P4 EMAC support
Wire the on-chip Ethernet MAC and MDIO controller on the ESP32-P4
into the eth_esp32 driver. Includes the DT nodes (eth, mdio),
espressif,esp32-eth binding refresh, board pinctrl entries for
RMII and SMI, board defconfig and Kconfig fragment enabling
NET_L2_ETHERNET, and the SoC P4 Kconfig options for buffer count
and size. Adds the related pinctrl table entries and GPIO signal
map values.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-08 19:01:15 +02:00
Sylvio Alves
7db6c34913 drivers: ethernet: esp32: configure rmii pins via pinctrl
Move RMII data plane pin selection to the pinctrl-0 property using
the RMII_* macros from the SoC pinctrl header. The pads use dedicated
EMAC IOMUX, so the driver reads the (slot, GPIO) pairs and routes them
directly instead of through pinctrl_apply_state(). Update the esp32
ethernet kit board to use the new rmii_default group.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-06-08 19:01:15 +02:00
Ching Ping Sun
370a5b1809 drivers: ethernet: set DM9051 IMR before RCR
Set the Interrupt Mask Register (IMR) before the RX Control Register (RCR)
when initializing the DM9051 ethernet controller. This prevents potential
race conditions where the receiver is enabled before interrupt masking
is properly configured.

According to the DM9051A datasheet, IMR bit 7 (PAR - Pointer Auto-Return
Mode) affects memory read/write pointer behavior. Setting IMR first ensures
the memory pointer configuration is ready before RX is enabled.

Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
2026-06-08 10:44:50 +01:00
Ching Ping Sun
211eace013 drivers: ethernet: dm9051: fix GPR read returns undefined
GPR bit 0 is Write-Only (WO per DM9051A spec), reading returns
undefined values (default XXh). The previous code read GPR and only
powered on the PHY if bit 0 was set to 1. If the read returned 0x00
(random undefined value), the PHY would never be powered on.

Fix by unconditionally writing GPR = 0x00 to power up the PHY,
ensuring it is always enabled regardless of any prior state.

Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
2026-06-04 08:42:38 +02:00
Erwan SZYMANSKI
94c57ba192 drivers: ethernet: phy: lan8742: handle EALREADY properly
As it is done in phy_mii.c, set autoneg_in_progress
for already on init.

Signed-off-by: Erwan SZYMANSKI <erwan.szymanski@st.com>
2026-06-03 18:43:04 +02:00
Robert Lubos
392802e277 drivers: ethernet: e1000: Don't enable automatically if QEMU uses SLIP
Enabling the driver while QEMU is configured to use SLIP driver (which
is the default) causes crash on boot, making any networking sample
defunct in default configuration when running on qemu_x86.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-06-02 20:22:35 -04:00
Fin Maaß
4bb19c3c73 ethernet: virtio: set the right ETH_NIC_MODEL
the ETH_NIC_MODEL is different depending on the
virtio implementation (MMIO or PCI).

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-02 13:29:49 +02:00
Fin Maaß
ca9315931b ethernet: adin2111: reduce global includes
reduce global includes for the adin2111 ethernet driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-01 12:40:13 -04:00
Fin Maaß
da4de65e7c ethernet: intel: remove global include
remove global include for the intel ethernet driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-01 12:40:13 -04:00
Fin Maaß
4b7123923e ethernet: lan865x: remove global include
remove global include for the lan865x.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-06-01 12:40:13 -04:00
Amneesh Singh
9969745801 drivers: update interrupt handling to use "flags" instead of "sense"
Update all drivers to use "flags" instead of "sense" when accessing
interrupt properties from device tree. This aligns with the updated
interrupt controller bindings that now consistently use "flags" as
the cell name for the IRQ type field.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-06-01 12:38:26 -04:00
Ching Ping Sun
7c67ad1466 eth_dm9051: enable multicast with RCR.ALL instead of MAR hash bits
Use RCR.ALL to enable reception of all multicast frames. MAR[7] is set

to 0x80 for broadcast only. This follows Zephyr driver convention

where a simple multicast-enable flag is preferred.

Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
2026-06-01 12:04:15 +02:00
Stanislav Poboril
0c7edb88e8 drivers: eth_nxp_enet_qos: default to 10 Mbps half-duplex at MAC init
The MAC_CONFIGURATION register was unconditionally OR'ed with the FES
(speed) and DM (duplex) bits, forcing 100 Mbps full-duplex during MAC
initialization. The PHY link callback later updates these bits to match
the actual link state, but on 10BASE-T1S (PLCA) links the temporary
100 Mbps/full-duplex setting causes the MAC to ignore the COL signal
from the internal TENBASET_PHY block. As a result the MAC transmits
during another node's transmit opportunity, producing collisions and
lost data.

Initialize MAC_CONFIGURATION with FES and DM cleared (10 Mbps,
half-duplex, which is also the register's reset value) and let the PHY
callback set the correct speed/duplex once the link is up. Read-modify-
write is done via a local variable so both the set and clear masks are
applied in a single register write.

Fixes #109682

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2026-05-29 22:11:11 +02:00
Måns Ansgariusson
dd85c65b7e drivers: ethernet: sam_gmac: replace private ring_buffer with sys_ringq
Remove the driver-local struct ring_buffer in favour of sys_ringq.
Pointers are stored directly in the ring queues, which removes the need
for the POINTER_TO_UINT casts and fixes a potential platform-specific
pointer truncation issue on 64-bit architectures.

gmac_desc_list rings are unchanged as they require
in-place DMA descriptor access.

closes: #21155
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-05-29 22:06:36 +02:00
Arayik Gharibyan
513e98118e drivers: ethernet: enc424j600: support multiple instances
Convert the ENC424J600 Ethernet driver from a single hardcoded
devicetree instance to the standard Zephyr multi-instance pattern using
DT_INST_FOREACH_STATUS_OKAY().

Before this change, only instance 0 was registered, so boards with
multiple microchip,enc424j600 nodes could only create one Ethernet
interface.

This allows all status = "okay" ENC424J600 devicetree instances to be
registered.

Fixes #109849

Signed-off-by: Arayik Gharibyan <arayik.gharibyan.1999@gmail.com>
2026-05-29 07:44:33 +02:00