Commit graph

1,620 commits

Author SHA1 Message Date
Alain Volmat
d671e3f675 drivers: stm32: remove all HAL_RIF_ calls from stm32 drivers
RIF configuration is now done at soc init time in a centralized
way so it is no more necessary for drivers to perform this
configuration.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-12-11 09:18:38 +02:00
Marcelo Roberto Jimenez
ce99d1e428 drivers: ethernet: stm32hal: Fixes source address control
The default configuration for all STM32 microcontrollers in HAL is
to replace the ehternet MAC address with the address configured in
replace address zero. In "modules/hal", Grep for:

macDefaultConf.SourceAddrControl = ETH_SOURCEADDRESS_REPLACE_ADDR0;

But this is a bad thing for bridging. Since Zephyr ethernet LL code
always writes the source address, this patch has no impact on normal
operation. And has the benefit of maintaining the source MAC address
of bridged packets.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2025-12-10 17:36:47 +00:00
Pieter De Gendt
ea85a8b841 drivers: ethernet: eth_lan865x: Support MAC address config
Update the microchip,lan865x ethernet driver to use a MAC address
configuration struct.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-10 07:24:43 -05:00
Pieter De Gendt
e3882162cf drivers: ethernet: litex: Support MAC address config
Update the litex,liteeth ethernet driver to use a MAC address configuration
struct.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-09 22:39:53 -05:00
Pieter De Gendt
f75ba50de6 drivers: ethernet: sensry: Support MAC address config
Update the sensry,sy1xx-mac driver to use a MAC address configuration
struct.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-09 22:38:23 -05:00
Pieter De Gendt
00b051dd76 drivers: ethernet: sensry: Fix phy handle instance
Fix ethernet PHY handle in case of multiple instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-09 22:38:23 -05:00
Julien Racki
dc7f445dbd drivers: ethernet: stm32: Add generic helper functions
This commit introduces helper functions to avoid having large
#if DT_HAS_COMPAT_STATUS_OKAY ... #else blocks,
improving readability.

Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2025-12-09 09:52:43 -05:00
Charles Hardin
b38a46bade drivers: ethernet: lan9250: add in the reset gpio configurate
The reset gpio field was in the config structure but was not coded
into the initialization path. So, add the appropriate code to handle
the gpio setup when it is defined in the device tree.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-12-09 09:25:15 +01:00
Charles Hardin
855631aeba drivers: ethernet: lan9250: add support for a random mac address
Extend the lan9250 driver to support using a local administered
unicast random mac address during init. This follows the device tree
settings for zephyr_random_mac_address from other ethernet drivers
for the added support.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-12-09 09:25:15 +01:00
Jukka Rissanen
e2fa01d2c1 drivers: ethernet: intel_igc: Use net namespaced APIs
One POSIX symbol was not converted to network namespaced API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-12-08 06:12:04 -05:00
Yangbo Lu
216695e91b drivers: eth_nxp_imx_netc: fix wrong irq_lock area in netc_eth_rx
The irq_lock area including net_pkt_rx_alloc_with_buffer() was causing
error "Context switching while holding lock!".
Actually we didn't have any hardware access to protect in netc_eth_rx,
so just removed irq_lock.

Fixes #99694

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-12-06 07:10:46 -05:00
Fin Maaß
8f8071a546 drivers: ethernet: phy: split generic phy
moves the fixed link functionality of the
generic ethernet phy into its own driver.
This makes both drivers more readable and
efficient.

Also makes it easier to use the normal generic
phy as a base for a vendor specific driver, as
the fixed link functionality is not needed on
them.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-05 11:10:46 -05:00
Fin Maaß
a21fdccd50 drivers: ethernet: nxp: allow driver to be build without mdio
allow driver to be build without mdio,
implemented similar to ptp.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-05 11:10:46 -05:00
Julien Racki
dc6d5ae970 drivers: ethernet: stm32: Add Port Selection
Add Port Selection for the N6 series.
This allows to run ethernet at 10mbs, 100mbs or 1000mbs.

