Commit graph

1,364 commits

Author SHA1 Message Date
Jilay Pandya
9992eb90cb drivers: ethernet: phy_dm8806 fix unchecked return value
Check the return values and log them with error loglevel

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-09-19 21:24:23 +02:00
Yangbo Lu
7e9ed6e579 drivers: ethernet: dsa_nxp_imx_netc: support PTP timestamping
Supported PTP timestamping. Now only gPTP was supported.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-15 14:06:56 -04:00
Yangbo Lu
600443a6b1 drivers: ethernet: nxp_imx_netc: support receiving more types frames
Supported receiving more types frames. One was TX timestamp response
frame and the other one is RX timestamped frame which were for switch
port.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-15 14:06:56 -04:00
Yangbo Lu
ee6b20e8c2 drivers: ethernet: nxp_imx_netc: handle ports without PTP clock enabled
PTP clock may be enabled per Ethernet port. Especially pseudo port for
switch management does not need PTP clock.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-15 14:06:56 -04:00
Jakub Klimczak
91ac587124 drivers: ethernet: Add VIRTIO Network Device
Add a driver for the VIRTIO Ethernet device.
This is a minimal driver which sets a MAC address and transmits packets,
but does not support any extra features like the control channel or
checksum offloading.
Confirmed to work with the networking subsystem samples. For example, the
zperf sample shows a result of 85 Mbps download and 14 Mbps upload.

Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com>
2025-09-15 14:44:58 +02:00
WenBin Zhang
29750ac05d drivers: ethernet: eth_stm32 v1/v2 are placed in separate files
v1/v2 are placed in separate files and prepare to add
asynchronous sending functionality for V2

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-09-13 18:15:10 -04:00
WenBin Zhang
678e226045 drivers: ethernet: rename eth_stm32_hal.c -> eth_stm32_hal_v2.c
Plan to restructure eth_stm32_hal into two files, eth_stm32_v1
and eth_stm32_v2, while retaining the git history of v2.

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-09-13 18:15:10 -04:00
WenBin Zhang
5acec12d92 drivers: ethernet: eth_stm32_hal split v1 and v2
Split the codes of v1 and v2.

V1 supports F1/F2, while v2 supports F4/F7/H5/H7/N6.

This makes it easier to understand and add new functions.

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-09-13 18:15:10 -04:00
Adib Taraben
27711e69d3 eth_nxp_enet_qos_mac: adapt MAC configuration to actual PHY link speed
This adjust the MAC CONFIGURATION register settings to 10MBit/s if needed.
The reduction is needed for 10MBit only PHYs.

Signed-off-by: Adib Taraben <theadib@gmail.com>
2025-09-12 18:30:30 +02:00
Yangbo Lu
5aaf69e145 net: ethernet: make inclusion relation clear for DSA and Ethernet headers
DSA is part of Ethernet and will utilize more Ethernet definitions for
more features support. So, it's proper to let DSA header include
Ethernet header with moving some DSA definiton from DSA header to
Ethernet header and adding DSA header including in c files using DSA
definition.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-12 13:19:41 +02:00
Yangbo Lu
0501be8090 net: ethernet: use void pointer for dsa switch context
In ethernet_context structure, it just needs a void pointer
for dsa switch context.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-12 13:19:41 +02:00
Tony Han
9b7d73cf67 drivers: ethernet: ksz8081: fix compiling error about missing variable
The missing variable "config" in phy_mc_ksz8081_cfg_link() maybe
used by the macro "USING_INTERRUPT_GPIO", add the variable to avoid
compiling errors.

fixes: #95492

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-09 21:42:38 -07:00
Immo Birnbaum
4ef8e14297 drivers: ethernet: xlnx_gem: invert RX/TX checksum offload behaviour
Invert the RX/TX checksum offloading to hardware behaviour so that
hardware checksum generation / evaluation for TCP/UDP packets on
either IPv4 or IPv6 is enabled by default, but can be disabled
explicitly.

This behaviour, which should optimize network performance, has
become possible with the implementation of the device driver's
get_config function, indicating to the network stack that HW
checksum offloading is not supported for, e.g., ICMP packets.
Before this implementation, enabling the HW checksum offloading
resulted in invalid packets for any unsupported protocol and
could therefore not be enabled by default.

