Commit graph

1,364 commits

Author SHA1 Message Date
Declan Snyder
51f457088d drivers: ksz8081: Start monitoring phy after init
For some reason, a regression happened where the phy monitor was never
happening. Fix by starting the monitor at the end of init function. The
monitor will then reschedule itself from then on.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-11-01 08:38:28 -04:00
Alberto Escolar Piedras
0528554720 drivers/ethernet/eth_native_tap: Fix use of deprecated kconfig
In 200b886d3c a deprecated kconfig
option was brought back into the driver.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-28 17:40:51 +02:00
Tony Han
9b66f72191 drivers: ethernet: sam_gmac: update for support RGMII mode
Update to use the RGMII mode which is supported by SAMA7G54.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-24 13:28:18 -04:00
Tony Han
3036fa88dd drivers: ethernet: phy: ksz9131: save link state for get
Get the link state in the monitor and save it for get_link api
implementation to use.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-24 13:28:18 -04:00
Tony Han
034ce6927c drivers: ethernet: phy: ksz9131: add getting status for gigabit mode
Read gigabit status from Master Slave Status Register.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-24 13:28:18 -04:00
Tony Han
e7cfa722c4 drivers: ethernet: phy: ksz9131: add support for phy 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-10-24 13:28:18 -04:00
Tony Han
b305faff1f drivers: ethernet: phy: add Microchip's KSZ9131 PHY support
Add support for KSZ9131 (Gigabit Ethernet Transceiver with RGMII Support).
As first starter, 100MBit/s mode is tested.
https://www.microchip.com/en-us/product/ksz9131

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-24 13:28:18 -04:00
Julien Racki
4197931643 drivers: ethernet: stm32: add PTP HAL flag for N6
Add depends on SOC_SERIES_STM32N6X to
PTP_CLOCK_STM32_HAL in order to use PTP on the STM32N6 series.

Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2025-10-24 13:18:02 -04:00
Tony Han
ac1c5bb1af drivers: ethernet: sam_gmac: update for support sama7g54
Use proper settings of clock, data bus width for sama7g54.
Update queue number checking and the macro definition in header file.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-23 10:39:50 +02:00
Tony Han
0c1f48ebc2 drivers: ethernet: sam_gmac: add GMAC Reference Clock support
Add property for selecting the source for GMAC Reference Clock to dts
bindings yaml file.
Choose the source for the GMAC Reference Clock by GMAC_UR register.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-23 10:39:50 +02:00
Tony Han
b33f7bd06b drivers: ethernet: sam_gmac: use sys_cache_data_foo() for coherence
Replace cache coherence functions:
 - SCB_InvalidateDCache_by_Addr() to sys_cache_data_invd_range()
 - SCB_CleanDCache_by_Addr() to sys_cache_data_flush_range()

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-10-23 10:39:50 +02:00
Venkatesh Odela
44b6327fb8 drivers: ethernet: phy: ti_dp83867: Fix warnings
Wrapp the 'done:' label with #if DT_ANY_INST_HAS_PROP_STATUS_OKAY
to avoid unused label warnings when reset_gpios is not defined.

Move declaration of 'val' under the corresponding #if block to limit
its scope and prevent “unused variable” warnings.

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2025-10-22 08:56:01 +02:00
Declan Snyder
bc9869851b drivers: eth_nxp_enet: Fix power mode control
The driver should not take the whole interface down and re-initialize on
every low power entry and exit. This is a lot of latency for no real gain
as far as I can tell. We can just do as the reference manual actually says
which is to set the sleep enable bit to put the module to sleep while still
being able to detect magic packets for wake on LAN.

Also, the only platform that this power action was "enabled" for was
kinetis, but that platform does not have any power management enabled in
Zephyr.  Which means this code was never getting called even with all the
PM configs on.  So basically this code is dead code. But it could be useful
for other platform, such as RT, so there's no reason not to remove the
dependency on kinetis and let it be used for any of the platform as long as
PM_DEVICE is enabled (hence the imply).

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-21 12:24:16 -04:00
Tim Pambor
91d3d95313 drivers: ethernet: adin1100: add support for hardware reset
Add support for hardware reset via GPIO in the ADIN1100 PHY driver.

The reset pin is configured via device tree using the reset-gpios
property.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-10-21 14:16:38 +03:00
Immo Birnbaum
61c9cbbbf1 drivers: ethernet: xlnx_gem: obtain AMBA AHB bus width from config register
Obtain the value for the AMBA AHB bus width (32 bit/64 bit/128 bit) from
the design_cfg5 register at init-time rather than specifying it in the
respective SoC's DT.

Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
2025-10-21 11:43:03 +03:00
WenBin Zhang
9094e026f7 drivers: ethernet: eth_stm32 add tx async mode
Enable TX transmission asynchronous mode to enhance performance

Tested on the nucleo_h743zi board using samples/net/zperf

