Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a293e79
drivers: gmac: Added Support for Ethernet Driver
himanshuseth-microchip Jun 20, 2025
f419cd7
drivers: gmac: Added File related to EEPROM feature for Ethernet driver
himanshuseth-microchip Jun 20, 2025
f17e9dc
drivers: gmac: Added Support for MDIO Driver
himanshuseth-microchip Jun 20, 2025
88cdd7d
drivers: gmac: Incorporated review comments with respect to clock usage
himanshuseth-microchip Jul 1, 2025
46dcb09
drivers: gmac: Incorporated review comments on MDIO and Ethernet Driver
himanshuseth-microchip Jul 8, 2025
c5002d4
drivers: gmac: Moved Rx packet handling from ISR to Worker Thread
himanshuseth-microchip Jul 10, 2025
04ba695
drivers: gmac: Incorporated more review comments - MDIO & Ethernet Dr…
himanshuseth-microchip Jul 30, 2025
768800c
drivers: gmac: Changed API names - MDIO & Ethernet Driver.
himanshuseth-microchip Sep 9, 2025
04bb30e
dts: arm: microchip: add dts node and binding file for eth g1
himanshuseth-microchip Oct 16, 2025
823a5b1
drivers: ethernet: microchip: Add G1 driver for eth
himanshuseth-microchip Oct 16, 2025
fd4ae68
boards: sam_e54_xpro: Update DTS files for Eth support
himanshuseth-microchip Oct 16, 2025
586d31b
dts: arm: microchip: add dts node and binding file for mdio g1
himanshuseth-microchip Oct 16, 2025
2b211f3
drivers: mdio: microchip: Add driver for mdio G1 Peripherals
himanshuseth-microchip Oct 16, 2025
e89259d
drivers: eth: microchip: Fixed the compilation issue with the latest …
himanshuseth-microchip Oct 28, 2025
011068b
drivers: mdio: microchip: Removed do while(0) for mdio G1 Peripherals
himanshuseth-microchip Oct 28, 2025
96ed1a1
drivers: eth: microchip: Removed dependecy of i2c driver for eth G1 P…
himanshuseth-microchip Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions boards/microchip/sam/sam_e54_xpro/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025 Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0

if NETWORKING

config NET_L2_ETHERNET
default y

endif # NETWORKING
18 changes: 18 additions & 0 deletions boards/microchip/sam/sam_e54_xpro/sam_e54_xpro-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,22 @@
pinmux = <PC18F_TCC0_WO2>;
};
};
gmac_rmii: gmac_rmii {
group1 {
pinmux = <PA14L_GMAC_GTXCK>,
<PA17L_GMAC_GTXEN>,
<PA18L_GMAC_GTX0>,
<PA19L_GMAC_GTX1>,
<PC20L_GMAC_GRXDV>,
<PA13L_GMAC_GRX0>,
<PA12L_GMAC_GRX1>,
<PA15L_GMAC_GRXER>;
};
};
mdio_default: mdio_default {
group1 {
pinmux = <PC11L_GMAC_GMDC>,
<PC12L_GMAC_GMDIO>;
};
};
};
26 changes: 25 additions & 1 deletion boards/microchip/sam/sam_e54_xpro/sam_e54_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,34 @@
channels = <6>;
};

&gmac {
status = "okay";
compatible = "microchip,gmac-g1-eth";

pinctrl-0 = <&gmac_rmii>;
pinctrl-names = "default";

phy-handle = <&phy>;
};

&mdio {
status = "okay";
compatible = "microchip,gmac-g1-mdio";

pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";

phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "okay";
reg = <0>;
};
};

&portb {
status = "okay";
};

&portc {
status = "okay";
};
};
1 change: 1 addition & 0 deletions boards/microchip/sam/sam_e54_xpro/sam_e54_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ supported:
- reset
- shell
- uart
- netif:eth
vendor: microchip
1 change: 1 addition & 0 deletions drivers/ethernet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ zephyr_library_sources_ifdef(CONFIG_ETH_LITEX_LITEETH eth_litex_liteeth.c)
zephyr_library_sources_ifdef(CONFIG_ETH_SMSC911X eth_smsc911x.c)
zephyr_library_sources_ifdef(CONFIG_ETH_STELLARIS eth_stellaris.c)
zephyr_library_sources_ifdef(CONFIG_ETH_W5500 eth_w5500.c)
zephyr_library_sources_ifdef(CONFIG_ETH_MCHP_GMAC_G1 eth_mchp_gmac_g1.c)
zephyr_library_sources_ifdef(CONFIG_ETH_SAM_GMAC eth_sam_gmac.c)
zephyr_library_sources_ifdef(CONFIG_ETH_CYCLONEV eth_cyclonev.c)
zephyr_library_sources_ifdef(CONFIG_SLIP_TAP eth_slip_tap.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ source "drivers/ethernet/Kconfig.enc424j600"
source "drivers/ethernet/Kconfig.esp32"
source "drivers/ethernet/Kconfig.e1000"
source "drivers/ethernet/Kconfig.sam_gmac"
source "drivers/ethernet/Kconfig.mchp"
source "drivers/ethernet/Kconfig.stm32_hal"
source "drivers/ethernet/Kconfig.dwmac"
source "drivers/ethernet/Kconfig.smsc911x"
Expand Down
129 changes: 129 additions & 0 deletions drivers/ethernet/Kconfig.mchp
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Copyright (c) 2025 Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0

config ETH_MCHP_GMAC_G1
bool "Microchip Ethernet driver"
default y
depends on NET_BUF_FIXED_DATA_SIZE
depends on DT_HAS_MICROCHIP_GMAC_G1_ETH_ENABLED
select NOCACHE_MEMORY if ARCH_HAS_NOCACHE_MEMORY_SUPPORT
select MDIO
select ETH_DSA_SUPPORT
select PINCTRL
help
Enable Microchip MCU Family Ethernet driver.

# Define menu symbol for configuring ethernet features
menuconfig ETH_MCHP_GMAC
bool "Microchip GMAC Ethernet driver"
default y
depends on ETH_MCHP_GMAC_G1
help
Enable support for Microchip clock controller driver.

if ETH_MCHP_GMAC

# Workaround for not being able to have commas in macro arguments
DT_ETH_MCHP_PATH := $(dt_nodelabel_path,gmac)

# Just for readability, to keep the following lines shorter.
DT_ETH_MCHP_NQ := $(dt_node_int_prop_int,$(DT_ETH_MCHP_PATH),num-queues)

config ETH_MCHP_QUEUES
int "Number of active hardware TX and RX queues"
default 1
range 1 $(DT_ETH_MCHP_NQ) if SOC_SERIES_SAME70 || \
SOC_SERIES_SAMV71 || \
SOC_SERIES_SAM4E || \
SOC_SERIES_SAME54
help
Select the number of hardware queues used by the driver. Packets will be
routed to appropriate queues based on their priority.

config ETH_MCHP_FORCE_QUEUE
bool "Force all traffic to be routed through a specific queue"
depends on ETH_MCHP_QUEUES > 1
depends on NET_TC_RX_COUNT < 5
help
This option is meant to be used only for debugging. Use it to force all
traffic to be routed through a specific hardware queue. With this enabled
it is easier to verify whether the chosen hardware queue actually works.
This works only if there are four or fewer RX traffic classes enabled, as
the SAM GMAC hardware supports screening up to four traffic classes.

config ETH_MCHP_FORCED_QUEUE
int "Queue to force the packets to"
depends on ETH_MCHP_FORCE_QUEUE
default 0
range 0 1 if ETH_MCHP_QUEUES = 2
range 0 2 if ETH_MCHP_QUEUES = 3
range 0 3 if ETH_MCHP_QUEUES = 4
range 0 4 if ETH_MCHP_QUEUES = 5
range 0 5 if ETH_MCHP_QUEUES = 6
help
Which queue to force the routing to. This affects both the TX and RX queues
setup.

config ETH_MCHP_BUF_RX_COUNT
int "Network RX buffers preallocated by the SAM ETH driver"
default 12
help
Number of network buffers that will be permanently allocated by the
Ethernet driver. These buffers are used in receive path. They are
preallocated by the driver and made available to the GMAC module to be
filled in with incoming data. Their number has to be large enough to fit
at least one complete Ethernet frame. SAM ETH driver will always allocate
that amount of buffers for itself thus reducing the NET_BUF_RX_COUNT
which is a total amount of RX data buffers used by the whole networking
stack. One has to ensure that NET_PKT_RX_COUNT is large enough to
fit at least two Ethernet frames: one being received by the GMAC module
and the other being processed by the higher layer networking stack.

config ETH_MCHP_MAC_I2C_EEPROM
default y
select I2C
bool "Read from an I2C EEPROM"
help
Read MAC address from an I2C EEPROM.

if ETH_MCHP_MAC_I2C_EEPROM

config ETH_MCHP_MAC_I2C_INT_ADDRESS
hex "I2C EEPROM internal address"
default 0x9A
range 0 0xffffffff
help
Internal address of the EEPROM chip where the MAC address is stored.
Chips with 1 to 4 byte internal address size are supported. Address
size has to be configured in a separate Kconfig option.

config ETH_MCHP_MAC_I2C_INT_ADDRESS_SIZE
int "I2C EEPROM internal address size"
default 1
range 1 4
help
Size (in bytes) of the internal EEPROM address.

endif # ETH_MCHP_MAC_I2C_EEPROM
Comment on lines +82 to +107
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, see #91040 (comment) for more infos


config PTP_CLOCK_SAM_GMAC
bool "SAM GMAC PTP clock driver support"
default y
depends on PTP_CLOCK
help
Enable SAM GMAC PTP Clock support.

config ETH_MCHP_RX_THREAD_STACK_SIZE
int "MCHP RX Work thread stack size"
default 1600
help
RX thread stack size in bytes.

config ETH_MCHP_RX_THREAD_PRIORITY
int "MCHP RX work thread priority"
default 2
help
Ethernet Driver handles RX in workqueue thread.
This options sets the priority of that thread.

endif # ETH_MCHP_GMAC
Loading