netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.
       [not found] <MW5PR11MB5764F9734ACFED2EF390DFF795A19@MW5PR11MB5764.namprd11.prod.outlook.com>
@ 2023-02-17 17:13 ` Florian Fainelli
  2023-02-21  8:04   ` wangxiaolei
  2023-02-21 18:44 ` Doug Berger
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2023-02-17 17:13 UTC (permalink / raw)
  To: Wang, Xiaolei, bcm-kernel-feedback-list@broadcom.com, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, pabeni@redhat.com, richardcochran@gmail.com
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org

On 2/17/23 00:06, Wang, Xiaolei wrote:
> hi
> 
>      When I use the nxp-imx7 board, eth0 is connected to the PC, eth0 is 
> turned off the auto-negotiation mode, and the configuration is forced to 
> 10M, 100M, 1000M. When configured to force 1000M,
>      The link status of phy status reg(0x1) is always 0, and the chip of 
> phy is BCM54220, but I did not find the relevant datasheet on BCM 
> official website, does anyone have any suggestions or the datasheet of 
> BCM54220?

I don't have access to a system with a BCM54220 but can look at the 
datasheet, could you provide the full output of mii-diag in both cases? 
What do the PC report as far as link partner advertisement goes etc.?

You are using a twister pair cable to connect your two systems?
-- 
Florian


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.
  2023-02-17 17:13 ` BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time Florian Fainelli
@ 2023-02-21  8:04   ` wangxiaolei
  0 siblings, 0 replies; 6+ messages in thread
From: wangxiaolei @ 2023-02-21  8:04 UTC (permalink / raw)
  To: Florian Fainelli, bcm-kernel-feedback-list@broadcom.com,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, pabeni@redhat.com,
	richardcochran@gmail.com
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org


On 2/18/23 1:13 AM, Florian Fainelli wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender 
> and know the content is safe.
>
> On 2/17/23 00:06, Wang, Xiaolei wrote:
>> hi
>>
>>      When I use the nxp-imx7 board, eth0 is connected to the PC, eth0 is
>> turned off the auto-negotiation mode, and the configuration is forced to
>> 10M, 100M, 1000M. When configured to force 1000M,
>>      The link status of phy status reg(0x1) is always 0, and the chip of
>> phy is BCM54220, but I did not find the relevant datasheet on BCM
>> official website, does anyone have any suggestions or the datasheet of
>> BCM54220?
>
> I don't have access to a system with a BCM54220 but can look at the
> datasheet, could you provide the full output of mii-diag in both cases?
In auto-negotiation mode: normal Link Up, dump of registers:

Read: reg0, 0x1140
Read: reg1, 0x796d
Read: reg2, 0x600d
Read: reg3, 0x8589
Read: reg4, 0x05e1
Read: reg5, 0xc5e1
Read: reg6, 0x006d
Read: reg7, 0x2001
Read: reg8, 0x5bbc
Read: reg9, 0x0200
Read: rega, 0x3800
Read: regb, 0x0000
Read: regc, 0x0000
Read: regd, 0x0000
Read: rege, 0x0000
Read: regf, 0x3000
Read: reg10, 0x0000
Read: reg11, 0x0301
Read: reg12, 0x0000
Read: reg13, 0x0000
Read: reg14, 0x0000
Read: reg15, 0xff1f
Read: reg16, 0x043e
Read: reg17, 0xffff
Read: reg18, 0x8800
Read: reg19, 0x3490
Read: reg1a, 0x0000
Read: reg1b, 0x0000

When auto-negotiation is disabled and configured as forced 1000M mode, 
the register dump:

Read: reg0, 0x0140
Read: reg1, 0x7949
Read: reg2, 0x600d
Read: reg3, 0x8589
Read: reg4, 0x0401
Read: reg5, 0x0000
Read: reg6, 0x0064
Read: reg7, 0x2001
Read: reg8, 0x0000
Read: reg9, 0x0200
Read: rega, 0x0000
Read: regb, 0x0000
Read: regc, 0x0000
Read: regd, 0x0000
Read: rege, 0x0000
Read: regf, 0x3000
Read: reg10, 0x0000
Read: reg11, 0x0000
Read: reg12, 0x0000
Read: reg13, 0x0000
Read: reg14, 0x0000
Read: reg15, 0x0700
Read: reg16, 0x0006
Read: reg17, 0xffff
Read: reg18, 0x8000
Read: reg19, 0x051d
Read: reg1a, 0x0000
Read: reg1b, 0x0000
> What do the PC report as far as link partner advertisement goes etc.?
The other end of the port is also in the link down state.
>
> You are using a twister pair cable to connect your two systems?

I am using copper mode.

And I found that the AR8031 PHY also has this problem. In the case of 
auto-negotiation, 1000M can be negotiated. When auto-negotiation is 
turned off, 10M and 100M can be Link Up, but 1000M can also be Link 
Down. I read the AR8031 manual https://pdf1. 
alldatasheet.com/datasheet-pdf/view/1132454/ETC2/AR8035.html, there is 
only such a statement "If auto-negotiation is disabled, a 10 BASE-Te or 
100 BASE-TX can be manually selected using the IEEE MII registers .”

thanks

xiaolei

> -- 
> Florian
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.
       [not found] <MW5PR11MB5764F9734ACFED2EF390DFF795A19@MW5PR11MB5764.namprd11.prod.outlook.com>
  2023-02-17 17:13 ` BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time Florian Fainelli
