2023-02-21 18:46:01

by Doug Berger

[permalink] [raw]
Subject: Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.

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



2023-02-21 19:42:18

by Andrew Lunn

[permalink] [raw]
Subject: Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.

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

2023-02-21 19:54:50

by Doug Berger

[permalink] [raw]
Subject: Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.

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

2023-02-21 21:52:53

by Doug Berger

[permalink] [raw]
Subject: Re: BCM54220: After the BCM54220 closes the auto-negotiation, the configuration forces the 1000M network port to be linked down all the time.

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