All of lore.kernel.org
 help / color / mirror / Atom feed
* SMSC 9303 support
@ 2013-09-24 12:21 Gary Thomas
  2013-09-24 16:51 ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Thomas @ 2013-09-24 12:21 UTC (permalink / raw)
  To: netdev

I need to support the SMSC9303 in an embedded system.  I'm not
finding any [explicit] support for this device in the latest
mainline kernel.  Did I miss something?

To be clear, the SMSC9303 is a 3-port managed ethernet switch
capable of supporting 802.1D/802.1Q directly. This switch is
driven by a single MAC via MII/RMII and exposes the other two
ports via physical PHYs.  What I need it to do is behave like
two external, separate devices.  I was thinking that what I need
to do is treat these as VLAN devices since the switch can manage
the routing.

Does this seem like a reasonable approach?
How do I "hook up" my normal ethernet driver to it?  To the hardware
it just looks like any other MII/RMII PHY.  The device is managed
separately via I2C.  I can have that set up separately if necessary.

Thanks for any pointers/ideas

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SMSC 9303 support
  2013-09-24 12:21 SMSC 9303 support Gary Thomas
@ 2013-09-24 16:51 ` Ben Hutchings
  2013-09-24 16:59   ` Gary Thomas
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2013-09-24 16:51 UTC (permalink / raw)
  To: Gary Thomas; +Cc: netdev

On Tue, 2013-09-24 at 06:21 -0600, Gary Thomas wrote:
> I need to support the SMSC9303 in an embedded system.  I'm not
> finding any [explicit] support for this device in the latest
> mainline kernel.  Did I miss something?
> 
> To be clear, the SMSC9303 is a 3-port managed ethernet switch
> capable of supporting 802.1D/802.1Q directly. This switch is
> driven by a single MAC via MII/RMII and exposes the other two
> ports via physical PHYs.  What I need it to do is behave like
> two external, separate devices.  I was thinking that what I need
> to do is treat these as VLAN devices since the switch can manage
> the routing.
> 
> Does this seem like a reasonable approach?

Linux has 'DSA' (Distributed Switch Architecture) which supports tagging
of packets to indicate which switch port they are sent or received
through.  This was originally added to support some Marvell switch chips
and I don't know whether it would be suitable or extensible for this
one.

Ben.

> How do I "hook up" my normal ethernet driver to it?  To the hardware
> it just looks like any other MII/RMII PHY.  The device is managed
> separately via I2C.  I can have that set up separately if necessary.
> 
> Thanks for any pointers/ideas
> 

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SMSC 9303 support
  2013-09-24 16:51 ` Ben Hutchings
@ 2013-09-24 16:59   ` Gary Thomas
  2013-09-24 18:29     ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Thomas @ 2013-09-24 16:59 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev

On 2013-09-24 10:51, Ben Hutchings wrote:
> On Tue, 2013-09-24 at 06:21 -0600, Gary Thomas wrote:
>> I need to support the SMSC9303 in an embedded system.  I'm not
>> finding any [explicit] support for this device in the latest
>> mainline kernel.  Did I miss something?
>>
>> To be clear, the SMSC9303 is a 3-port managed ethernet switch
>> capable of supporting 802.1D/802.1Q directly. This switch is
>> driven by a single MAC via MII/RMII and exposes the other two
>> ports via physical PHYs.  What I need it to do is behave like
>> two external, separate devices.  I was thinking that what I need
>> to do is treat these as VLAN devices since the switch can manage
>> the routing.
>>
>> Does this seem like a reasonable approach?
>
> Linux has 'DSA' (Distributed Switch Architecture) which supports tagging
> of packets to indicate which switch port they are sent or received
> through.  This was originally added to support some Marvell switch chips
> and I don't know whether it would be suitable or extensible for this
> one.

I've used the DSA stuff for years (worked directly with the Marvell folks
when it was being developed).  It might work for this device, I'll think
some more about using it although I was hoping for a lighter weight solution.

>> How do I "hook up" my normal ethernet driver to it?  To the hardware
>> it just looks like any other MII/RMII PHY.  The device is managed
>> separately via I2C.  I can have that set up separately if necessary.
>>
>> Thanks for any pointers/ideas
>>
>

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SMSC 9303 support
  2013-09-24 16:59   ` Gary Thomas
@ 2013-09-24 18:29     ` Florian Fainelli
  2013-09-24 19:13       ` Gary Thomas
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2013-09-24 18:29 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Ben Hutchings, netdev

Hello,

2013/9/24 Gary Thomas <gary@mlbassoc.com>:
> On 2013-09-24 10:51, Ben Hutchings wrote:
>>
>> On Tue, 2013-09-24 at 06:21 -0600, Gary Thomas wrote:
>>>
>>> I need to support the SMSC9303 in an embedded system.  I'm not
>>> finding any [explicit] support for this device in the latest
>>> mainline kernel.  Did I miss something?
>>>
>>> To be clear, the SMSC9303 is a 3-port managed ethernet switch
>>> capable of supporting 802.1D/802.1Q directly. This switch is
>>> driven by a single MAC via MII/RMII and exposes the other two
>>> ports via physical PHYs.  What I need it to do is behave like
>>> two external, separate devices.  I was thinking that what I need
>>> to do is treat these as VLAN devices since the switch can manage
>>> the routing.
>>>
>>> Does this seem like a reasonable approach?
>>
>>
>> Linux has 'DSA' (Distributed Switch Architecture) which supports tagging
>> of packets to indicate which switch port they are sent or received
>> through.  This was originally added to support some Marvell switch chips
>> and I don't know whether it would be suitable or extensible for this
>> one.
>
>
> I've used the DSA stuff for years (worked directly with the Marvell folks
> when it was being developed).  It might work for this device, I'll think
> some more about using it although I was hoping for a lighter weight
> solution.

I do not think DSA is suitable for pure 802.1q switches such as this
one. OpenWrt has an out of tree patch which adds some switch-specific
operations that can be controlled over netlink (currently trying to
get them in a shape where they can be submitted for mainline
inclusion) [1], which I think is much more suitable than DSA or any
other proprietary switch tagging mechanism.

[1]: https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/swconfig.c
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SMSC 9303 support
  2013-09-24 18:29     ` Florian Fainelli
@ 2013-09-24 19:13       ` Gary Thomas
  2013-09-25  8:24         ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: Gary Thomas @ 2013-09-24 19:13 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Ben Hutchings, netdev

On 2013-09-24 12:29, Florian Fainelli wrote:
> Hello,
>
> 2013/9/24 Gary Thomas <gary@mlbassoc.com>:
>> On 2013-09-24 10:51, Ben Hutchings wrote:
>>>
>>> On Tue, 2013-09-24 at 06:21 -0600, Gary Thomas wrote:
>>>>
>>>> I need to support the SMSC9303 in an embedded system.  I'm not
>>>> finding any [explicit] support for this device in the latest
>>>> mainline kernel.  Did I miss something?
>>>>
>>>> To be clear, the SMSC9303 is a 3-port managed ethernet switch
>>>> capable of supporting 802.1D/802.1Q directly. This switch is
>>>> driven by a single MAC via MII/RMII and exposes the other two
>>>> ports via physical PHYs.  What I need it to do is behave like
>>>> two external, separate devices.  I was thinking that what I need
>>>> to do is treat these as VLAN devices since the switch can manage
>>>> the routing.
>>>>
>>>> Does this seem like a reasonable approach?
>>>
>>>
>>> Linux has 'DSA' (Distributed Switch Architecture) which supports tagging
>>> of packets to indicate which switch port they are sent or received
>>> through.  This was originally added to support some Marvell switch chips
>>> and I don't know whether it would be suitable or extensible for this
>>> one.
>>
>>
>> I've used the DSA stuff for years (worked directly with the Marvell folks
>> when it was being developed).  It might work for this device, I'll think
>> some more about using it although I was hoping for a lighter weight
>> solution.
>
> I do not think DSA is suitable for pure 802.1q switches such as this
> one. OpenWrt has an out of tree patch which adds some switch-specific
> operations that can be controlled over netlink (currently trying to
> get them in a shape where they can be submitted for mainline
> inclusion) [1], which I think is much more suitable than DSA or any
> other proprietary switch tagging mechanism.
>
> [1]: https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/swconfig.c
>

This looks interesting.  Do you have any more information on how to
integrate this and/or use it?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SMSC 9303 support
  2013-09-24 19:13       ` Gary Thomas