@ 2023-02-21 18:44 ` Doug Berger
  2023-02-21 19:41   ` Andrew Lunn
  1 sibling, 1 reply; 6+ messages in thread
From: Doug Berger @ 2023-02-21 18:44 UTC (permalink / raw)
  To: Wang, Xiaolei, f.fainelli@gmail.com,
	bcm-kernel-feedback-list@broadcom.com, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, pabeni@redhat.com, richardcochran@gmail.com
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org

On 2/17/2023 12:06 AM, Wang, Xiaolei wrote:
> hi
>
>      When I use the nxp-imx7 board, eth0 is connected to the PC, eth0 is turned off the auto-negotiation mode, and the configuration is forced to 10M, 100M, 1000M. When configured to force 1000M,
>      The link status of phy status reg(0x1) is always 0, and the chip of phy is BCM54220, but I did not find the relevant datasheet on BCM official website, does anyone have any suggestions or the datasheet of BCM54220?
>
> thanks
> xiaolei
>
It is my understanding that the 1000BASE-T PHY requires peers to take on 
asymmetric roles and that establishment of these roles requires 
negotiation which occurs during auto-negotiation. Some PHYs may allow 
manual programming of these roles, but it is not standardized and tools 
like ethtool do not support manual specification of such details.

Therefore manual configuration of a 1000BASE-T link cannot be assumed to 
work. If you want to "force" a gigabit link you should keep 
auto-negotiation on and only advertise support for the speed you want.


Regards,

     Doug


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.
  2023-02-21 18:44 ` Doug Berger
@ 2023-02-21 19:41   ` Andrew Lunn
  2023-02-21 19:53     ` Doug Berger
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2023-02-21 19:41 UTC (permalink / raw)
  To: Doug Berger
  Cc: Wang, Xiaolei, f.fainelli@gmail.com,
	bcm-kernel-feedback-list@broadcom.com, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	pabeni@redhat.com, richardcochran@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org

On Tue, Feb 21, 2023 at 10:44:44AM -0800, Doug Berger wrote:
> On 2/17/2023 12:06 AM, Wang, Xiaolei wrote:
> > hi
> > 
> >      When I use the nxp-imx7 board, eth0 is connected to the PC, eth0 is turned off the auto-negotiation mode, and the configuration is forced to 10M, 100M, 1000M. When configured to force 1000M,
> >      The link status of phy status reg(0x1) is always 0, and the chip of phy is BCM54220, but I did not find the relevant datasheet on BCM official website, does anyone have any suggestions or the datasheet of BCM54220?
> > 
> > thanks
> > xiaolei
> > 
> It is my understanding that the 1000BASE-T PHY requires peers to take on
> asymmetric roles and that establishment of these roles requires negotiation
> which occurs during auto-negotiation. Some PHYs may allow manual programming
> of these roles, but it is not standardized and tools like ethtool do not
> support manual specification of such details.

Are you talking about ethtool -s [master-slave|preferred-master|preferred-slave|forced-master|forced-slave]

The broadcom PHYs call genphy_config_aneg() -> __genphy_config_aneg()
-> genphy_setup_master_slave() which should configure this, even when
auto-neg is off.

	 Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.
  2023-02-21 19:41   ` Andrew Lunn
@ 2023-02-21 19:53     ` Doug Berger
  2023-02-21 21:51       ` Doug Berger
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Berger @ 2023-02-21 19:53 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Wang, Xiaolei, f.fainelli@gmail.com,
	bcm-kernel-feedback-list@broadcom.com, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	pabeni@redhat.com, richardcochran@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org

