netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Adam Rudziński" <adam.rudzinski@arf.net.pl>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	robh+dt@kernel.org, frowand.list@gmail.com
Subject: Re: drivers/of/of_mdio.c needs a small modification
Date: Sat, 29 Aug 2020 18:00:47 +0200	[thread overview]
Message-ID: <20200829160047.GD2912863@lunn.ch> (raw)
In-Reply-To: <76f88763-54b0-eb03-3bc8-3e5022173163@arf.net.pl>

> This is true assuming that the PHYs are always and forever connected to one
> specific MDIO bus. This is probably reasonable. Although, in i.MX the MDIO
> bus of FEC1 and FEC2 shares the pins.

In general, they do not. In fact, i don't see how that can work. The
FEC drive provides no mutual exclusion between MDIO operations on
different MDIO controllers. So one controller could be performing a
read while the other a write. If they are sharing the same pins, how
do you drive the clock pin both high and low at the same time? How do
you have the data pin both high impedance so the PHY can drive it, and
also drive out a 0 or a 1 to perform a right?

What is suspect you can do is use pinmux to connect the pins to either
ethernet1 MDIO controller, or ethernet2 mdio controller. But never
both. You have to decide which gets to control the bus, and the other
controller is isolated.

> I'm sure of that - LAN8720A needs to have the clock from FEC or external
> generator to be able to talk over MDIO.

O.K. Then you need to core to enable the clock before scanning the
bus.

	Andrew

  reply	other threads:[~2020-08-29 16:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c8b74845-b9e1-6d85-3947-56333b73d756@arf.net.pl>
2020-08-28 22:28 ` drivers/of/of_mdio.c needs a small modification Andrew Lunn
2020-08-28 22:34   ` Adam Rudziński
2020-08-28 22:53     ` Andrew Lunn
2020-08-28 23:14       ` Adam Rudziński
2020-08-29  3:29         ` Florian Fainelli
2020-08-29  8:15           ` Adam Rudziński
2020-08-29 15:15             ` Andrew Lunn
2020-08-29 15:37               ` Adam Rudziński
2020-08-29 16:00                 ` Andrew Lunn [this message]
2020-08-29 18:01                   ` Adam Rudziński
2020-08-29 23:16                     ` Andrew Lunn
2020-08-30 20:47                       ` Adam Rudziński

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=20200829160047.GD2912863@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=adam.rudzinski@arf.net.pl \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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).