For QEMU, which does not support the emulation of the HW
checksum offloading, automatically disable the offloading.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-09-08 15:51:57 -04:00
Yangbo Lu
45cde66a02 drivers: eth_nxp_imx_netc: initialize vlan control
Initialized vlan control for ENETC.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-05 13:46:45 +02:00
Jiafei Pan
c10f64c97f drivers: dsa: netc: add mmio memory mapping support
Added memory mapping for the driver to support A-Core.
Add update related device tree accordingly.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-09-05 07:43:28 +02:00
Jiafei Pan
1b6e15f4ee drivers: netc_blk: add imx943 support
Add NETCMIX block initialization for i.MX 943.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-09-05 07:43:28 +02:00
Tony Han
1fd4886ad9 drivers: ethernet: phy: ksz8081: add support for interrupt mode
Enable Link-Up and Link-Down interrupts. On the interrupt handling
the monitor work is scheduled to update the link status and calling
corresponding callback routine.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-04 11:26:38 +02:00
Tony Han
44845e16b6 drivers: ethernet: ksz8081: move init_int_gpios() to after reset
Call ksz8081_init_int_gpios() after phy_mc_ksz8081_reset() due to
keep the configurations for interrupt.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-04 11:26:38 +02:00
Tony Han
e2113ce2c5 drivers: ethernet: ksz8081: fix internal flags for auto-negotiation
Update the internal driver flags to avoid setting DO_AUTONEG_FLAG
unconsciously when setting LINK_STATE_VALID.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-04 11:26:38 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Tony Han
06fc36e496 drivers: ethernet: sam_eth: get the register address from parent node
Get the register address from the common parent node as the device
tree updated in the last commit.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-09-03 08:56:44 +02:00
Adib Taraben
4ca352b052 phy_adin2111.c: correctly assign state parameter with state from device
This fixes an unintialized variable access problem in callback.

Signed-off-by: Adib Taraben <theadib@gmail.com>
2025-09-03 01:18:54 +02:00
Declan Snyder
02b99470a3 drivers: ethernet: ksz8081: Save link state for get
Instead of using mdio bus for getting link state, only get it in the
monitor and save it off for get rate api implementation to use

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-29 18:19:17 +02:00
Declan Snyder
043ec3d9ee drivers: phy_ksz8081: Fix boot and link up
Two issues are being simultaneously address in this commit:

Issue 1:

Current issue is that zephyr boot / init is slow because it is blocked
by the phy ksz8081 init doing autonegotiation which can take on the
order of a few seconds.

Fix by now doing autonegotiation in the monitor handler instead of in
the cfg link call. The cfg link call will now only set the ANAR register
and a software flag to let the monitor handler know whether or not to
redo the autonegotiation sequence.

Issue 2:

The ksz8081 phy currently does not link up ever on cold boots on the NXP
RT platforms due to regression on mainline. My understanding of why is
not clear, but I found that re-setting the RMII override bit by the time
the monitor work handler runs with the change to fix the first issue,
makes the link come up.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-29 18:19:17 +02:00
Declan Snyder
be8a0f3d1e drivers: phy_ksz8081: Improve logging
Improve logging in the driver, using appropriate log levels.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-29 18:19:17 +02:00
Declan Snyder
aad41f8d66 phy: ksz8081: Minor refactor of init gpio code
Minor refactor to remove the #ifdefs inline in init function.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-29 18:19:17 +02:00
Ta Minh Nhat
4228444dd1 driver: ethernet: Add ethernet driver support for ra6m4 and ra6m5
Add ethernet support for RA6M4, RA6M5.
Add soc script for generating Renesas Partition Data (RFP file).

