All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Peter Rosin <peda@axentia.se>,
	netdev@vger.kernel.org, Russell King <rmk+kernel@armlinux.org.uk>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH RFC net-next] dt-bindings: ethernet-controller: document signal multiplexer
Date: Wed, 7 Jul 2021 01:22:24 +0200	[thread overview]
Message-ID: <20210707012224.14df9eab@thinkpad> (raw)
In-Reply-To: <YN5kGsMwds+wCACq@lunn.ch>

On Fri, 2 Jul 2021 02:55:54 +0200
Andrew Lunn <andrew@lunn.ch> wrote:

> On Thu, Jul 01, 2021 at 02:53:47AM +0200, Marek Behún wrote:
> > There are devices where the MAC signals from the ethernet controller are
> > not directly connected to an ethernet PHY or a SFP cage, but to a
> > multiplexer, so that the device can switch between the endpoints.
> > 
> > For example on Turris Omnia the WAN controller is connected to a SerDes
> > switch, which multiplexes the SerDes lanes between SFP cage and ethernet
> > PHY, depending on whether a SFP module is present (MOD_DEF0 GPIO from
> > the SFP cage).  
> 
> At the moment, i don't think phylink supports this. It does not have a
> way to dynamically switch PHY. If the SFP disappears, you probably
> want to configure the PHY, so that it is up, autoneg started,
> etc. When the SFP reappears, the PHY needs to be configured down, the
> SFP probably needs its TX GPIO line set active, etc. None of this
> currently exists.

Of course this is not supported by phylink: it can't be, since we don't
even have a binding description :) I am figuring out how to do correct
binding while working on implementing this into phylink.

> The Marvell switches have something similar but different. Which ever
> gets link first, SFP or PHY gets the data path. In this case, you
> probably want phylink to configure both the SFP and the PHY, and then
> wait and see what happens. The hardware will then set the mux when one
> of them gets link. phylink should then configure the other
> down. Again, non of this exists at the moment.
> 
> I would imaging a similar binding could be used for these two
> conditions. But until we get the needed code, it is hard for me to
> say. So i think i would prefer to wait until we do have code.
> 

I now have an idea that might be sane for bindings, so next time I will
send the code as well.

> I also wonder how wise it is to put this into the generic ethernet
> controller binding. Muxing based on MOD_DEF0 i expect to be very
> rare. Muxing based on first port having link seems more likely. But
> both i expect are pretty unusual. So i would be tempted to make it a
> standalone binding, which can be imported into an MAC binding which
> actually needs it. Or it actually becomes part of the phylink
> binding, since this all appears to be PHY related, not MAC.
> 
> 	  Andrew

We'll see. Stay tuned for my patch series. :)

Marek

  reply	other threads:[~2021-07-06 23:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  0:53 [PATCH RFC net-next] dt-bindings: ethernet-controller: document signal multiplexer Marek Behún
2021-07-01 14:02 ` Rob Herring
2021-07-01 18:04 ` Rob Herring
2021-07-02  0:55 ` Andrew Lunn
2021-07-06 23:22   ` Marek Behún [this message]
2021-07-07 17:14     ` Russell King (Oracle)

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=20210707012224.14df9eab@thinkpad \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=rmk+kernel@armlinux.org.uk \
    --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 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.