On 2/21/2023 11:41 AM, Andrew Lunn wrote:
> On Tue, Feb 21, 2023 at 10:44:44AM -0800, Doug Berger wrote:
>> On 2/17/2023 12:06 AM, Wang, Xiaolei wrote:
>>> hi
>>>
>>>       When I use the nxp-imx7 board, eth0 is connected to the PC, eth0 is turned off the auto-negotiation mode, and the configuration is forced to 10M, 100M, 1000M. When configured to force 1000M,
>>>       The link status of phy status reg(0x1) is always 0, and the chip of phy is BCM54220, but I did not find the relevant datasheet on BCM official website, does anyone have any suggestions or the datasheet of BCM54220?
>>>
>>> thanks
>>> xiaolei
>>>
>> It is my understanding that the 1000BASE-T PHY requires peers to take on
>> asymmetric roles and that establishment of these roles requires negotiation
>> which occurs during auto-negotiation. Some PHYs may allow manual programming
>> of these roles, but it is not standardized and tools like ethtool do not
>> support manual specification of such details.
> 
> Are you talking about ethtool -s [master-slave|preferred-master|preferred-slave|forced-master|forced-slave]
> 
I am, though I was not aware of their addition to ethtool and I avoided 
referencing them by name out of an overabundance of political 
correctness ;).

Thanks for bringing this to my attention.

> The broadcom PHYs call genphy_config_aneg() -> __genphy_config_aneg()
> -> genphy_setup_master_slave() which should configure this, even when
> auto-neg is off.
Yes, this sounds good. Perhaps Xiaolei is not setting these properly 
when forcing 1000.

> 
> 	 Andrew
Thanks again!
     Doug

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.
  2023-02-21 19:53     ` Doug Berger
@ 2023-02-21 21:51       ` Doug Berger
  0 siblings, 0 replies; 6+ messages in thread
From: Doug Berger @ 2023-02-21 21:51 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Wang, Xiaolei, f.fainelli@gmail.com,
	bcm-kernel-feedback-list@broadcom.com, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	pabeni@redhat.com, richardcochran@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org

On 2/21/2023 11:53 AM, Doug Berger wrote:
> On 2/21/2023 11:41 AM, Andrew Lunn wrote:
>> On Tue, Feb 21, 2023 at 10:44:44AM -0800, Doug Berger wrote:
>>> On 2/17/2023 12:06 AM, Wang, Xiaolei wrote:
>>>> hi
>>>>
>>>>       When I use the nxp-imx7 board, eth0 is connected to the PC, 
>>>> eth0 is turned off the auto-negotiation mode, and the configuration 
>>>> is forced to 10M, 100M, 1000M. When configured to force 1000M,
>>>>       The link status of phy status reg(0x1) is always 0, and the 
>>>> chip of phy is BCM54220, but I did not find the relevant datasheet 
>>>> on BCM official website, does anyone have any suggestions or the 
>>>> datasheet of BCM54220?
>>>>
>>>> thanks
>>>> xiaolei
>>>>
>>> It is my understanding that the 1000BASE-T PHY requires peers to take on
>>> asymmetric roles and that establishment of these roles requires 
>>> negotiation
>>> which occurs during auto-negotiation. Some PHYs may allow manual 
>>> programming
>>> of these roles, but it is not standardized and tools like ethtool do not
>>> support manual specification of such details.
>>
>> Are you talking about ethtool -s 
>> [master-slave|preferred-master|preferred-slave|forced-master|forced-slave]
>>
> I am, though I was not aware of their addition to ethtool and I avoided 
> referencing them by name out of an overabundance of political 
> correctness ;).
> 
> Thanks for bringing this to my attention.
> 
>> The broadcom PHYs call genphy_config_aneg() -> __genphy_config_aneg()
>> -> genphy_setup_master_slave() which should configure this, even when
>> auto-neg is off.
> Yes, this sounds good. Perhaps Xiaolei is not setting these properly 
> when forcing 1000.
> 
Hmmm. I just revisited 802.3-2018 40.5.2 MASTER-SLAVE configuration 
resolution and I see it contains this statement:
The MASTER-SLAVE relationship shall be determined
during Auto-Negotiation using Table 40–5 with the 1000BASE-T Technology 
Ability Next Page bit
values specified in Table 40–4 and information received from the link 
partner.

So it appears that the only normative behavior requires Auto-Negotiation 
to be enabled. It seems reasonable that an implementation might allow 
the forced-master and forced-slave configurations to be applied when 
Auto-Negotiation is not enabled, but this case is outside of the 
standard so an implementation could also fail to establish a link.

>>
>>      Andrew
> Thanks again!
>      Doug


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-21 21:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <MW5PR11MB5764F9734ACFED2EF390DFF795A19@MW5PR11MB5764.namprd11.prod.outlook.com>
2023-02-17 17:13 ` BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time Florian Fainelli
2023-02-21  8:04   ` wangxiaolei
2023-02-21 18:44 ` Doug Berger
2023-02-21 19:41   ` Andrew Lunn
2023-02-21 19:53     ` Doug Berger
2023-02-21 21:51       ` Doug Berger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).