hvegh / Switcher

Collection of notes on managing unmanaged switches
GNU Affero General Public License v3.0
4 stars 0 forks source link

Binding DSA master port #1

Open 9ary opened 1 year ago

9ary commented 1 year ago

Hey there, I came across this repo and I'm also interested in getting this working, as I happen to have two GS108v3 switches.

Seems like the way to configure DSA is via devicetree, like so: https://github.com/torvalds/linux/blob/66a87fff1a87c260452f5a57123891ca5258c449/arch/arm/boot/dts/armada-385-linksys.dtsi#L161-L207

As far as I can tell, the master port is assigned by setting the ethernet property on the CPU-facing switch port.

The DT binding documentation can be found here: https://github.com/torvalds/linux/tree/master/Documentation/devicetree/bindings/net/dsa

Just leaving this here for now in the hope that it might help someone else, also to keep notes somewhere for when I get to testing this myself.

9ary commented 1 year ago

On top of that, if I understand the datasheet correctly, it seems that the management/"CPU" port cannot be reassigned. This means that in practice, for DSA to actually work, the switch will need to be modified more extensively (by wiring an ethernet phy or a soc directly to the internal 9th port).

hvegh commented 1 year ago

The idea was to use the in kernel DSA53 module with a properly configured DT overlay of sorts specifying the topology. Management can be done over SPI instead of inband via the managment/CPU port.

This really needs some in depth knowledge of DSA architecture within the kernel. Not there yet...

9ary commented 1 year ago

Here's the thing: the IMP has a special role in the switch, which allows it to do packet snooping. It doesn't allow any configuration, but I believe the DSA driver expects to be connected to the IMP.