Welcome! Log In Create A New Profile

Advanced

Debian on Linksys EA4500 / EA4200

Posted by megal0maniac 
Re: Linksys EA4500 / EA4200 support
April 16, 2016 04:37AM
Just a shot in the dark, I contacted Claudio Leite (one of the authors of the driver) and he had this to say:
Quote

I 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.
Re: Linksys EA4500 / EA4200 support
April 16, 2016 02:14PM
> The data sheet requires an NDA with Marvell.

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).

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 04/16/2016 02:41PM by bodhi.
Re: Linksys EA4500 / EA4200 support
April 21, 2016 12:34AM
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
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 04/22/2016 02:21PM by bodhi.
Re: Linksys EA4500 / EA4200 support
April 21, 2016 12:59AM
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...
Re: Linksys EA4500 / EA4200 support
April 21, 2016 01:27AM
> Sorry that this silly switch is being such a pain
> to work with.

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'm seeing this:

[   20.260079] Marvell TOPDOG(R) 802.11 Wireless Network Driver version 0.13
[   20.302559] pci 0000:00:01.0: enabling bus mastering
[   20.323666] pci 0000:00:02.0: enabling bus mastering
[   21.146778] ieee80211 phy0: Command RF_ANTENNA error 0x2
[   21.152163] ieee80211 phy0: failed to set # of RX antennas
[   21.173199] ieee80211 phy0: Command RF_ANTENNA error 0x2
[   21.178565] ieee80211 phy0: failed to set # of TX antennas
[   21.193182] ieee80211 phy0: 88w8366 v48, 20aa4bf65ff2, STA firmware 4.1.0.3
[   21.218642] ieee80211 phy1: Command RF_ANTENNA error 0x2
[   21.224197] ieee80211 phy1: failed to set # of RX antennas
[   21.231632] ieee80211 phy1: Command RF_ANTENNA error 0x2
[   21.243314] ieee80211 phy1: failed to set # of TX antennas
[   21.248892] ieee80211 phy1: 88w8366 v48, 20aa4bf65ff4, STA firmware 4.1.0.3
Is this what you meant?

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 04/22/2016 02:23PM by bodhi.
Re: Linksys EA4500 / EA4200 support
April 23, 2016 02:11PM
> 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.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linksys EA4500 / EA4200 support
May 19, 2016 10:14AM
Hi bodhi
Have you managed to make any progress on this? I haven't played with it much, but I started poking again the other day.
Re: Linksys EA4500 / EA4200 support
May 19, 2016 05:21PM
Unfortunately, no. The driver works only intermittently currently. So not sure we'll get the final version that I can trust.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linksys EA4500 / EA4200 support
July 24, 2016 07:01AM
Hello

Just an update, booting the 4.4.0 image but with the kirkwood-ea4500-dsa dtb file from the latest kernel (4.6) is successful. I get warnings in the boot log, looks quite familiar:
[    2.037378] Distributed Switch Architecture driver version 0.1
[    2.043736] mv643xx_eth_port mv643xx_eth_port.0 eth0: [0]: could not detect attached switch
[    2.052128] mv643xx_eth_port mv643xx_eth_port.0 eth0: [0]: couldn't create dsa switch instance (error -22)
The network devices do function though. They have the correct MAC addresses and communicate correctly with the outside world.

Booting the 4.6 kernel with the dsa dtb, the boot log looks happier but I cannot establish communication through either eth0 or eth1
[    2.727659] Distributed Switch Architecture driver version 0.1
[    2.735068] mdio_bus f1072004.mdio-bu: unknown revision 2, using base switch 0x1710
[    2.742767] mv643xx_eth_port mv643xx_eth_port.0 eth0: [0]: detected a Marvell 88E6171 switch
[    2.891991] libphy: dsa slave smi: probed
[    2.982327] Generic PHY dsa-0:10:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0:10:00, irq=-1)
[    3.087273] Generic PHY dsa-0:10:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0:10:01, irq=-1)
[    3.198188] Generic PHY dsa-0:10:02: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0:10:02, irq=-1)
[    3.292302] Generic PHY dsa-0:10:03: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0:10:03, irq=-1)
[    3.392294] Generic PHY dsa-0:10:04: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0:10:04, irq=-1)

When the interface comes up and it tries to get a DHCP address, I get this:
[   20.203250] mv643xx_eth: no PHY
[   20.206370] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
(snip)
[  106.714177] mv643xx_eth: no PHY
[  106.717221] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
And the interface never manages to get an address even if it is connected.

EDIT: The "no PHY" messages might be a red herring. If I boot 4.6 with the standard .dtb, both interfaces work and I still get that message



Edited 3 time(s). Last edit at 07/24/2016 07:30AM by megal0maniac.
Re: Linksys EA4500 / EA4200 support
July 24, 2016 01:02PM
megal0maniac,

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!

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Attachments:
open | download - kirkwood-ea4500-dsa.dts (3.6 KB)
Re: Linksys EA4500 / EA4200 support
July 24, 2016 03:21PM
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.
Re: Linksys EA4500 / EA4200 support
July 24, 2016 03:37PM
>
> How does OpenWRT do it?

They don't use DSA. If you look at dmesg, the driver is mvsw61xx specified in their DTS that we are using as the base.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linksys EA4500 / EA4200 support
September 21, 2016 12:39PM
Re: Linksys EA4500 / EA4200 support
September 21, 2016 01:21PM
Me still! VLANs work on OpenWRT, just to reiterate. I don't know what black magic they're using, but running swconfig on Debian doesn't even see the switch chip.
Re: Linksys EA4500 / EA4200 support
September 21, 2016 02:09PM
bodhi Wrote:
-------------------------------------------------------
> I'm curious, how many among us have this box? are
> there interest still?

I have both an EA4500 and an E4200V2 (identical hardware). I also have an EA3500 which has half the memory and half the flash, but uses the same switch and radios.
Re: Linksys EA4500 / EA4200 support
September 21, 2016 05:03PM
Yeah, OpenWrt use it as a dumb switch. Not DSA. But their DTB works for Debian the same way. You need to go back a few versions (of my releases) to run this DTB.

(Update: looks like 4.2 is the version that can run this DTB).

Im thinking to take a look at this Uboot again since a similar driver has been mainlined.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 3 time(s). Last edit at 09/22/2016 08:03PM by bodhi.
Re: Linksys EA4500 / EA4200 support
June 29, 2017 07:06AM
Some slight hijacking but it is for a good cause. :)

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

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.



Edited 1 time(s). Last edit at 06/29/2017 07:09AM by bobafetthotmail.
Re: Linksys EA4500 / EA4200 support
June 29, 2017 10:40AM
gets router out
Give me what you've got :)

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.
Re: Linksys EA4500 / EA4200 support
June 29, 2017 02:08PM
megal0maniac Wrote:
-------------------------------------------------------
> gets router out
> Give me what you've got :)
>

Ok, thanks for volunteering. :)
this zip https://www.dropbox.com/s/l9ueyzuu1b2xdqz/linksys-viper.zip?dl=0
contains the factory image and the sysupgrade image, and a initramfs image.
The initramfs image is designed to run from RAM, you tftpboot it and then just bootm it without writing on flash.

It allows easy testing as it does not write on flash so you can just pull the plug and the device will be back to how it was. I would try with that first, if you have serial still connected.

I would need a boot log to show to the developer there, if you have a github account you can go and post it in that thread yourself, if not you can post it here and I'll just link the post to him.

Please test ethernet/switch and usb and also wifi if you want (see below).

> Pit
> y that the wireless radios seem to perform so poor
> ly (even with stock firmware) but that's an issue
> for another thread.

afaik LEDE tracks more or less closely the development branch of that driver and they saw some good improvement lately, Debian is not the best place to get a bleeding edge driver.

The image I provide is made with LEDE development sources so it's using the newest stuff available, you might want to check out wifi too.
Re: Linksys EA4500 / EA4200 support
June 29, 2017 03:35PM
bobafetthotmail,

Quote

> Some slight hijacking but it is for a good cause.
> :)


For a good cause, hijack all you want :)

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.

Quote

Debian 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?

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 3 time(s). Last edit at 06/29/2017 05:35PM by bodhi.
Re: Linksys EA4500 / EA4200 support
June 29, 2017 05:37PM
:)) I think I can reveal what tld stands for: Tony's Linux Distribution.

-----

Did the DSA switch work fully in this OpenWRT release? I could not tell from reading the thread.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 06/29/2017 06:58PM by bodhi.
Re: Linksys EA4500 / EA4200 support
June 30, 2017 04:08AM
bodhi Wrote:
-------------------------------------------------------
> I have scanned the thread, my impression is u-boot
> did not not get updated for this router, only the
> kernel DTS?


Yes, only kernel DTS is updated to allow using switchdev driver

> Did the DSA switch work fully in this OpenWRT release? I could not tell from reading the thread.

It is currently not using that driver as it would break existing configuration in devices already deployed.

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

I think that with DSA driver then the switch's VLAN functionality can be used, as all ports become separate netdevs.
Re: Linksys EA4500 / EA4200 support
June 30, 2017 04:34AM
> 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.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Linksys EA4500 / EA4200 support
June 30, 2017 08:26AM
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.
Re: Debian on Linksys EA4500 / EA4200
August 11, 2017 05:46PM
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
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Attachments:
open | download - kirkwood-ea4500.dtb (12.5 KB)
Author:

Your Email:


Subject:


Spam prevention:
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.
Message: