[PATCH net-next 0/3] net: phy: dp83822: Add support for changing the MAC series termination

Dimitri Fedrau via B4 Relay posted 3 patches 11 months, 1 week ago
There is a newer version of this series
.../devicetree/bindings/net/ethernet-phy.yaml      |  5 +++
drivers/net/phy/dp83822.c                          | 36 ++++++++++++++++++++++
drivers/net/phy/phy_device.c                       | 15 +++++++++
include/linux/phy.h                                |  3 ++
4 files changed, 59 insertions(+)
[PATCH net-next 0/3] net: phy: dp83822: Add support for changing the MAC series termination
Posted by Dimitri Fedrau via B4 Relay 11 months, 1 week ago
The dp83822 provides the possibility to set the resistance value of the
the MAC series termination. Modifying the resistance to an appropriate
value can reduce signal reflections and therefore improve signal quality.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
Dimitri Fedrau (3):
      dt-bindings: net: ethernet-phy: add property mac-series-termination-ohms
      net: phy: Add helper for getting MAC series termination resistance
      net: phy: dp83822: Add support for changing the MAC series termination

 .../devicetree/bindings/net/ethernet-phy.yaml      |  5 +++
 drivers/net/phy/dp83822.c                          | 36 ++++++++++++++++++++++
 drivers/net/phy/phy_device.c                       | 15 +++++++++
 include/linux/phy.h                                |  3 ++
 4 files changed, 59 insertions(+)
---
base-commit: 865eddcf0afbcd54f79b81e6327ea40c997714c7
change-id: 20250305-dp83822-mac-impedance-840435b0c9e6

Best regards,
-- 
Dimitri Fedrau <dimitri.fedrau@liebherr.com>
Re: [PATCH net-next 0/3] net: phy: dp83822: Add support for changing the MAC series termination
Posted by Andrew Lunn 11 months, 1 week ago
On Fri, Mar 07, 2025 at 11:30:00AM +0100, Dimitri Fedrau via B4 Relay wrote:
> The dp83822 provides the possibility to set the resistance value of the
> the MAC series termination. Modifying the resistance to an appropriate
> value can reduce signal reflections and therefore improve signal quality.

I have some dumb questions....

By referring to MAC from the perspective of the PHY, do you mean the
termination of the bus between the MAC and the PHY? The SGMII SERDES,
or RGMII?

I'm assuming the terminology is direct from the datasheet of the PHY?
But since this is a bit of a niche area, no other PHY driver currently
supports anythings like this, the terminology is not well known. So it
would be good to expand the description, to make it really clear what
you are talking about, so if anybody else wants to add the same
feature, they make use of the property, not add a new property.

    Andrew

---
pw-bot: cr
Re: [PATCH net-next 0/3] net: phy: dp83822: Add support for changing the MAC series termination
Posted by Dimitri Fedrau 11 months, 1 week ago
Am Fri, Mar 07, 2025 at 02:39:32PM +0100 schrieb Andrew Lunn:
> On Fri, Mar 07, 2025 at 11:30:00AM +0100, Dimitri Fedrau via B4 Relay wrote:
> > The dp83822 provides the possibility to set the resistance value of the
> > the MAC series termination. Modifying the resistance to an appropriate
> > value can reduce signal reflections and therefore improve signal quality.
> 
> I have some dumb questions....
> 
> By referring to MAC from the perspective of the PHY, do you mean the
> termination of the bus between the MAC and the PHY? The SGMII SERDES,
> or RGMII?
>
- Yes, the perspective is from the PHY.
- Yes, but only the outputs towards the MAC. Resistors can be saved on
  the PCB when they are integrated into the PHY.
- The PHY is able to operate with RGMII, RMII and MII.

Should I rename then "mac-series-termination-ohms" to
"output-mac-series-termination-ohms" or similar ?

> I'm assuming the terminology is direct from the datasheet of the PHY?
> But since this is a bit of a niche area, no other PHY driver currently
> supports anythings like this, the terminology is not well known. So it
> would be good to expand the description, to make it really clear what
> you are talking about, so if anybody else wants to add the same
> feature, they make use of the property, not add a new property.

The datasheet calls it MAC impedance control, that is what someone might
want to achieve when selecting the proper resistance value. I named it
"mac-series-termination-ohms" instead to make sure what is done to
achieve impedance matching.

Should I add the proper description in the bindings ? Description of the
properties are somehow short. However will expand the description.

Best regards,
Dimitri Fedrau
Re: [PATCH net-next 0/3] net: phy: dp83822: Add support for changing the MAC series termination
Posted by Andrew Lunn 11 months, 1 week ago
> Should I add the proper description in the bindings ? Description of the
> properties are somehow short. However will expand the description.

Yes, please expand the description. For well known concepts, we can
keep the binding description short. But i would not consider this a
well known concept, so we need to spell out in detail what it is.

My knowledge of transmission lines and termination is not so good....

So this configures the resistor on the PHY outputs. Do PHY inputs also
need termination resistors? Could there be PHYs which also allow such
resistors to be configured? Are there use cases where you need
asymmetric termination resistors?

My questions are trying to lead to an answer to your question:

> Should I rename then "mac-series-termination-ohms" to
> "output-mac-series-termination-ohms" or similar ?

We should think about this from the general case, not one specific
PHY, and ideally from thinking about the physics of termination.

https://electronics.stackexchange.com/questions/524620/impedance-termination-of-marvell-phy

This seems to suggest RGMII only has termination resistors at the
outputs. So "mac-series-termination-ohms" would be O.K.

	Andrew
Re: [PATCH net-next 0/3] net: phy: dp83822: Add support for changing the MAC series termination
Posted by Dimitri Fedrau 11 months, 1 week ago
Am Fri, Mar 07, 2025 at 04:34:59PM +0100 schrieb Andrew Lunn:
> > Should I add the proper description in the bindings ? Description of the
> > properties are somehow short. However will expand the description.
> 
> Yes, please expand the description. For well known concepts, we can
> keep the binding description short. But i would not consider this a
> well known concept, so we need to spell out in detail what it is.
>
Ok.

> My knowledge of transmission lines and termination is not so good....
> 
> So this configures the resistor on the PHY outputs. Do PHY inputs also
> need termination resistors? Could there be PHYs which also allow such
> resistors to be configured? Are there use cases where you need
> asymmetric termination resistors?
>
I think they are also needed for the PHY inputs, but termination
resistors should be placed near the driver. In case the MAC doesn't have
them integrated they should be placed near the MAC outputs. From PHY
perspective we just care about the PHY outputs.

https://resources.pcb.cadence.com/blog/termination-resistors-in-pcb-design

I don't know if there is a general rule that states wether to use series
termination or not. I think it depends on the PCB design and if there are
issues with signal quality. Maybe this one helps, there is a small
chapter regarding series termination:

https://resources.altium.com/p/gigabit-ethernet-101-basics-implementation

Found it reading this:

https://community.nxp.com/t5/i-MX-Processors/Why-doesn-t-NXP-use-termination-resistors-for-MII-data-lines/td-p/1360873

> My questions are trying to lead to an answer to your question:
> 
> > Should I rename then "mac-series-termination-ohms" to
> > "output-mac-series-termination-ohms" or similar ?
> 
> We should think about this from the general case, not one specific
> PHY, and ideally from thinking about the physics of termination.
> 
> https://electronics.stackexchange.com/questions/524620/impedance-termination-of-marvell-phy
> 
> This seems to suggest RGMII only has termination resistors at the
> outputs. So "mac-series-termination-ohms" would be O.K.
>
Ok.

Best regards,
Dimitri Fedrau