All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Roger Quadros <rogerq@kernel.org>
Cc: Md Danish Anwar <danishanwar@ti.com>,
	"Andrew F. Davis" <afd@ti.com>, Tero Kristo <t-kristo@ti.com>,
	Suman Anna <s-anna@ti.com>, YueHaibing <yuehaibing@huawei.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	nm@ti.com, ssantosh@kernel.org, srk@ti.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/2] dt-bindings: net: Add ICSSG Ethernet Driver bindings
Date: Thu, 5 Jan 2023 18:13:53 +0100	[thread overview]
Message-ID: <Y7cFUW6dFRaI+nPV@lunn.ch> (raw)
In-Reply-To: <b55dec4b-4fd5-71fa-4073-b5793cafdee7@kernel.org>

> >> On 23/12/2022 16:28, Andrew Lunn wrote:
> >>>> +        ethernet-ports {
> >>>> +            #address-cells = <1>;
> >>>> +            #size-cells = <0>;
> >>>> +            pruss2_emac0: port@0 {
> >>>> +                reg = <0>;
> >>>> +                phy-handle = <&pruss2_eth0_phy>;
> >>>> +                phy-mode = "rgmii-rxid";
> >>>
> >>> That is unusual. Where are the TX delays coming from?
> >>
> >> >From the below property
> >>
> >> +                ti,syscon-rgmii-delay = <&scm_conf 0x4120>;
> >>
> >> The TX delay can be enabled/disabled from within the ICSSG block.
> >>
> >> If this property exists and PHY mode is neither PHY_INTERFACE_MODE_RGMII_ID
> >> nor PHY_INTERFACE_MODE_RGMII_TXID then the internal delay is enabled.
> >>
> >> This logic is in prueth_config_rgmiidelay() function in the introduced driver.
> > 
> > What nearly every other MAC driver does is pass the phy-mode to the
> > PHY and lets the PHY add the delays. I would recommend you do that,
> > rather than be special and different.
> 
> 
> If I remember right we couldn't disable MAC TX delay on some earlier silicon
> so had to take this route. I don't remember why we couldn't disable it though.
> 
> In more recent Silicon Manuals I do see that MAC TX delay can be enabled/disabled.
> If this really is the case then we should change to
> 
>  phy-mode = "rgmii-id";
> 
> And let PHY handle the TX+RX delays.

DT describes the board. PHY mode indicates what delays the board
requires, because the board itself is not performing the delays by
using extra long lines. So typically, phy-mode is rgmii-id, indicating
delays need to be added somewhere in both directions.

Who adds the delays is then between the MAC and the PHY. In most
cases, the MAC does nothing, and passes phy-mode to the PHY and the
PHY does it.

But it is also possible for the MAC to do the delay. So if you cannot
actually disable the TX delay in the MAC, that is O.K. But you need to
modify phy-mode you pass to the PHY to indicate the MAC is doing the
delay, otherwise the PHY will additionally do the delay. So your DT
will contain rgmii-id, because that is what the board requires, but
the MAC will pass rmgii-rxid to the PHY, since that is what the PHY
needs to add.

	Andrew

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Roger Quadros <rogerq@kernel.org>
Cc: nm@ti.com, srk@ti.com, Paolo Abeni <pabeni@redhat.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-omap@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, YueHaibing <yuehaibing@huawei.com>,
	linux-kernel@vger.kernel.org,
	Md Danish Anwar <danishanwar@ti.com>,
	"Andrew F. Davis" <afd@ti.com>, Tero Kristo <t-kristo@ti.com>,
	Eric Dumazet <edumazet@google.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	ssantosh@kernel.org, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/2] dt-bindings: net: Add ICSSG Ethernet Driver bindings
Date: Thu, 5 Jan 2023 18:13:53 +0100	[thread overview]
Message-ID: <Y7cFUW6dFRaI+nPV@lunn.ch> (raw)
In-Reply-To: <b55dec4b-4fd5-71fa-4073-b5793cafdee7@kernel.org>

> >> On 23/12/2022 16:28, Andrew Lunn wrote:
> >>>> +        ethernet-ports {
> >>>> +            #address-cells = <1>;
> >>>> +            #size-cells = <0>;
> >>>> +            pruss2_emac0: port@0 {
> >>>> +                reg = <0>;
> >>>> +                phy-handle = <&pruss2_eth0_phy>;
> >>>> +                phy-mode = "rgmii-rxid";
> >>>
> >>> That is unusual. Where are the TX delays coming from?
> >>
> >> >From the below property
> >>
> >> +                ti,syscon-rgmii-delay = <&scm_conf 0x4120>;
> >>
> >> The TX delay can be enabled/disabled from within the ICSSG block.
> >>
> >> If this property exists and PHY mode is neither PHY_INTERFACE_MODE_RGMII_ID
> >> nor PHY_INTERFACE_MODE_RGMII_TXID then the internal delay is enabled.
> >>
> >> This logic is in prueth_config_rgmiidelay() function in the introduced driver.
> > 
> > What nearly every other MAC driver does is pass the phy-mode to the
> > PHY and lets the PHY add the delays. I would recommend you do that,
> > rather than be special and different.
> 
> 
> If I remember right we couldn't disable MAC TX delay on some earlier silicon
> so had to take this route. I don't remember why we couldn't disable it though.
> 
> In more recent Silicon Manuals I do see that MAC TX delay can be enabled/disabled.
> If this really is the case then we should change to
> 
>  phy-mode = "rgmii-id";
> 
> And let PHY handle the TX+RX delays.

DT describes the board. PHY mode indicates what delays the board
requires, because the board itself is not performing the delays by
using extra long lines. So typically, phy-mode is rgmii-id, indicating
delays need to be added somewhere in both directions.

Who adds the delays is then between the MAC and the PHY. In most
cases, the MAC does nothing, and passes phy-mode to the PHY and the
PHY does it.

But it is also possible for the MAC to do the delay. So if you cannot
actually disable the TX delay in the MAC, that is O.K. But you need to
modify phy-mode you pass to the PHY to indicate the MAC is doing the
delay, otherwise the PHY will additionally do the delay. So your DT
will contain rgmii-id, because that is what the board requires, but
the MAC will pass rmgii-rxid to the PHY, since that is what the PHY
needs to add.

	Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-01-05 17:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23 11:09 [PATCH v3 0/2] Introduce ICSSG based ethernet Driver MD Danish Anwar
2022-12-23 11:09 ` MD Danish Anwar
2022-12-23 11:09 ` [PATCH v3 1/2] dt-bindings: net: Add ICSSG Ethernet Driver bindings MD Danish Anwar
2022-12-23 11:09   ` MD Danish Anwar
2022-12-23 11:31   ` Krzysztof Kozlowski
2022-12-23 11:31     ` Krzysztof Kozlowski
2023-02-01 11:10     ` [EXTERNAL] " Md Danish Anwar
2023-02-01 11:10       ` Md Danish Anwar
2022-12-23 14:28   ` Andrew Lunn
2022-12-23 14:28     ` Andrew Lunn
2023-01-02 13:04     ` Roger Quadros
2023-01-02 13:04       ` Roger Quadros
2023-01-02 18:34       ` Andrew Lunn
2023-01-02 18:34         ` Andrew Lunn
2023-01-05 11:33         ` Roger Quadros
2023-01-05 11:33           ` Roger Quadros
2023-01-05 17:13           ` Andrew Lunn [this message]
2023-01-05 17:13             ` Andrew Lunn
2023-01-06 11:15             ` Roger Quadros
2023-01-06 11:15               ` Roger Quadros
2023-01-30  7:02           ` [EXTERNAL] " Md Danish Anwar
2023-01-30  7:02             ` Md Danish Anwar
2022-12-23 11:09 ` [PATCH v3 2/2] net: ti: icssg-prueth: Add ICSSG ethernet driver MD Danish Anwar
2022-12-23 11:32   ` Krzysztof Kozlowski
2022-12-23 11:32     ` Krzysztof Kozlowski
2023-01-02 12:55     ` Roger Quadros
2023-01-02 12:55       ` Roger Quadros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7cFUW6dFRaI+nPV@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=afd@ti.com \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=rogerq@kernel.org \
    --cc=s-anna@ti.com \
    --cc=srk@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=t-kristo@ti.com \
    --cc=vigneshr@ti.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.