netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Hancock <robert.hancock@calian.com>
To: "andy.chiu@sifive.com" <andy.chiu@sifive.com>
Cc: "linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"greentime.hu@sifive.com" <greentime.hu@sifive.com>,
	"radhey.shyam.pandey@xilinx.com" <radhey.shyam.pandey@xilinx.com>
Subject: Re: [PATCH] net: axiemac: initialize PHY before device reset
Date: Thu, 17 Mar 2022 18:26:41 +0000	[thread overview]
Message-ID: <8122f4ed485d92464d30a1d1ef4584be2dc8c99c.camel@calian.com> (raw)
In-Reply-To: <CABgGipU3n8g750kQj3ZgoMwXOLQAsM5d+HDRBWoiGEcZ9-uCSw@mail.gmail.com>

On Fri, 2022-03-18 at 01:37 +0800, Andy Chiu wrote:
> Thanks for pointing that out.
> 
> Though it is weird, it should be safe to do that. The reset of the
> MDIO interface would not affect any r/w through the bus afterwards
> since the driver would re-initialize the MDIO interface whenever it
> uses `mdiobus_write()` or `mdiobus_read()` for bus transactions.
> However, some of the very first packet on the rx side might get
> processed incompletely since `phylink_of_phy_connect()` will
> eventually call `phy_resume()`, which brings the phy active earlier
> than the reset of the core.
> 
> The reason why we have this change in ordering is that the clock of
> our PCS/PMA PHY is sourced from the SGMII ref clock of the external
> PHY, which is not enabled by default. The only way to get the PCS/PMA
> PHY stable here is to start the clock (initialize the external PHY)
> before the reset takes place. We have limited clock sources on the
> vcu118 FPGA board, and this happens to be our way to configure it. I
> think it is a hack on both sw and hw, but still wonder if anyone under
> such hw configuration, if exist, would like to have the patch.

I haven't looked at the clock setup on the VCU118 in detail, but we have used a
setup with this Ethernet core on the ZCU102 board to feed one of the SFP cages.
In that case we used the Si570 USER_MGT clock to feed the PCS/PMA clock by
changing its clock frequency to 156.25 MHz and routing that to the Ethernet
mgt_clk with the core set to accept that frequency.

It looks like a similar clock input is available on VCU118, I'm not sure if you
can do something similar in your setup? Since I assume this is all hardware on
the standard VCU118 board, Xilinx should likely have some example design for
this setup, I'm not sure what that is using?

Likely using a fixed board clock rather than one from the PHY is better if
possible, as you don't have this issue of the clock dependency going backwards
up the chain..

> 
>                |<---ref clock-----|
> +----------+---^---+         +------+
> > Xilinx's |  PCS/ |         | Ti's |
> > Ethernet |  PMA  |--SGMII--| PHY  |
> >          |  PHY  |         |      |
> +----------+-------+         +------+
>       |--------|--- MDIO---------|
> 
> loop-in: radhey.shyam.pandey@xilinx.com
> 
> Andy
> 
> 
> Andy
-- 
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies
www.calian.com

      reply	other threads:[~2022-03-17 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  7:57 [PATCH] net: axiemac: initialize PHY before device reset Andy Chiu
2022-03-16 20:01 ` Jakub Kicinski
2022-03-16 20:55 ` Robert Hancock
2022-03-17 17:37   ` Andy Chiu
2022-03-17 18:26     ` Robert Hancock [this message]

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=8122f4ed485d92464d30a1d1ef4584be2dc8c99c.camel@calian.com \
    --to=robert.hancock@calian.com \
    --cc=andy.chiu@sifive.com \
    --cc=davem@davemloft.net \
    --cc=greentime.hu@sifive.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=radhey.shyam.pandey@xilinx.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 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).