Debian on Linksys EA4500 / EA4200

Just a shot in the dark, I contacted Claudio Leite (one of the authors of the driver) and he had this to say:

QuoteI remember this being an issue when I tested some work Luka Perkov (OpenWrt dev) had done for that model. I ended up not working on it, since u-boot changed architecture shortly thereafter (and his patches were never accepted...)
The data sheet requires an NDA with Marvell. I would just go through the reference code (mv_switch driver) and/or the Linksys u-boot code, and work from that.

All stuff we know, unfortunately.

Glad to hear you've made some progress! Sounds like we aren't far away from a fully working solution - the kernel driver does most of the hard work anyway.

No wonder we could not find it. Peope were quoting datasheet chapter and verse :) but nobody has a link to download.

> (mv_switch driver) and/or the Linksys u-boot code,
> and work from that.

Marvell code is actually decent for C programs. They are old style but good readability with named constants so you could actually understand what they are for. However, Linksys patch is horrible to read in parts where they have to write new code (long series of numbers without any comment). And it is still littered with personal markings from "Jim" :))

> the kernel driver does most of the hard work anyway.

Agreed. The mainline Linux driver for 6171 is good stuff (nice works Claudio Leite). With u-boot we only need a port that is alive all the time and go from there (that's why we should only care about port 0 for now).

Sorry to say, I'm doubting that the patch I am using is working at all! I've already found a few bugs and fixed them, but still a nogo. It is definitely not ready. The design showed good potentials to work. But I think I'm going back to the mainline version (which is completly different) and see if I can use that implementation.

Sorry that this silly switch is being such a pain to work with.
I feel I should just point out that the wireless radios do not work either with the Dockstar u-boot.
I'm not being "that guy" and saying you need to fix that too, just mentioning it since there may be a connection. ;)
Likely not, as the switch is connected over 2 RGMII ports and the radios over 2 PCIe ports...

Yup. I was attracted to the design of this new driver. This patch seems to have much potentials. The mainline version needs to have u-boot command executed to activate the switch, so it is more primitive. I hoped it was just a matter of configuring the correct options that we can use this with the MV88E6171.

> I feel I should just point out that the wireless
> radios do not work either with the Dockstar
> u-boot.
> I'm not being "that guy" and saying you need to
> fix that too, just mentioning it since there may
> be a connection. ;)

Don't worry. I understood :))

> Likely not, as the switch is connected over 2
> RGMII ports and the radios over 2 PCIe ports...

> I've adapted a driver patch that the author has
> tested on the mv88e6176 switch. And it partially
> works! The remaining issue is how to power up this
> mv88e6171 PHYs from a cold start.

I've contacted the author of the patch (Kevin), and he has graciously welcome testers and will provide helps in troubleshooting. It's promising, Kevin confirmed that the switches 6171 and 6176 are very similar (according to the data sheets). Hopefully it'll be just a matter of some minor configuration differences.

Thanks. The difference in behaviour is because we did not have the DSA 88E6171 switch driver activated in 4.4 kernel, so the kernel fallback to the standard Marvell mv643xx_eth driver. In the kernel 4.6, I've turned on the DSA 88E6171 switch driver, so when you boot with the DSA version, it's tried to use that driver.

We should try to troubleshoot why it did not work. It's probable that the DSA DTS has some problem. I added the DSA switch node to the old Viper DTS, but it is preliminary and still needed refinement. Perhaps we should start with the other DTS (I believe it is newer).

I've attached the DTS in this post for convenience. Anybody who has this box is welcome to take a look and perhaps help troubleshooting it!

Cool, that makes sense. I am not able to make a .dtb out of the file you provided but comparing it to the one I'm currently booting with, I don't see any reason why this one would work if the other doesn't.

My gut feeling is that it's an issue of not addressing external ports correctly. There seems to be incredibly limited documentation DSA, or utilities to debug it though, which is making it very difficult for me to learn more...

How does OpenWRT do it? There isn't as much control as with some switches (packet counters per port, mirroring etc.) but it is possible to get a link status for each port and configure hardware VLANs, which while it isn't all of the functionality, it's certainly the most useful stuff.

but they need someone to test that to make sure that it is not breaking anything on these devices.

I can provide flashable images from that developer's branch so you only need to flash (and be able to recover in case of issues), if you want.

EDIT: in the post above the one I linked there is also some talk about enabling DSA driver on linksys switch, if there is someone able to test it I can try making a script that would allow migration from old switch to new switch config so LEDE can enable the DSA driver on these boards.

OpenWRT seems to handle the switch quite well. I have yet to get DSA working on any of bodhi's builds, although I'm aware it's a work-in-progress. Pity that the wireless radios seem to perform so poorly (even with stock firmware) but that's an issue for another thread.

Quote> There is some work to update Kirkwood kernel from
> 4.4 to 4.9 in LEDE here https://github.com/lede-pr
> oject/source/pull/1019#issuecomment-310870447

Cool!

I've not read that thread yet. But a quick question: is the updated driver in u-boot from Kevin Smith? I did some testing with his driver way back, and I think it is a really good driver that only needs some small adaptation for this specific switch. But I did not have time to pursue further.

QuoteDebian is not the best place to get a bleeding edge driver.

That is a fact.

Update:

I have scanned the thread, my impression is u-boot did not not get updated for this router, only the kernel DTS?

> And afaik in LEDE/Openwrt the switch is a dumb swi
> tch (but I can't confirm as I don't have it). I do
> n't know if with this change it becomes VLAN capab
> le, this has to be tested by megal0maniac.

Yes. This is what my non-DSA DTS version was based on. It is a dumb switch.

> I think that with DSA driver then the switch's VLA
> N functionality can be used, as all ports become s
> eparate netdevs.

The kernel Marvell DSA driver should work. I did not pursue this further, but I recalled thinking with more testing and tweaking the DTS, it will be possible. The DSA-enable DTS in my patch is a work-in-progress.

OpenWRT has always (since I've used it on this board, which was before the beginning of this thread) been capable of configuring VLANs through the web interface (or swconfig)
I have no idea how it works, I tried running swconfig on Debian as well (non-DSA dtb, same one OpenWRT uses) and it doesn't detect the switch at all. I don't know enough about how it works to determine why.
I tried booting the 4.11.3 kernel with DSA and it didn't work (http://forum.doozan.com/read.php?2,34978)
I'll try the LEDE image soon.

Here is the new DTB file: kirkwood-ea4500.dtb. I've adapted the latest version in mainline, and changed the box name and LEDs name to be consistent with what we have in kernel linux-4.12.1-kirkwood-tld-1.

bodhi Wrote:
-------------------------------------------------------
> Sorry to say, I'm doubting that the patch I am
> using is working at all! I've already found a few
> bugs and fixed them, but still a nogo. It is
> definitely not ready. The design showed good
> potentials to work. But I think I'm going back to
> the mainline version (which is completly
> different) and see if I can use that
> implementation.
>
> In case anybody is interested, this is the patch:
> http://lists.denx.de/pipermail/u-boot/2015-December/238146.html

Bodhi long time no see. Happy new year first.
Do you find this driver useful?I also take hope to this driver to make my 88E6161 working but fails and you?

I meant the kernel. You can boot the new kernel with stock u-boot. And it is working fine.

I was working on the new u-boot a while ago, but I stopped before getting the DSA switch working. There was a good potential to get it working by tweaking a new driver for another Marvell switch, but I ran out of time. Will revisit this new u-boot in the future.

Do you try the new driver in new architecture uboot? What is your new driver in "There was a good potential to get it working by tweaking a new driver for another Marvell switch, " can I download from Internet? Thanks

Please, enter the code that you see below in the input field.
This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right.
If you enter the wrong code, a new image is created and you get
another chance to enter it right.