@ 2013-09-25  8:24         ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2013-09-25  8:24 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Ben Hutchings, netdev

2013/9/24 Gary Thomas <gary@mlbassoc.com>:
> On 2013-09-24 12:29, Florian Fainelli wrote:
>>
>> Hello,
>>
>> 2013/9/24 Gary Thomas <gary@mlbassoc.com>:
>>>
>>> On 2013-09-24 10:51, Ben Hutchings wrote:
>>>>
>>>>
>>>> On Tue, 2013-09-24 at 06:21 -0600, Gary Thomas wrote:
>>>>>
>>>>>
>>>>> I need to support the SMSC9303 in an embedded system.  I'm not
>>>>> finding any [explicit] support for this device in the latest
>>>>> mainline kernel.  Did I miss something?
>>>>>
>>>>> To be clear, the SMSC9303 is a 3-port managed ethernet switch
>>>>> capable of supporting 802.1D/802.1Q directly. This switch is
>>>>> driven by a single MAC via MII/RMII and exposes the other two
>>>>> ports via physical PHYs.  What I need it to do is behave like
>>>>> two external, separate devices.  I was thinking that what I need
>>>>> to do is treat these as VLAN devices since the switch can manage
>>>>> the routing.
>>>>>
>>>>> Does this seem like a reasonable approach?
>>>>
>>>>
>>>>
>>>> Linux has 'DSA' (Distributed Switch Architecture) which supports tagging
>>>> of packets to indicate which switch port they are sent or received
>>>> through.  This was originally added to support some Marvell switch chips
>>>> and I don't know whether it would be suitable or extensible for this
>>>> one.
>>>
>>>
>>>
>>> I've used the DSA stuff for years (worked directly with the Marvell folks
>>> when it was being developed).  It might work for this device, I'll think
>>> some more about using it although I was hoping for a lighter weight
>>> solution.
>>
>>
>> I do not think DSA is suitable for pure 802.1q switches such as this
>> one. OpenWrt has an out of tree patch which adds some switch-specific
>> operations that can be controlled over netlink (currently trying to
>> get them in a shape where they can be submitted for mainline
>> inclusion) [1], which I think is much more suitable than DSA or any
>> other proprietary switch tagging mechanism.
>>
>> [1]:
>> https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/swconfig.c
>>
>
> This looks interesting.  Do you have any more information on how to
> integrate this and/or use it?

Here are a couple of drivers that implement these "switch ops", my
favorite being b53 because it shows nicely how SPI, MDIO or MMIO
switch can be supported within the same core:

https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/b53

adm6996 is also pretty straight forward:

https://dev.openwrt.org/browser/trunk/target/linux/generic/files/drivers/net/phy/adm6996.c

and here is the user-space command line tool to query/control these
(needs libnl):

https://dev.openwrt.org/browser/trunk/package/network/config/swconfig/src
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-25  8:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-24 12:21 SMSC 9303 support Gary Thomas
2013-09-24 16:51 ` Ben Hutchings
2013-09-24 16:59   ` Gary Thomas
2013-09-24 18:29     ` Florian Fainelli
2013-09-24 19:13       ` Gary Thomas
2013-09-25  8:24         ` Florian Fainelli

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.