netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lambrecht Jürgen" <J.Lambrecht@TELEVIC.com>
To: Florian Fainelli <florian@openwrt.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-embedded@vger.kernel.org" <linux-embedded@vger.kernel.org>
Subject: Re: [PATCH] net: phy: Add config option to specify external switch port to be used if switch is used as PHY
Date: Thu, 8 Sep 2011 12:00:13 +0200	[thread overview]
Message-ID: <4E68922D.8020805@televic.com> (raw)
In-Reply-To: <201109081039.35272.florian@openwrt.org>

On 09/08/2011 10:39 AM, Florian Fainelli wrote:
>
> Hello Jurgen,
>
> On Thursday 08 September 2011 08:54:07 Lambrecht Jürgen wrote:
> > Hello,
> >
> > In our embedded designs, this is a useful patch. Maybe it can be useful
> > for somebody else too.
> > Or maybe there are already better solutions?
> > I know I could also write a driver for our switch, but that is too much
> > effort just to select the active port.
>
> This is not going to work well with all switches out there. You could 
> use the
>
Do not all switches follow the basic MII register map with room for 31 
phy's?
>
> fixed-PHY driver to make your ethernet driver see the link as always 
> up between
> the MAC and switch CPU port.
>
Indeed, I tried to, but it didn't work. (would be my preferred solution)
I juist enabled FIXED_PHY in menuconfig (and kept MII, NET_ETHERNET and 
FEC (for my iMX cpu); also PHYLIB is on that makes mdio_bus.c compile). 
I checked the architecture file for mpc866ads and didn't find any init 
for it, but maybe I need to initialize fixed-PHY somewhere?

However, it could be interesting sometimes from application side to know 
if the real external link is up, then fixed-PHY is not ok.
>
>
> A better solution would be to have proper switch drivers and 
> user-space, which
> reminds me that we (OpenWrt) should at some point propose our switch 
> drivers
> [1] for review.
>
> [1]:
> https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/
>
Just had a fast look to the Marvell switch driver. Nice to know it is there.
>
>
> >
> > Kind regards,
> > Jürgen
> >
> >    In embedded design, instead of a PHY, sometimes a switch is used that
> >            behaves as a PHY through its MII port. For example to use a
> > daisy chain network configuration instead of an expensive star 
> config. In
> > that case, many phy ports are available, but only 1 should be used
> >            to check link status, and not the first one available as is
> > the case
> >            without this configuration (that is, set to its default value
> > 0). So this options specifies the switch port number to be used to check
> >            link status, because if the link is down, no data is sent 
> by the
> >            TCP/IP stack.
> >
> > Signed-off-by: Jürgen Lambrecht <J.Lambrecht@televic.com>
> > ---
>
[snip]
>
> --
> Florian
>


-- 
Jürgen Lambrecht
R&D Associate
Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
http://www.televic-rail.com
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk

  reply	other threads:[~2011-09-08 10:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08  6:54 [PATCH] net: phy: Add config option to specify external switch port to be used if switch is used as PHY Lambrecht Jürgen
2011-09-08  8:39 ` Florian Fainelli
2011-09-08 10:00   ` Lambrecht Jürgen [this message]
2011-09-08 10:13 ` Francois Romieu
2011-09-08 11:59   ` Lambrecht Jürgen
2011-09-08 21:24     ` Francois Romieu

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=4E68922D.8020805@televic.com \
    --to=j.lambrecht@televic.com \
    --cc=florian@openwrt.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=netdev@vger.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).