Signed-off-by: Ta Minh Nhat <nhat-minh.ta.yn@bp.renesas.com>
Singed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-08-28 13:58:33 +02:00
Michal Simek
7944467170 drivers: ethernet: xilinx: remove unused data variable
Clean up unused variable 'data' in eth_xilinx_axienet.c.

Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-08-26 22:08:23 +02:00
Fin Maaß
57c4a5572a drivers: ethernet: remove select MDIO
remove `select MDIO` from the
ethernet drivers, that don't directly use mdio
and only use the ethernet phy api, now that the
phys select MDIO

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-08-25 15:32:38 +02:00
Fin Maaß
e053f1aad5 drivers: ethernet: phy: select GPIO
devices on a bus are recomended to
select its needed drivers, apply this to the eth phys
that need gpios, so that they just work by
enableing the device in the dts.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-08-25 15:32:38 +02:00
Fin Maaß
f5bbdaf8e7 drivers: ethernet: phy: select MDIO
devices on a bus are recomended to
select its protocol, apply this to the eth phys
on the mdio bus, so that they just work by
enableing the device in the dts.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-08-25 15:32:38 +02:00
Sven Ginka
ddc4f5f0be drivers: ethernet: sy1xx: fix random mac
before that commit, random mac was used even when defining
zephyr,random-mac-address to false.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-08-25 13:32:03 +02:00
Sven Ginka
a79e986e03 drivers: ethernet: sy1xx: fix warning
casting the address to uint32_t removes the compiler warning.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-08-25 13:32:03 +02:00
Sven Ginka
63299bb68b drivers: ethernet: sy1xx: fix static prototype
removed invalid arguments.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-08-25 13:32:03 +02:00
Luis Ubieda
5945a3fcd1 ethernet: nxp: Scrub tx_header
As it's not being used anywhere in the driver. Moreover, the extra
unref would trigger a double-free assert (#94311); which is what
motivated this cleanup.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-08-23 05:11:35 +02:00
Sven Ginka
410ce46578 drivers: ethernet: vsc8541: fix init
added missing config.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-08-21 17:06:21 +02:00
Pieter De Gendt
f1b4c7c992 drivers: ethernet: nxp_imx_netc: Fix LAA bit location
The Locally Administered Address (LAA) bit should be set on the first
octet of the MAC address.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-20 09:29:14 +02:00
Pieter De Gendt
300016c801 drivers: ethernet: stm32: Set LAA bit on MAC address based on device ID
The MAC addressed derived from the device ID is not assigned by the
manufacturer and therefor the Locally Administered Address (LAA) bit should
be set.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-19 19:14:45 +02:00
Alain Volmat
5017279493 drivers: ethernet: dwmac_stm32h7x: add select PINCTRL
stm32 dwmac_stm32h7x driver is relying on the pinctrl framework
hence select CONFIG_PINCTRL to ensure proper build.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-08-18 17:49:28 +02:00
Yangbo Lu
7c9c8d8f44 drivers: dsa_nxp_imx_netc: add tag protocol support
Added tag protocol support.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
a5f612b86a drivers: eth_nxp_imx_netc: allow to transmit DSA tag frame
Allowed to transmit DSA tag frame.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
b3e4dc1c9d drivers: ethernet: move NXP NETC DSA driver to dsa directory
Moved NXP NETC DSA driver to dsa directory.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
560249bcbc net: dsa: move DSA core options to subsystem
Moved DSA core options to subsystem.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-13 22:09:50 -04:00
Yangbo Lu
dd19dcb53b drivers: eth_xmc4xxx: adjust ptp clock rate based on nominal frequency
Adjusted ptp clock rate based on nominal frequency.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-08 10:44:44 -05:00
Yangbo Lu
2d82a0dcab drivers: eth_e1000: adjust ptp clock rate based on nominal frequency
Adjusted ptp clock rate based on nominal frequency.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-08 10:44:44 -05:00
Yangbo Lu
76b7bcc0b2 drivers: eth_stm32_hal: adjust ptp clock rate based on nominal frequency
Adjusted ptp clock rate based on nominal frequency.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-08-08 10:44:44 -05:00
Khoa Nguyen
836e55f724 drivers: ethernet: Update the variable type for R_ETHER_CallbackSet
- Update the variable type for R_ETHER_CallbackSet in
eth_renesas_ra.c
- Update HAL callback event handler to be compatible with FSP 6.0.0

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
Signed-off-by: Ta Minh Nhat <nhat-minh.ta.yn@bp.renesas.com>
2025-08-08 11:52:13 +03:00
Declan Snyder
b901daa8e2 eth_nxp_enet_qos: Fixup logging in driver
Some of the logging was not very useful and missing info, some were the
wrong level. Such as routine drops of packets, this happens sometimes
and is not ideal but not going to cause things to fall apart, so demote
those messages. RX buffer underrun for example is pretty unavoidable
with enough traffic going on the local network.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-06 12:11:38 +03:00
Declan Snyder
6267ec59ef drivers: eth_nxp_enet_qos: Move RX underrun code
Extract the RX underrun handle code to a separate function.

Named the function like "dma_rx_resume" to make it clear what the
function is really supposed to do.

Demote the error about not being a first descriptor to a warning.
Because most likely we already got an error about something else which
caused us to drop the packet in the first place. The rest of the frames
are expected to be dropped. And make the string shorter.

Also remove the debug message because the control bits do not tell us
any more information than we don't know already. They only tell us that
we own the descriptor (known since we are processing the frame), that it
is not a first descriptor (known since that is the reason we would drop
it at this point, as indicated by the warning).

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-06 12:11:38 +03:00
Declan Snyder
735412b59c drivers: eth_nxp_enet_qos: Update as many desc as possible
Instead of looping through only the amount of descriptors there are,
maybe it is possible to get some more things received in one work item
than even the max number of descriptors if RX is processed fast enough,
instead of waiting for work to be scheduled again.

So change to go around the ring until we actually hit a DMA owned
descriptor.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-08-06 12:11:38 +03:00