west build -b nucleo_h743zi/stm32h743xx samples/net/zperf/ --pristine
-- -DCONFIG_NET_CONFIG_MY_IPV4_ADDR=\"192.168.1.199\"

upload cmd:
```
//linux
iperf -s -l 1K -p 5001
iperf -s -l 1K -p 5002 -u

//shell
zperf tcp upload 192.168.1.109 5001 10 1K
zperf udp upload 192.168.1.109 5002 10 1K 300M
```

download cmd:
```
//shell
zperf tcp download 5001 192.168.1.199
zperf ucp download 5002 192.168.1.199

//linux
iperf -l 1K -c 192.168.1.199 -p 5001
iperf -l 1K -c 192.168.1.199 -p 5002 -u
```

before:
udp upload:   73.5Mbps/s
tcp upload:   71.3Mbps/s
udp download: 93.9Mbps/s
tcp download: 70.5Mbps/s

after:
udp upload:   92.2Mbps/s
tcp upload:   78.1Mbps/s
udp download: 93.7Mbps/s
tcp download: 75.2Mbps/s

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-10-20 14:23:56 -04:00
WenBin Zhang
ab093c29c9 drivers: ethernet: eth_stm32 tx_in_sem limit set to 1
tx_int_sem serves solely as a signal indicator and does not require signal
counting. Within eth_stm32_tx, the semaphore is reset each time a packet
is transmitted. Upon receiving the transmission completion signal, the
function exits. Signal counting is unnecessary. Change to a binary
semaphore.

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-10-20 14:23:56 -04:00
Declan Snyder
3f66f0ba08 drivers: ksz8081: Fix fault on boot in handler thread
Issue was that the gpio interrupt was happening before the work item was
initialized, and then trying to schedule it, resulting null pointer
dereference and fault occurring.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-17 21:05:44 -04:00
Declan Snyder
57312acd18 drivers: ksz8081: Remove 100ms busy waits
These busy waits were only introduced during a debugging exercise and
not supposed to have made their way into mainline.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-17 21:05:44 -04:00
Thomas Decker
0cd6f90da6 drivers: ethernet: stm32: Add support for SOC H7RS-Family
Add SOC_SERIES_STM32H7RSX to applicable Kconfig parameters and enable
use of .eth_stm32_desc and .eth_stm32_buf linker sections for ethernet
dma.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
2025-10-17 22:01:03 +03:00
Sylvio Alves
4eeb8fa95e mdio: esp32: fix gpio0 clock output
When GPIO0 is set as RMII clock, configure its
mux to clockout properly.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-10-17 17:03:41 +03:00
Qiang Zhao
56098d60b4 drivers: dsa_nxp_imx_netc: add Qbv capability
add Qbv capability for dsa_nxp_imx_netc

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
d507bf9a37 drivers: dsa_nxp_imx_netc: add DSA Qbv support
Add DSA Qbv support, add set_config/get_config to set and get
Qbv configuration. support enable/disable, set/get times,
set/get list length and set/get gate control list.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Marcelo Roberto Jimenez
a96a4e7ee3 drivers: ethernet: Allow changing the MAC address of the slip interface
This patch adds the necessary switch option to the slip configuration
callback to enable the dynamic configuration of the MAC address of this
interface.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2025-10-16 17:11:55 +03:00
Etienne Carriere
617335951f drivers: ethernet: stm32: add missing empty line
Add missing empty line between local variable definitions and
instructions in eth_stm32_set_mac_config().

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-10-13 11:27:34 -04:00
Etienne Carriere
97ec44c909 drivers: ethernet: stm32: clean HAL_ETH_{Set|Get}DMAError() value test
Clean tests on HAL_ETH_SetDMAError() and HAL_ETH_GetDMAError() return
value to explicitly test against 0.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-10-13 11:27:34 -04:00
Etienne Carriere
83b1e12f4a drivers: ethernet: stm32: test HAL return value
Add missing test of some HAL functions return value

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-10-13 11:27:34 -04:00
Marcelo Roberto Jimenez
47e7b7b2b5 drivers: ethernet: Add promiscuous mode to slip interface
Slip is naturally promiscuous, so this patch does nothing but
acknowledge that. Promiscuous mode in slip is important to allow
the interface to be added to a bridge.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2025-10-13 09:37:56 -04:00
Marcelo Roberto Jimenez
074f4db67a drivers: ethernet: Run clang-format before applying a patch
This patch just formats the file before the real patch so that
whitespace changes do not mix with the real code changes.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2025-10-13 09:37:56 -04:00
Marcelo Roberto Jimenez
7899951c94 drivers: ethernet: Add promiscuous mode to xmc4xxx
This patch adds promiscuos mode to the XMC4xxx SOC's ethernet driver.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2025-10-13 08:55:05 +02:00
Marcelo Roberto Jimenez
ef42928c50 drivers: ethernet: Run clang-format before applying a patch
This patch just formats the file before the real patch, otherwise
the changes would be hard to read.