Signed-off-by: Julien Racki <julien.racki-ext@st.com>
2025-12-05 13:39:24 +02:00
Fin Maaß
4ae9e45db9 drivers: ethernet: phy: also set autoneg_in_progress for already on init
also set autoneg_in_progress for already on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-01 19:47:37 -05:00
Fin Maaß
5da33001d2 drivers: ethernet: phy: check auto negotiation completion directly
auto negotiation might already be finished when we
check the link status, therefore check directly
instead of waiting 100 ms.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-01 19:47:37 -05:00
Fin Maaß
e92adb56b2 drivers: ethernet: phy: improve reading of latched bits
The latched bits are defined in the ethernet specification,
as the only latched bit, that we use, is the link status, improve
the code for it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-01 19:47:37 -05:00
Fin Maaß
570c658f51 drivers: ethernet: phy: let the compiler remove checks for cfg->fixed
let the compiler remove checks for cfg->fixed if we don't have any
fixed link.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-01 19:47:37 -05:00
Fin Maaß
c99e3413ea net: mii.h: provide the BMSR bits positions
provide the BMSR bits positions, so we can use
the `IS_BIT_SET` macro with them.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-01 19:47:37 -05:00
Pieter De Gendt
fb6e2c5065 drivers: ethernet: Add doxygen to net_eth_mac_load and move to public API
Add missing doxygen brief to the net_eth_mac_load helper function.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-01 12:24:54 -05:00
Yangbo Lu
92decb6273 drivers: eth_nxp_imx_netc: support PTP timestamping for no-tag switch
Added PTP timestamping support in NETC ENETC host driver for no-tag
supported NETC switch.

On RX path, extended descriptor is used on host (pseudo MAC) to get
timestamp writeback.

On TX path, TX timestamp response should be enabled on host (pseudo MAC).
After TX, writeback TX timestamp ID should be updated to tx pkt fifo.
Once RX path received TX timestamp response, match TX timestamp to tx
pkt in fifo with the timestamp ID.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-12-01 11:09:01 +01:00
Yangbo Lu
b2b0c9d4e1 drivers: dsa_nxp_imx_netc: support PTP timestamping for no-tag switch
For NETC switch with tag support, PTP timestamping had already been
supported in tag driver.

This patch is to add PTP timestamping support for no-tag supported switch.
Timestamp functions are implemented and exported for host driver to
handle.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-12-01 11:09:01 +01:00
Yangbo Lu
b693f3ca2d drivers: eth_nxp_imx_netc: improve PTP timestamping enablement
Converted to use NETC_PTP_TIMESTAMPING_SUPPORT for PTP timestamping.
PTP timestamping is needed only when NET_L2_PTP and PTP_CLOCK_NXP_NETC
are selected.

