Commit graph

1306 commits

Author SHA1 Message Date
Jiafei Pan
c006dbea8e drivers: ethernet: netc_psi: add MMIPO mapping support
In order to support MMU mapping on Cortex-A core, added MMIO mapping
support in imx_netc_psi driver.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-07-29 11:20:48 +01:00
Jiafei Pan
4caf2efec9 drivers: ethernet: imx_netc: add netc block driver
Add NETC block driver, it could do some block memory region MMIO mapping
and also so dome block initialization, moved some netc related
configuration form board_init() to block driver so that it could be reused
between different platforms, although some configuration is different for
different platform, but put all NETC related code in the same driver to
make it easier to be maintained.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-07-29 11:20:48 +01:00
Jiafei Pan
30b6adf42d drivers: ethernet: imx_netc: add GIC MSI support
It could use GIC ITS as MSI controller on Cortex-A Core, so added
GIC ITS MSI support for NETC drivers.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-07-29 11:20:48 +01:00
Peter van der Perk
0f6e5e3f26 drivers: ethernet: eth_nxp_enet_qos: init phy callback in iface init
Initially phy_link_callback_set got called before iface init got set.
Moving to iface_init, fixes an issue that mac would set interface to up
even though it was down because startup phy down callback didn't got
through.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-07-28 08:38:47 -04:00
Fin Maaß
edaafb5dd1 drivers: ethernet: phy: microchip_vsc8541: use default speeds
use default speeds dt prop

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
365297fabb drivers: ethernet: phy: dp83867: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
46599fe34e drivers: ethernet: phy: dp83825: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
156d0479cf drivers: ethernet: phy: rtl8211f: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
db6b1782c2 drivers: ethernet: phy: ar8031: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
d8711bba5a drivers: ethernet: phy: ksz8081: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
e0587ada7f drivers: ethernet: phy: put shared macro in shared header
put the macro to get the default speeds into a
shared header for the phys.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
c069fb0961 drivers: ethernet: remove phy_configure_link() usage
remove the use of phy_configure_link() in the ethernet drivers.
The user can now select the default speeds via DT prop, doing
another phy_configure_link() in the eth driver would overwrite
that.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
f473806777 drivers: ethernet: phy: ar8031: remove fixed link mode
fixed link mode is a mode where we don't comunicate with the phy,
therefore we don't need it in other phys as the generic phy_mii one.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Peter van der Perk
3510fda674 boards: nxp: vmu_rt1170: Fix TJA1103 phy config
Also increase regulator init priority so that ethernet vdd is
turned before PHY initialization

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-07-23 17:31:55 +01:00
Peter van der Perk
7fbf146af2 drivers: eth: phy: tja1103: Remove ISR thread and add auto mode.
Re-use the workqueue instead of having dedicated thread for handling
interrupts. This reduces memory usage and complexity.

Furthermore adds an auto mode for 100BASE-T1 negotiation.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-07-23 17:31:55 +01:00
Vijayakannan Ayyathurai
8a32bd7cd0 drivers: ethernet: intel: Add i226 Ethernet MAC device driver
The Intel i226 Ethernet Controller is a PCIe Gen 2 one-lane modular
endpoint device that integrates a GbE Media Access Control (MAC) and
Physical Layer (PHY) port. This driver provides support for MAC and
DMA-specific initialization and runtime TX/RX operations.

Key features:
- MSI-X interrupts for TX/RX DMA channels.
- Multiple TX/RX DMA channel support with exclusive bottom-half.
- Implements a circular descriptor ring architechture with
  producer-consumer semantics for high performance pkt processing.
- Full duplex support for 10/100/1000 Mbps.
- Half duplex support for 10/100 Mbps.
- Auto-negotiation for 10/100/1000 Mbps.
- MTU customization for flexible packet sizes.
- MAC address filtering based on:
  - Random MAC generation.
  - Local-mac-address mentioned in device tree.
  - EEPROM pre-programmed mac address.
  - Setting mac address via net shell.
- Support for multiple Ethernet interface instances.

