-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: eth: microchip: Introduce G1 Ethernet Driver #98627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
himanshuseth-microchip
wants to merge
16
commits into
zephyrproject-rtos:main
Choose a base branch
from
Zephyr4Microchip:gmac_g1_driver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,576
−2
Draft
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 f419cd7
drivers: gmac: Added File related to EEPROM feature for Ethernet driver
himanshuseth-microchip f17e9dc
drivers: gmac: Added Support for MDIO Driver
himanshuseth-microchip 88cdd7d
drivers: gmac: Incorporated review comments with respect to clock usage
himanshuseth-microchip 46dcb09
drivers: gmac: Incorporated review comments on MDIO and Ethernet Driver
himanshuseth-microchip c5002d4
drivers: gmac: Moved Rx packet handling from ISR to Worker Thread
himanshuseth-microchip 04ba695
drivers: gmac: Incorporated more review comments - MDIO & Ethernet Dr…
himanshuseth-microchip 768800c
drivers: gmac: Changed API names - MDIO & Ethernet Driver.
himanshuseth-microchip 04bb30e
dts: arm: microchip: add dts node and binding file for eth g1
himanshuseth-microchip 823a5b1
drivers: ethernet: microchip: Add G1 driver for eth
himanshuseth-microchip fd4ae68
boards: sam_e54_xpro: Update DTS files for Eth support
himanshuseth-microchip 586d31b
dts: arm: microchip: add dts node and binding file for mdio g1
himanshuseth-microchip 2b211f3
drivers: mdio: microchip: Add driver for mdio G1 Peripherals
himanshuseth-microchip e89259d
drivers: eth: microchip: Fixed the compilation issue with the latest …
himanshuseth-microchip 011068b
drivers: mdio: microchip: Removed do while(0) for mdio G1 Peripherals
himanshuseth-microchip 96ed1a1
drivers: eth: microchip: Removed dependecy of i2c driver for eth G1 P…
himanshuseth-microchip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,4 +19,5 @@ supported: | |
| - reset | ||
| - shell | ||
| - uart | ||
| - netif:eth | ||
| vendor: microchip | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| 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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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