Used default 16 bytes for ETH_NXP_IMX_RX_RING_LEN for PTP timestamping
because RX extended descriptor would be used.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-12-01 11:09:01 +01:00
Yangbo Lu
5b8af91236 drivers: dsa_nxp_imx_netc: improve PTP timestamping enablement
PTP timestamping should be enabled only when NET_L2_PTP and
PTP_CLOCK_NXP_NETC are selected. And NET_PKT_CONTROL_BLOCK
is required for PTP timestamping code.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-12-01 11:09:01 +01:00
Fin Maaß
8fd4f987b3 drivers: ethernet: renesas: implement get_phy
implement get_phy for the renesas ethernet
driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-12-01 08:32:00 +01:00
Pieter De Gendt
09eeb734ca drivers: ethernet: eth_virtio_net: Support MAC address config
Update the virtio ethernet driver to use a MAC address configuration
struct.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-11-28 17:28:00 +00:00
Matthias Alleman
60fd112806 drivers: ethernet: phy: phy_mii: add gpio reset
Add support for hardware reset to the phy_mii driver

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2025-11-26 11:05:52 +00:00
Pieter De Gendt
cf0d1b877e drivers: ethernet: sam_gmac: Use ethernet MAC configuration
Rework the Atmel SAM GMAC driver to read a MAC address from the provided
NVMEM cell instead of using I2C commands directly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-11-25 16:21:30 +00:00
Pieter De Gendt
604efc4e0f drivers: ethernet: eth_test: Add MAC configuration support
Add structs to the vnd,ethernet test driver for MAC address configuration
support.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-11-25 16:21:30 +00:00
Pieter De Gendt
7bc538a8ee drivers: ethernet: Add Helper function to load MAC address
Given an ethernet MAC configuration struct, load a MAC address into a
provided array.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-11-25 16:21:30 +00:00
Jukka Rissanen
afedd24451 drivers: ethernet: net: Replace POSIX symbols by Zephyr ones
The native_sim Ethernet driver was still using POSIX symbols,
so convert these to use Zephyr ones.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-11-25 16:06:56 +00:00
Fin Maaß
374c745e3f drivers: mdio: remove mdio_bus_enable/mdio_bus_disable
remove mdio_bus_enable/mdio_bus_disable, as they are no
longer needed and make the mdio api simpler.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-11-22 05:12:18 -05:00
Pieter De Gendt
d43e592f04 drivers: ethernet: eth_sam: Fix BUF_TX_FRAME macro
Add missing n,x macro arguments.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-11-21 09:46:52 -05:00
Jukka Rissanen
e6daacf3c9 net: Convert Ethernet drivers to use renamed network APIs
Rename network symbols in Ethernet drivers to use the renamed network APIs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-11-17 14:01:32 -05:00
Josuah Demangeon
30950b888d style: drivers: sort Kconfig and CMake includes
Use the "zephyr-keep-sorted-start/stop" comment to have CI check
the alphabetical order of includes, to help reducing the chance
of conflicts while contributing drivers.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Josuah Demangeon
1b87ec87ef style: drivers: apply coding style on CMakeLists.txt files
Apply the CMake style guidelines to CMakeList.txt files in drivers/.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Hongbo Wang
e88a5310a4 drivers: eth: phy: add Motorcomm YT8521 PHY driver
Add PHY driver for Motorcomm YT8521 which is used on FRDM_IMX93 board.

Signed-off-by: Hongbo Wang <hongbo.wang@nxp.com>
Signed-off-by: Jiafei Pan <jiafei.pan@nxp.com>
Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2025-11-17 09:28:15 +02:00
Etienne Carriere
b0ccb2295f drivers: stm32: use STM32_CLOCK_INFO_BY_NAME() and friends
Use STM32_CLOCK_INFO(), STM32_DT_INST_CLOCK_INFO(),
STM32_CLOCK_INFO_BY_NAME() and STM32_DT_INST_CLOCK_INFO_BY_NAME()
helper macros in STM32 drivers.

Using these macros ensure the clock division factor is properly
populated according to DT information. Prior these changes some
drivers only got the bus and bits position information and missed
the clock division information which is fine only when this division
factor information is 0.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-14 15:26:17 +02:00
Parthiban Veerasooran
52b1e8704e drivers: ethernet: phy_microchip_t1s: use 'ret < 0' for error checks
Replace 'if (ret)' with 'if (ret < 0)' in the Microchip T1S PHY driver.
This change follows the legacy coding style commonly used in Zephyr
drivers, where error conditions are checked explicitly against negative
values. The affected functions do not return positive values, so this
modification does not change functionality. No functional change intended.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-11-14 10:30:53 +02:00
Parthiban Veerasooran
1843b3126d drivers: ethernet: phy: configure link status control for LAN867x Rev.D0
Configure the link status in the Link Status Control register for
LAN8670/1/2 Rev.D0 PHYs, depending on whether PLCA or CSMA/CD mode
is enabled. When PLCA is enabled, the link status reflects the PLCA
status. When PLCA is disabled (CSMA/CD mode), the PHY does not support
autonegotiation, so the link status is forced active by setting
the LINK_STATUS_SEMAPHORE bit.

The link status control is configured:
- During PHY initialization, for default CSMA/CD mode.
- Whenever PLCA configuration is updated.