Signed-off-by: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
Signed-off-by: Ling Pei Lee <pei.lee.ling@intel.com>
2025-07-23 17:17:24 +01:00
Vijayakannan Ayyathurai
affecd1839 drivers: ethernet: Add platform driver for MMIO mapping reuse
The Ethernet device model consists of multiple subsystem components, such
as MDIO, PHY, MAC and PTP_CLOCK. These components are mapped into a single
PCIe BAR location with same base address.

This platform driver retrieves the MMIO mapping details and provides a
framework to share it with all the child subsystem components. This
approach avoid the duplicate remapping, ensures efficient re-use of
MMIO mappings across related devices.

Example device tree structure for first ethernet instance:

parent0: parent0 {
        compatible = "intel,eth-plat";
        interrupt-parent = <&intc>;
        vendor-id  = <0x8086>;
        device-id  = <0xXXXX>;

        igc0: igc0 {
                compatible = "intel,igc-mac";

                /*
                 * MAC specific properties.
                 */

                status = "okay";
        };

        mdio0: mdio0 {
                compatible = "intel,igc-mdio";
                #address-cells = <1>;
                #size-cells = <0>;

                ethphy0: ethernet-phy@0 {
                        compatible = "ethernet-phy";
                        /*
                         * PHY specific properties.
                         */
                        reg = <0x0>;
                };
        };
};

This framework is modular and re-usable for other PCIe based Ethernet
devices. It can also be extended to support additional platform specific
information shared across child nodes.

Signed-off-by: Vijayakannan Ayyathurai <vijayakannan.ayyathurai@intel.com>
2025-07-23 17:17:24 +01:00
Robert Hancock
45eedaa614 drivers: ethernet: phy: vsc8541: allow disabling autonegotiation
Add support for disabling autonegotiation to the cfg_link callback, as
with the phy_mii driver.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2025-07-23 09:31:17 +02:00
Robert Hancock
aab1f68d08 drivers: ethernet: phy: vsc8541: Add timeout on SW reset
The driver previously could enter an infinite loop if the PHY software
reset failed to complete, which could happen due to hardware reset
issues or MDIO bus problems. Add a timeout of 1000 iterations so we
report an error in this scenario rather than causing a lockup.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2025-07-23 09:31:17 +02:00
Robert Hancock
211e9ea6bd drivers: ethernet: vsc8541: Fixed inverted reset GPIO
For GPIOs driving active-low signals, such as the VSC8541's reset pin,
they are supposed to be declared as active low in the device tree, and
set to 1 to assert and 0 to clear. Change the driver as such so that it
does not leave the PHY stuck in reset when so configured.

Also changed all in-tree board DTS files for this PHY to properly
declare the reset GPIO as active low.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2025-07-23 09:31:17 +02:00
Robert Hancock
07f45204cb drivers: ethernet: phy: vsc8541: Use 16-bit values for MDIO access
The internal register read/write functions used uint32_t for the values
even though the registers are only 16 bits wide, resulting in a bunch of
casting. Change the internal functions to use uint16_t and wrap them for
the external read/write API which uses uint32_t.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2025-07-23 09:31:17 +02:00
Robert Hancock
ee5a71911a drivers: ethernet: phy: vsc8541: add MDIO enable/disable
The driver was not enabling the MDIO bus before trying to access
registers. Added enabling and disabling the bus around PHY register
accesses.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2025-07-23 09:31:17 +02:00
Robert Hancock
c20d197c97 drivers: ethernet: phy: vsc8541: fixed build warnings
Fixed some build warnings in the driver from previous changes by
removing an unused variable and hooking up the cfg_link function. Also
removes some implicit boolean conversions.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2025-07-23 09:31:17 +02:00
Fin Maaß
62745596b4 drivers: ethernet: phy: microchip_vsc8541: use mutex
use mutex to protect page register

phy_mc_vsc8541_get_link got removed from
phy_mc_vsc8541_link_cb_set so, that
phy_mc_vsc8541_link_monitor (own thread)
is the only one to change data->state

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-23 09:31:17 +02:00
Fin Maaß
74d62a0903 drivers: ethernet: phy: microchip_vsc8541: improve driver
- implement configure link
- support half duplex
- use defines from mii.h
- fix check ret vals

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-23 09:31:17 +02:00
Parthiban Veerasooran
61095cd78e drivers: ethernet: phy: microchip_t1s: always reschedule phy_monitor_work
Previously, phy_monitor_work_handler() would return early without
rescheduling the delayed work if the callback (cb) was not set,
causing the periodic monitoring to stop. This change ensures that
k_work_reschedule() is always called, even when cb is NULL, so
monitoring of the PHY state continues.

This prevents the monitor from being inadvertently stopped and
ensures consistent behavior regardless of callback registration.

This issue was observed during testing with the evb-lan8670-rmii
(an external LAN8670 PHY) connected to the SAME54 Curiosity Ultra
platform.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-07-22 08:13:01 -04:00
Parthiban Veerasooran
893eea6cda drivers: ethernet: phy: microchip_t1s: fix missing MDIO bus enable/disable
Call mdio_bus_enable() and mdio_bus_disable() during clause 22 register
read/write operations. Previously, these APIs were not invoked, which
could lead to improper MDIO bus handling.

This issue was observed during testing with the evb-lan8670-rmii
(an external LAN8670 PHY) connected to the SAME54 Curiosity Ultra
platform.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-07-22 08:13:01 -04:00
Parthiban Veerasooran
c41cde799d drivers: ethernet: phy: microchip_t1s: fix C45 registers direct access
C45 direct registers access is only supported by the LAN865x internal PHY,
not by the LAN867x external PHY, even though the MAC supports it. Restrict
C45 direct register access to the LAN865x internal PHY. The LAN867x
external PHY supports C45 registers only via indirect access through C22
registers.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-07-22 08:13:01 -04:00
Parthiban Veerasooran
5e6e8da495 drivers: ethernet: lan865x: fix module init priority
Align the LAN865x driver module initialization priority with the default
priorities of MDIO and PHY drivers. The microchip_t1s PHY driver supports
both LAN865x internal PHY and LAN867x external PHY. It was observed that
the microchip_t1s driver initialization priority did not match the
priority sequence used by the GMAC driver when the evb-lan8670-rmii (an
external LAN8670 PHY) was connected to the SAME54 Curiosity Ultra
platform, leading to potential initialization order issues. This change
ensures the correct initialization sequence for reliable operation.

The initialization priorities of the microchip_t1s and mdio_lan865x
drivers are now set to the default values used in Zephyr. The LAN865x
driver init priority is updated to the most appropriate value so that the
microchip_t1s init priority aligns with all MAC drivers, maintaining the
correct initialization sequence.

Since the microchip_t1s driver can be used by many MAC drivers, keeping
the default priority provided by Zephyr is a good approach. Instead,
setting a specific priority for the eth_lan865x driver is more appropriate
to ensure proper initialization order.

Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
2025-07-22 08:13:01 -04:00
Venkatesh Odela
873b05f39c drivers: ethernet: eth_xilinx_axienet : Add runtime MAC address generation
Add support to generate the random MAC if 'zephyr,random-mac-address'
is set,uses 'local-mac-address' from DT if available, or falls back
to a default Xilinx OUI-based MAC with zeroed bytes

Signed-off-by: Venkatesh Odela <venkatesh.odela@amd.com>
2025-07-19 15:37:14 -04:00
Fin Maaß
d4a2a2e581 drivers: ethernet: adin2111: make register access independent
don't use global buffers for reg_read and reg_write,
so we only need to rely on the spi drivers lock and
don't have to use our lock.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-19 10:24:05 +02:00
Alberto Escolar Piedras
0d87d5f5b4 drivers/ethernet/native_tap: Remove NATIVE_APPLICATION support
It is not possible to build anymore in that mode, so we do not
need to support it in this driver cmake files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-07-19 09:38:15 +02:00
Jacob Wienecke
112cd172c1 drivers: mdio_nxp_enet_qos: fix CR overwrite
Current Implementation to write to MAC_MDIO_ADDRESS causes CR to be
set to 0. This leads to the divide always being 42 (on FRDM_MCXN947)
so, by default the clock is running at ~3.6MHz which is out of spec
range (1.0-2.5MHz)

