netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: About PHY_INTERFACE_MODE_REVMII
Date: Tue, 2 Feb 2021 12:29:13 -0800	[thread overview]
Message-ID: <9802cd3e-dd8f-9006-cbaf-127aeab19b05@gmail.com> (raw)
In-Reply-To: <20210202005306.k7fhc4hhwbjxqbsr@skbuf>

On 2/1/21 4:53 PM, Vladimir Oltean wrote:
> Hi Florian,
> 
> Thanks for the quick answer!
> 
> On Mon, Feb 01, 2021 at 04:26:36PM -0800, Florian Fainelli wrote:
>> It depends on the level of control that you have and expect more on that
>> below.
> 
>> That is true if we consider that you can use an electrical connection
>> other than MII, which was the flaw in the reasoning leading to introduce
>> the above commit. If you took the name reverse MII literally like I did,
>> you would not think it would apply to anything but MII and maybe reduced
>> MII, but not GMII or RGMII. More on that below.
> 
>> I don't believe I ever saw a system that used reverse MII and yet did
>> not use either plain MII as far as the electrical connections went. That
>> does not mean you could not electrically connect these two systems using
>> RMII, GMII or something else. With RGMII, I don't see the point in using
>> a RevMII block especially as far as clocking goes, both link partners
>> can have their own local clock and just do clock recovery upon receive.
>>
>> When this commit was done, the only use case that had to be supported
>> was the case of two Ethernet MACs (one a video decoder, the other a
>> cable modem) connected over a MII electrical connection and we could not
>> change the cable modem side, so we act to make ourselves "look like" a
>> PHY which the hardware supported. Back then the GENET driver was just
>> getting a facelift to use PHYLIB and so it still used a fixed-link plus
>> phy-mode = "rev-mii" to get that mode to work which was probably too big
>> of a shortcut in addition to the flaw in the reasoning about what RevMII
>> really was.
>>
>> If you would like to deprecate/warn when using PHY_INTERFACE_MODE_REVMII
>> value and come up with a better way to represent such links, no issues
>> with me, it looks like we have a few in tree users to convert.
> 
> Well, everything depends on whether a formal specification of RevMII
> exists or not. If you're sure that all users of PHY_INTERFACE_MODE_REVMII
> actually use the 8-bit wide parallel data interface that runs at 25 MHz
> and 100 Mbps ("that" MII), just that they operate in MII PHY mode instead
> of MII MAC, then I can work with that, no reason to deprecate it.

I just checked with the designer of the GENET controller and he
indicated that there is no known specification to date for Reverse MII.

According to him this is really just specific to MII because for every
other electrical mode defined there after: Reduced MII, GMII or RGMII
you can either share the same reference clock (reduced MII) or you can
recover the clock from the transmitted data.

> 
> The problem is that I saw no online reference of RevMII + RMII = RevRMII,
> which would make just as much sense as RevMII. And as I said, RGMII does
> support in-band signaling, it's just probably too obscure to see it in
> the wild or rely on it. RGMII without in-band signaling has no reason to
> differentiate between MAC and PHY role, but taking the inband signaling
> into account it does. So RevRGMII might be a thing too.
> 
> For example, the sja1105 supports MII MAC, MII PHY, RMII MAC, RMII PHY
> modes. But it doesn't export a clause 22 virtual PHY register map to
> neither end of the link - it doesn't have any MDIO connection at all.
> Does the sja1105 support RevMII or does it not? If RevMII means MII PHY
> and the clause 22 interface is just optional (like it is for normal MII,
> RMII, RGMII which can operate in fixed-link too), then I'd say yes,
> sja1105 supports RevMII. But if RevMII is _defined_ by that standardized
> clause 22 interface, then no it doesn't.
> 
> In the DSA driver, I created some custom device tree bindings to solve
> the situation where you'd have two sja1105 devices connected MAC to MAC
> using RMII or MII: sja1105,role-mac and sja1105,role-phy. There are no
> in-tree users of these DT properties, so depending on how this
> conversation goes, I might just go ahead and do the other thing: say
> that RevRMII exists and the clause 22 PHY registers are optional, add
> PHY_INTERFACE_MODE_REVRMII, and declare that sja1105 supports
> PHY_INTERFACE_MODE_REVMII which is the equivalent of what is currently
> done with PHY_INTERFACE_MODE_MII + sja1105,role-phy, and
> PHY_INTERFACE_MODE_REVRMII.
> 
> Having a separate PHY interface mode for RevRMII would solve the situation
> where you have two instances of the same driver at the two ends of the
> same link, seeing the same PHY registers, but nonetheless needing to
> configure themselves in different modes and not having what to base that
> decision on. What do you think?

Agreed, at least it is consistent with the existing
PHY_INTERFACE_MODE_REVMII and the presence/absence of a fixed-link would
tell us whether a C22 compatible interface exists... works for me.
-- 
Florian

      reply	other threads:[~2021-02-02 20:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 21:45 About PHY_INTERFACE_MODE_REVMII Vladimir Oltean
2021-02-02  0:26 ` Florian Fainelli
2021-02-02  0:53   ` Vladimir Oltean
2021-02-02 20:29     ` Florian Fainelli [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=9802cd3e-dd8f-9006-cbaf-127aeab19b05@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.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).