-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: net: sam_gmac: update for supporting multi GMAC instances #91040
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
drivers: net: sam_gmac: update for supporting multi GMAC instances #91040
Conversation
drivers/ethernet/eth_sam_gmac_priv.h
Outdated
| uint32_t instance:8; | ||
| uint32_t num_queues:8; | ||
| uint32_t reserved:16; |
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.
Why bitfields instead of one uint16_t and two uint8_t?
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 special reasons for using bitfields just it's easier to keep the structure word aligned.
Will be updated with uint16_t and uint8_t, thanks.
|
Hey, this needs a rebase and force push to pick up the CI error workaround. |
e667bf9 to
2f68375
Compare
|
@maass-hamburg
|
2f68375 to
a6537c6
Compare
|
Rebased on the latest |
dd166f8 to
69c7a1f
Compare
69c7a1f to
0bf5ef1
Compare
d04c0e2 to
75008f4
Compare
b54ec29 to
07fdcb3
Compare
Yes, the correlation needs to be solved. The same In this PR just keep it as is and validate it with |
|
Updated with the following:
|
Add variable "phy_conn_type" to get and use the phy_connection_type from DT for different GMAC instances. Update the judgement on phy_connection_type for multi instances support. Signed-off-by: Tony Han <[email protected]>
Add variable "ref_clk_source" to get and set the source for the GMAC reference clock from DT for different GMAC instances. Signed-off-by: Tony Han <[email protected]>
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 <[email protected]>
07fdcb3 to
1b93805
Compare
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
1b93805 to
f27d14a
Compare
'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 <[email protected]>
f27d14a to
dec5331
Compare
Please open a issue for that, so we don't forget it later |
|
Hi, @maass-hamburg ,
Created #99051, thanks. |
7b894ed to
ef34457
Compare
The 'max-speed' property in atmel,gmac-common.yaml file is not used, remove it. Signed-off-by: Tony Han <[email protected]>
ef34457 to
02c0820
Compare
|
|
Ping @jukkar |



The purpose of this PR is to update
sam_gmacdriver from supporting only one instance to supporting multiple instances.The following two files are updated:
drivers/ethernet/eth_sam_gmac.cdrivers/ethernet/eth_sam_gmac_priv.hChanges include: