Skip to content
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

igb: Add BCM54616 initialization code for I354 mgmt on Netberg Aurora 420 #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sergeypopovich-ord
Copy link

Add BCM54616 initialization and "link UP" code for I354 used as management network interface on Netberg Aurora 420 and other devices.

This change has to be merged before sonic-net/sonic-buildimage#2400.

To put closer in numbering sense two related patches together.

Signed-off-by: Sergey Popovich <[email protected]>
@lguohan
Copy link
Contributor

lguohan commented Dec 24, 2018

we already have patch for support bcm phy 5461 for igb driver. why it does not work for you?

https://github.com/Azure/sonic-linux-kernel/blob/master/patch/0011-support-Broadcom-54616-Phy-for-Intel-igb-driver.patch

@sergeypopovich-ord
Copy link
Author

Link just wont come up without this specific initialization, linkup code.

Yes, this potentially can broke things for others and if you consider not to merge this:
I can take copy of igb (either intel-out-of-tree or directly from kernel) and maintain own
copy of the driver as platform specific module.

@lguohan
Copy link
Contributor

lguohan commented Dec 24, 2018

your patch does not seem to be aligned with linux kernel since there is already 5461S phy support in 4.9 kernel.

https://elixir.bootlin.com/linux/v4.9.147/source/drivers/net/phy/broadcom.c#L490

can you align you patch with the linux kernel approach to support broadcom phy.

we cannot accept you patch in current format since it creates lots of overhead to maintain this patch.

@sergeypopovich-ord
Copy link
Author

Will try upstream patch then. Thank you for pointing.

@sergeypopovich-ord
Copy link
Author

I have compared upstream kernel for common part between it and patch within this request
and found bcm54xx_config_init() is only common bit. Link setup process is unique.

Also igb seems implement phy code on it's own, not using libphy from kernel.

I agree that this change

  1. makes overhead for maintenance
  2. can potentially broke things for others

and I'm fine to decline this pull request, but I would like to ask how bad is to maintain own copy of igb in
platform specific module? I'm planning to use out-of-tree igb driver that is most portable across kernel versions.

I understand that on kernel version change we could get igb in our platform code failing to build
requiring maintenance.

Looking for better approach...

@lguohan
Copy link
Contributor

lguohan commented Dec 24, 2018

patch 0011 is taken from a linux upstream commit https://patchwork.ozlabs.org/patch/799983/

we do have the same setup with igb mac and bcm 5461 phy in other platform, and the patch 0011 works for us. Wonder what is the difference that makes the patch 0011 not work for you?

@sergeypopovich-ord
Copy link
Author

It seems we need special initialization here:

  • case e1000_phy_bcm54616:
  •   ret_val = 0;
    
  •   break;
    

Upstream patch just silence error and does not initialize PHY like done for others.

@sergeypopovich-ord sergeypopovich-ord force-pushed the netberg-a420-support branch 2 times, most recently from 193a957 to d58dd75 Compare December 25, 2018 09:55
@sergeypopovich-ord
Copy link
Author

sergeypopovich-ord commented Dec 25, 2018

It seems I found root case of the problem: if there is no EEPROM (like our case) we need to manually initialize PHY.

I ported drivers/net/phy/broadcom.c code to initialize BCM54616S PHY among with routines required
to setup link and force speed/duplex as done for other PHYs (e.g. IGP3 from Marvell).

Now link comes up and becomes operational. I think this patch is subject for upstreaming to Linux Kernel.

We have support for Broadcom 54616 backported from Linux Kernel upstream
in commit 3639697 ("[igb]: support broadcom 54616 phy for Intel igb
driver (sonic-net#3)").

However that support doesn't account for the case when no EEPROM present
and we need to initialize PHY manually.

Signed-off-by: Sergey Popovich <[email protected]>
@paulmenzel
Copy link
Contributor

Did you ever sent this to Linux upstream?

@jarias-lfx
Copy link

/easycla

@linux-foundation-easycla
Copy link

CLA Not Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants