Commit graph zephyr/drivers/ethernet
Author SHA1 Message Date
Fin Maaß
7db1cfdc66 dts: bindings: ethernet: mdio: stm32: use snps,dwmac-mdio
As per our documentation, we have to reuse bindings from Linux, there
they use "snps,dwmac-mdio", so let's use the same one here in zephyr.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-12 09:47:10 -07:00
Benjamin Cabé
365ebbd28a drivers: ethernet: move NETC internal header next to its drivers
include/zephyr/drivers/ethernet/nxp_imx_netc.h only holds definitions
shared between the NXP i.MX NETC Ethernet and DSA drivers, which both
live under drivers/ethernet. Move the header to the NETC driver
directory so that it is no longer part of the public include tree.

Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-08-11 17:03:16 -04:00
Venkatesh Odela
d3b77c27e3 drivers: ethernet: phy: ti,dp83867: add GMII interface support
Skip RGMII internal delay configuration when the PHY is connected
in GMII mode.

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2026-08-10 09:15:29 -07:00
Madhab Sharma
2f61c7ed19 drivers: ethernet: add ch9120 driver
Added ethernet socket offload driver for
WCH CH9120 ethernet chip.

Signed-off-by: Madhab Sharma <madhabsharma94@gmail.com>
2026-08-08 16:31:42 -04:00
Sylvio Alves
879d40917a drivers: ethernet: esp32: add frame timestamping
Attach the hardware capture of received PTP frames to the packet
and request a transmit timestamp when the network stack asks for
one, so PTP can measure the time frames crossed the wire.

The receive capture is latched from the last descriptor before it
is returned to the DMA, and the transmit capture is read back from
the first descriptor once the DMA releases it.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-08-07 06:49:26 -04:00
Sylvio Alves
7033a86c2e drivers: ethernet: esp32: add ptp clock support
Expose the IEEE 1588 clock provided by the Ethernet MAC as a PTP
clock device, so applications can read, set, offset and rate
adjust it through the PTP clock API.

The reference frequency is queried from the clock control driver
instead of being assumed, and only PTP frames are timestamped.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-08-07 06:49:26 -04:00
Philipp Steiner
5efa5b2708 ethernet: nxp_enet_qos: wait for RX timestamp context desc
Receive interrupts can arrive before the ENET_QOS DMA has completed the
regular and context descriptor writebacks used for PTP RX timestamps.
Add a short bounded wait for the context descriptor ownership handoff
and timestamp status bits before extracting the timestamp.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-08-07 06:45:11 -04:00
Julien Racki
9bd86aaa33 drivers: ethernet: stm32: Add TX context allocation timeout
Prevent infinite loops when hardware becomes unresponsive
by adding a timeout in TX context allocation.
Signals interface is down and returns -ETIMEDOUT on timeout.

Co-authored-by: Alessandro Nuzzi <alesnu96@gmail.com>
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2026-08-05 18:38:37 +01:00
Fin Maaß
1f3212f789 drivers: ethernet: dwc_mac: 1000: make non-default offsets generic
make the part that is needed for the esp32 to
change the offsets for the mac and base registers
more generic and use the devicetree for it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-08-03 15:06:36 -04:00
Fin Maaß
49f8197f85 drivers: ethernet: dwc_mac: ptp: add rx timestamp filtering
Only timestamp PTP packets instead of all received packets, when
CONFIG_PTP is enabled.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
5f9a193136 drivers: ethernet: stm32: ptp: use dwc_mac when PTP_CLOCK
the hal based stm32 ethernet driver has no support
for PTP on the stm32f1, f2 and f4, so use the dwc_mac
driver when PTP support is needed.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
684350e4d5 drivers: ethernet: esp32: ptp: use dwc_mac when PTP_CLOCK
the hal based esp32 ethernet driver has no support
for PTP, so use the dwc_mac driver when PTP
support is needed.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
a44f7a766a drivers: ethernet: dwc_mac: ptp: add esp32p4
add support for the esp32p4 for PTP.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
c17d264b71 drivers: ethernet: dwc_mac: qos: add timestamping
Add support for hardware timestamping
for the dwc mac qos core.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
06f0d98de5 drivers: ethernet: dwc_mac: 1000: add timestamping
Add support for hardware timestamping
for the dwc mac 1000 core.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
5e73cd8ad1 drivers: ethernet: dwc_mac: ptp: add ptp_clock driver
add a ptp clock driver for the dwc mac cores.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-08-03 15:05:12 -04:00
Fin Maaß
b8605f30fe drivers: ethernet: dwc_mac: qos: refactor physical location functions
refactor physical location functions.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-08-03 08:47:12 -04:00
Tim Pambor
c2880a98c2 drivers: dwc_mac: qos: Support checksum offloading
Support TX/RX checksum offloading for the DWC Ethernet QoS
driver.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-07-31 13:19:36 -04:00
Tim Pambor
899b8e12a7 drivers: dwc_mac: qos: Enable store-and-forward mode
Use store-and-forward mode instead of cut-through mode to
allow for offloading of checksum calculation to the hardware.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-07-31 13:19:36 -04:00
Tim Pambor
6973302bbe drivers: dwc_mac: qos: Explicitly setup queue 0
Cores with multiple queues need to have queue 0 setup explicitly,
otherwise no queue will be available for RX/TX. As only a single
queue is used in this driver, setup queue 0 and assign the whole
fifo to it.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-07-31 13:19:36 -04:00
Tim Pambor
81de98d792 drivers: dwc_mac: qos: Set TX burst length to 32
Increase transmit burst length to 32 to improve performance.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-07-31 13:19:36 -04:00
Etienne Carriere
aa3187f793 drivers: Include include/zephyr/sys/clock.h
Header file include/zephyr/sys_clock.h is deprecated and will be removed
someday. Update the whole file tree to include zephyr/sys/clock.h
straight instead of zephyr/sys_clock.h.

This change was made running the sed shell command below:
$ sed -i 's/zephyr\/sys_clock\.h/zephyr\/sys\/clock\.h/' \
      `grep -rsl "zephyr/sys_clock\.h" drivers/`

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-07-30 07:45:05 -05:00
Fin Maaß
5a970c0367 drivers: ethernet: renesas: ra: fix seting pcfg
pcfg no longer exists in the data struct,
so don't set it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-30 11:29:09 +02:00
Duy Nguyen
ffb45155aa drivers: ethernet: Select nocache memory for RMAC
Add select NOCACHE_MEMORY as default when CACHE  and MPU is enabled

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2026-07-30 09:46:18 +02:00
Duy Nguyen
978f0b7359 drivers: ethernet: Fix RX and TX issue for Renesas RMAC
Add condition check for TX buffer StatusGet fail to notify network layer
to retry
Add HW buffer release on network packet allocate fail

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2026-07-30 09:46:18 +02:00
Duy Nguyen
ee980e98a0 drivers: ethernet: Enable zerocopy mode and add nocache option
This commit add Zerocopy operation for Renesas RA Ethernet driver
This also add buffer allocation into nocache region when CPU cache
is used to prevent incoherrency

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-07-30 09:40:28 +02:00
Nhat Ta
5dcdaf7050 drivers: ethernet: fix phy link up in fixed-link mode
Remove unnecessary PHY instance and fix PHY link-set callback order

Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-07-30 09:40:28 +02:00
Nhat Ta
57f9a6068f drivers: ethernet: seperate pinctrl block and add clock source
This commit seperates pinctrl blocks for mdio node and ethernet node,
also add clock source for ethernet node.

