Skip to contentSkip to conversation

SMSC 9303 support

DISCUSSION Gary Thomas 3 participants 6 messages Sep 24, 2013 – Sep 25, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#1 lore raw
Quoted 12 lines · Gary Thomas

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.

Quoted 1 line

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.

Quoted 6 lines

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

Signature · 3 lines
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.
#2 lore raw
Quoted 13 lines · Ben Hutchings
Quoted 12 lines · Gary Thomas

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.

Quoted 7 lines
Quoted 1 line

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.

Quoted 7 lines
Quoted 6 lines

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

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#3 lore raw

Hello,

2013/9/24 Gary Thomas <[email protected]>:

Quoted 26 lines · Ben Hutchings
Quoted 15 lines · Gary Thomas
Quoted 13 lines

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.

Quoted 8 lines
Quoted 1 line

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.

Quoted 4 lines

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

Signature · 1 line
Florian
#4 lore raw
Quoted 34 lines · Florian Fainelli

Hello,

2013/9/24 Gary Thomas <[email protected]>:

Quoted 26 lines · Ben Hutchings
Quoted 15 lines · Gary Thomas
Quoted 13 lines

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.

Quoted 8 lines
Quoted 1 line

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.

Quoted 4 lines

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.

Quoted 9 lines

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?

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#5 lore raw

2013/9/24 Gary Thomas <[email protected]>:

Quoted 49 lines · Florian Fainelli
Quoted 48 lines

Hello,

2013/9/24 Gary Thomas <[email protected]>:

Quoted 31 lines · Ben Hutchings
Quoted 21 lines · Gary Thomas
Quoted 14 lines

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.

Quoted 1 line

Does this seem like a reasonable approach?

Quoted 5 lines

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.

Quoted 4 lines

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.

Quoted 6 lines
Quoted 3 lines

[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

Signature · 1 line
Florian