This stops the do_transaction function from overwriting CR.
It also saves off the CR register before DMA reset

Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
2025-07-08 13:40:17 -05:00
Gaetan Perrot
087b7b8890 drivers: ethernet: xilinx: remove unused variable
Clean up unused variable 'ret' and 'link_state' in eth_xilinx_axienet.c to
improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-08 13:37:47 -05:00
Gaetan Perrot
c86f570401 drivers: ethernet: sy1xx: remove unused variable
Clean up unused variable 'rand_mac_addr' in eth_sensry_sy1xx_mac.c to
improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-08 13:37:47 -05:00
Fin Maaß
19a3b217e5 drivers: ethernet: nxp: don't fail with -EALREADY
don't fail with -EALREADY being returned from
phy_configure_link.

Fixes: #92281
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-04 14:20:55 -10:00
Ofir Shemesh
b2d7094f15 drivers: ethernet: nxp_enet: Fix PHY configure for fixed-link config
Update the driver to handle -ENOSYS from phy_configure_link(), which is
now returned when the cfg_link callback is missing (e.g., in fixed-link
PHYs).

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
2025-07-01 10:59:32 -10:00
Yangbo Lu
2cf5c7091a drivers: eth_nxp_imx_netc: support PTP timestamping
Added PTP timestamping support.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-06-27 09:54:21 -05:00
Yangbo Lu
e0aa603f9c dts: bindings: nxp,enet-mac: convert to use ptp-clock property
Convert to use ethernet-controller ptp-clock property.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-06-27 09:54:21 -05:00
Fin Maaß
596cd64bb9 drivers: ethernet: use DT_INST_PROP_OR for local-mac-address
use DT_INST_PROP_OR for local-mac-address, so
that it is not required to be set in dt, as there are
other ways to se the mac address.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-27 12:22:49 +02:00
Fin Maaß
5f83aea9e4 drivers: ethernet: sensry: fix mac addr order
make sure, that zephyr,random-mac-address
has a higher prio, than local-mac-address, as
documented in ethernet-controller.yaml.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-27 12:22:49 +02:00
Fin Maaß
4b6ccbdd1f drivers: ethernet: xmc4xxx: random mac only on dt
only set a random mac if zephyr,random-mac-address
is set in dt.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-27 12:22:49 +02:00
Fin Maaß
5638d9fa47 drivers: ethernet: nxp: fix mac addr order
make sure, that zephyr,random-mac-address
has a higher prio, than local-mac-address, as
documented in ethernet-controller.yaml.

Also make sure, that no vaild mac address
doesn't lead to init fail, as it can still be
set later via set_config.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-27 12:22:49 +02:00
Fin Maaß
67e736a58c drivers: ethernet: phy: phy_qualcomm_ar8031: fix speeds undeclared
fix `speeds` undeclared.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-24 15:38:45 -05:00
Benjamin Cabé
942d823c71 drivers: ethernet: phy: dm8806: fix error handling
Use signed variable for negative error codes so that potential errors
are actually detected and returned properly.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 09:46:10 +02:00
Declan Snyder
3d8196f41b drivers: nxp_enet: Use hwinfo API for unique mac
Use the HWINFO API for getting the unique mac address, and use the
pre-existing hardcoded macros as fallbacks if hwinfo is not implemented
properly.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-06-18 17:49:41 -04:00
Fin Maaß
cf8049a9ed drivers: ethernet: phy: tja11xx: Wrap driver instances in device API macro
Use the device API macro to place the driver API instance into an iterable
section.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-18 09:30:43 -04:00
Fin Maaß
1497ae6d30 drivers: mdio: remove unused bus_enable/disable
remove unused bus_enable/disable, they don't
need to be implemented, if they are not needed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-17 17:46:56 +02:00
Fin Maaß
66329deb9c drivers: ethernet: phy: phy_mii: start autoneg in cfg_link
already (re-)start autonegotiation in phy_mii_cfg_link.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-17 16:08:22 +02:00
Fin Maaß
97c9f0edad drivers: ethernet: phy_mii: check return values in init
check return values in init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-17 16:08:22 +02:00