This ensures correct link reporting and consistent behavior for
LAN867x Rev.D0 devices.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-11-14 10:30:53 +02:00
Parthiban Veerasooran
76034d043b drivers: ethernet: phy: add support for Microchip LAN867X Rev.D0 PHY
Add support for the LAN8670/1/2 Rev.D0 10BASE-T1S PHYs from Microchip.
The new Rev.D0 silicon requires a specific set of initialization
settings to be configured for optimal performance and compliance with
OPEN Alliance specifications, as described in Microchip Application Note
AN1699 (Revision G, DS60001699G – October 2025).
https://www.microchip.com/en-us/application-notes/an1699

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-11-14 10:30:53 +02:00
Alberto Escolar Piedras
031a3adaef drivers/ethernet/eth_native_tap: Remove deprecated kconfig options
The old native_posix ethernet was renamed to native_tap in
78f800642a
and its old kconfig options deprecated at the time (in 4.2)
Let's remove them now.

Note in this commit we move the defaults into their right place.
Defaults were set in the deprecated options so we could both
have the defaults and allow users to keep using the old options.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-11-13 20:43:53 -05:00
Arnaud Pouliquen
6c508cbd52 drivers: ethernet: stm32: add support of the stm32mp13
Add the support of the stm32mp13 ethernet:
- Adapt to HAL API
- Add support of a memory region in DT for descriptor and buffers
- Add support of PHY with/without crystal 50MHz

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Signed-off-by: Arif Balik <arifbalik@outlook.com>
2025-11-13 20:35:09 -05:00
Arnaud Pouliquen
b05a6f6344 drivers: ethernet: stm32: cleanup deprecated ETH_TxPacketConfig typedef
The typedef ETH_TxPacketConfigTypeDef is used consistently in the driver.
However, some instances of ETH_TxPacketConfig have not yet been replaced.
On the STM32MP13 series, the ETH_TxPacketConfig typedef is no longer
defined. This cleanup ensures compatibility and consistency.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2025-11-13 20:35:09 -05:00
Arnaud Pouliquen
e7a7639d1f drivers: ethernet: add initial support of the LAN8742 PHY
Add basic support of the LAN8742 RMII phy. The driver is inspired
from the phy_mii generic driver, with the support of a GPIO reset.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2025-11-13 20:35:09 -05:00
Tony Han
3c532c47f0 drivers: net: sam_gmac: add BUILD_ASSERT for checking GMAC_QUEUE_NUM
'GMAC_QUEUE_NUM' is a value of 'num-queues' for the first GMAC
instance getting from the device tree. It is used directly or
indirectly (by GMAC_PRIORITY_QUEUE_NUM) for defining and
initializing 'struct eth_sam_dev_data' with a value from Kconfig
(GMAC_ACTIVE_PRIORITY_QUEUE_NUM).

As there will be a big change for applying the corresponding
num-queues for each GMAC 'struct eth_sam_dev_data', here just
keep it as is. Adding the BUITD_ASSERT to make sure the array
queue_list[] is large enough for all GMAC instances.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-11-13 20:30:38 -05:00
Tony Han
8880364901 drivers: net: sam_gmac: update random MAC addr for multi inst support
Add variable 'random_mac_addr' for 'zephyr,random-mac-address' from
device tree. Update generate_mac() to get random MAC address for each
GAMC interface with the 'zephyr,random-mac-address' property.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-11-13 20:30:38 -05:00
Tony Han
7ff2f53c95 drivers: net: sam_gmac: deprecate the 'mac-eeprom' option
Deprecate the 'ETH_SAM_GMAC_MAC_I2C_EEPROM' for the 'mac-eeprom' option,
Limite it to be used when there's only one activated GMAC instance.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-11-13 20:30:38 -05:00
Tony Han
8b0f8aaa2c drivers: net: sam_gmac: remove getting max_frame_size from DT
As jumbo frame size is not supported by the networking subsystem, only
max_frame_size 1518 and 1536 can be used. The Frame size 1536 would
allow for packets with a vlan tag, so enable GMAC_NCFGR_MAXFS when
NET_VLAN is configured.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-11-13 20:30:38 -05:00
Tony Han
50b3028279 drivers: net: sam_gmac: remove run once check in eth_iface_init()
To allow every interface be initialized properly when there are more than
one instance, remove the static variable "init_done" which is used to make
the initialize procedure only be done once.

Signed-off-by: Tony Han <tony.han@microchip.com>
2025-11-13 20:30:38 -05:00