The only addition was a third parameter (NULL) to all the usages
of the macro WAIT_FOR, since the dangling comma triggered conflicts
between clang-format and check_compliance.py.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2025-10-13 08:55:05 +02:00
Siddhant Modi
41a35defc6 drivers: ethernet: eth_w5500
Fixes zephyrproject-rtos/zephyr#97217

Added new MONITOR_PERIOD config for W5500 driver
to remove dependency from ETH_PHY_DRIVER.

Signed-off-by: Siddhant Modi <siddhant.modi@gmail.com>
2025-10-10 20:50:50 -04:00
Anas Nashif
bf82f7ffac copyrights: fix copyright line
Add space before (c) to allow correct parsing by linters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-07 22:53:45 -04:00
Erwan Gouriou
47ed50c31c drivers: ethernet: stm32n6: Use zephyr symbol for alignment attribute
Rather than symbol coming from the HAL, use zephyr `__aligned()` macro.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-10-03 12:49:14 +03:00
Erwan Gouriou
36192a4053 drivers: ethernet: stm32n6: Remove attributes from extern definitions
Compilers may not like that attributes are provides in actual and extern
definitions of symbols.
Removing them from extern definitions

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-10-03 12:49:14 +03:00
Erwan Gouriou
4a875c0b39 drivers: ethernet: stm32n6: Fix phy modes declarations
Phy modes declarations where not correctly placed for use with N6 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-10-03 12:49:14 +03:00
Alberto Escolar Piedras
9f00584eab drivers eth_native_tap: Set socket to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Declan Snyder
570b445a61 drivers: Convert to use SPI macro without delay parameters
Convert all drivers and other consumers to use SPI macros without the
delay parameters.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-01 14:39:36 +03:00
Erwan Gouriou
522bfd5b56 drivers: ethernet: stm32: #include sections cleanup
Clean up headers includes section:
- Remove conditional inclusions
- zephyr/, then susbystem/, standardlib, locals
- Sort alphabetically within these categories
- Remove the ones already available through _priv.h

Noticeable exception, lldp.h requires prior net_pkt.h inclusion

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
ca6e25a03f drivers: ethernet: Move back hal_init_v2 to driver init
Since phy init is not in this function anymore, it can be moved back
to driver initialization function.

While I'm at, harmonize v1/v2 flavors of the function.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
03eafc5381 drivers: ethernet: stm32: Remove eth_stm32_get_iface
Now that the function is not static anymore, it just adds useless overhead.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
967f554598 drivers: ethernet: stm32: Rename functions that are not static anymore
To be able to split code, some functions were removed their static
attribute, which opens the possibility of name conflict.
Rename them by adding eth_stm32_ prefix.

Additionally, review their sorting in the header file.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
d1d1e5744f drivers: ethernet: stm32: Split v1 and v2 code
Split V1 and V2 code from the common file of STM32 ethernet
driver.
Whenever it is possible, make use of v1 or v2 version of functions
that are call from the common file in order to maximize factorization.

Review definitions to put them where they are used.
Review header inclusions to minimize them.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
2f23eb2c98 drivers: ethernet: stm32: Split ptp functions into a dedicated source file
In an effort to make stm32 eth driver files easier to read and maintain,
split the ptp code in a dedicated file.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
b1a9e39006 drivers: ethernet: Rename eth_stm32_hal.c to eth_stm32hal_common.c
Keep the history on the common file before splitting v1 and v2 code from
it.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
4429626758 Revert "drivers: ethernet: rename eth_stm32_hal.c -> eth_stm32_hal_v2.c"
This reverts commit 678e226045.
This commit was part of PR 94142 which has been merged
while a discussion was still on going on the right direction
between splitting V1 and V2 or keeping a common file.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Erwan Gouriou
88298ae555 Revert "drivers: ethernet: eth_stm32 v1/v2 are placed in separate files"
This reverts commit 29750ac05d.
This commit was part of PR 94142 which has been merged
while a discussion was still on going on the right direction
between splitting V1 and V2 or keeping a common file.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-30 15:27:23 +03:00
Yangbo Lu
bdb5c3072a drivers: eth_nxp_imx_netc: add promisc mode support
Added promisc mode support for eth_nxp_imx_netc.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-26 11:07:34 +02:00
Jeremy Truttmann
a5bacc757c drivers: ethernet: lan865x: enable PHY access through generic ethernet_api
This is needed for accessing the PHY device through the Ethernet
network interface.

Signed-off-by: Jeremy Truttmann <jetstreeam.code@outlook.com>
2025-09-22 13:35:28 -04:00
Jilay Pandya
c7dc59f46d drivers: ethernet phy_dm8806_read_reg reduce nested-ifs
reduce if nesting a bit using early break

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-09-19 21:24:23 +02:00