Signed-off-by: Nhat Ta <nhat-minh.ta.yn@bp.renesas.com>
2026-07-30 09:40:28 +02:00
Fin Maaß
c735818afe net: ethernet: move net_lldp_set_lldpdu
move net_lldp_set_lldpdu into the
common ethernet_init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-29 16:54:30 -07:00
Fin Maaß
53e91367be drivers: dwc_mac: qos: try refill in irq
try refilling rx in the interrupt if possible

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-29 08:14:37 -07:00
Fin Maaß
a9db14e690 drivers: ethernet: dwc_mac: qos: put two fragments in tx desc
put two tx fragments in one descriptor.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-29 08:14:37 -07:00
Muhammad Waleed Badar
379d3fc18b drivers: ethernet: add broadcom genet driver support
Add Ethernet driver for the Broadcom GENET MAC controller
found on the BCM2711 SoC, targeting the rpi_4b board.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-28 12:33:48 -07:00
Muhammad Waleed Badar
352d598beb drivers: mdio: add broadcom genet mdio driver support
Add  MDIO driver for the Broadcom GENET MDIO controller,
used to access the PHY attached to the BCM2711 GENET MAC.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-07-28 12:33:48 -07:00
Fin Maaß
27b92415e0 drivers: ethernet: dwc_mac: 1000: enable APCS
Enable Automatic pad/CRC stripping (APCS) for
packets that have a ethertype/lenght <= 1500.
The other option (CSTF) only strips the
FCS for a ethertype greater than 0x0600 (1536).

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
4ecd8fc57f drivers: ethernet: dwc_mac: improve help for ETH_DWC_ETHER_TX_HW_CHECKSUM
improve help for ETH_DWC_ETHER_TX_HW_CHECKSUM

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
3216cbd735 drivers: ethernet: dwc_mac: 1000: only log tx/rx errors on debug
rx and tx errors can happen durring normal
operation, but are not fatal, so we only
log them with debug level to not confuse
the users

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
94ed34cf09 drivers: ethernet: dwc_mac: check return code of net_recv_data
When net_recv_data returns a negative value,
we have to do a net_pkt_unref ourself in
the ethernet driver.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
267f61a77d ethernet: dwc_mac: esp32p4 support
add support for the esp32p4

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-28 12:31:19 -07:00
Fin Maaß
fe3f536196 drivers: ethernet: dwc_mac: 1000: log hardware features
log the hardware features

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
745cdd10c7 drivers: ethernet: dwc_mac: esp32: add support
add support for the esp32 in the generic
dwc_mac driver.
esp32 specific code is based
the init of the original esp32 eth driver in zephyr.

The esp32 uses HW version 3.70.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
545dc18be7 drivers: ethernet: dwc_mac: add define for region
on some socs, the dma and mac registers are
in a different order, add the possibility to change that.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-28 12:31:19 -07:00
Fin Maaß
a57c3251a9 drivers: ethernet: stm32: use snps,dwmac-ptp-clock
Use the new compatible snps,dwmac-ptp-clock
for the existing stm32 ptp driver.

Signed-off-by: Fin Maaß <info@finmaass.de>
2026-07-27 11:41:39 -07:00
Tony Han
f0887a4c48 drivers: ethernet: phy: lan8840: using the same driver for ksz9131
Add Gigabit Ethernet Transceiver LAN8840 support, using ksz9131's
driver for it.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-07-27 11:35:45 -07:00
Tony Han
73b9b3ffb4 drivers: ethernet: sam_gamc: update for supporting sama7d65 SoCs
Update the sam_gmac and mdio_sam.c for supporting Microchip SAMA7D65
SoCs.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-07-27 11:35:45 -07:00
Tony Han
107a7a1d9b drivers: ethernet: sam_gamc: update SOC_SAMA7G54 to SOC_SERIES_SAMA7G54
Update "CONFIG_SOC_SAMA7G54" to "CONFIG_SOC_SERIES_SAMA7G5" in "#ifdef"
for more flexible use of the drivers.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-07-27 11:35:45 -07:00
Mathieu Choplain
050d2da2a6 drivers: ethernet: nxp_imx_netc: use autogenerated Kconfig variable
Instead of manually defining a variable for the compatible's name, use
the one that gets autogenerated upon build.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-07-27 14:43:22 +02:00
Flavio Ceolin
e5a673421b drivers: ethernet: stm32: combine OR'd DMA error checks
(dma_error & A) || (dma_error & B) || ... is equivalent to
dma_error & (A | B | ...). Collapse the rx/tx ETH_DMASR_* error tests
into single masked checks.

Signed-off-by: Flavio Ceolin <flavio@hubble.com>
2026-07-25 11:54:45 -07:00
Fin Maaß
2e6e001f73 drivers: ethernet: use net_pkt_frag_unref
use net_pkt_frag_unref instead of net_buf_unref,
so the allocation tracking information is correct

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-07-25 17:10:00 +02:00
Benjamin Cabé
77b6f75d30 drivers: ethernet: dwc_xgmac: Flush only the sent bytes on TX
The TX path flushed a fixed CONFIG_NET_BUF_DATA_SIZE per fragment
though the DMA reads only frag->len. Flush only frag->len bytes.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-24 14:09:08 +02:00
Benjamin Cabé
8a95923776 drivers: ethernet: dwc_xgmac: Hoist TX frame length
net_pkt_get_len() was called for every fragment, walking the chain
each time. Compute the frame length once before the descriptor loop.

Assisted-by: Claude:opus-4.8
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-07-24 14:09:08 +02:00