Welcome! Log In Create A New Profile

Advanced

Debian on Action Tech SG200 and MI424WR-rev-I

Posted by veriqster 
Re: Debian on Action Tech SG200
January 16, 2021 04:50PM
I have not had a chance to do more research (i.e. read the GPL source).

MI424WR-rev-I uses the internal Marvell switch, so I attempted to activate this DSA switch in the current DTS.

But looks like it does not work.

Neither Ethernet ports were initialized.

[   11.829233][  T163] mvneta f1074000.ethernet: incorrect phy-mode
[   11.835337][  T163] mvneta: probe of f1074000.ethernet failed with error -22
[   11.917297][  T163] mvneta f1070000.ethernet: incorrect phy-mode
[   11.946078][  T163] mvneta: probe of f1070000.ethernet failed with error -22

So back to my doubt about why mvneta driver was used in this DTS by Claudio. Usually this driver is used for the Armada SoCs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/16/2021 04:50PM by bodhi.
bkallus
Re: Debian on Action Tech SG200
January 20, 2021 01:24PM
I don't know how much help it is, but I just tested booting up PandoraBox (which uses the device tree sources I sent you) and ethernet works fine. I'm assuming that means there must be something to Claudio's decision to use the mvneta driver. Reboot also works in PandoraBox.

Also, I used your modifications to the device tree sources to build OpenWrt, and it compiled and booted perfectly. Again, the only issues are ethernet and reboot. I don't get any crypto errors in OpenWrt, but I'm sure that's what you'd expect.

Anyway, thanks so much for working on this. I've had a blast playing with this router!
Re: Debian on Action Tech SG200
January 20, 2021 03:47PM
bkallus,

> Also, I used your modifications to the device tree
> sources to build OpenWrt, and it compiled and
> booted perfectly. Again, the only issues are
> ethernet and reboot. I don't get any crypto errors
> in OpenWrt, but I'm sure that's what you'd
> expect.

Cool!

I've ordered a used box from eBay. Hopefully it will help me seeing clearly what going on. Also with info from the GPL I think we'll can find out what the PHY mode error was about (it looks familiar, but I've forgotten all about the DSA switch working session for the Linksys EA4500 from long ago :).

For now please get these info from u-boot console:

help
mii dev
mii info

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
bkallus
Re: Debian on Action Tech SG200
January 20, 2021 04:38PM
Re: Debian on Action Tech SG200
January 20, 2021 07:04PM
bkallus,

help mii dev
help mii info
help mii_dump

and
mii_dump

And since the log is short, please post it here (no need for pastebin).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 01/20/2021 07:05PM by bodhi.
bkallus
Re: Debian on Action Tech SG200
January 20, 2021 07:38PM
Marvell>> help mii dev
mii_dump - Dump mii registers

Usage:
mii_dump
Unknown command 'dev' - try 'help' without arguments for list of all known commands

Marvell>> help mii info
mii_dump - Dump mii registers

Usage:
mii_dump
Unknown command 'info' - try 'help' without arguments for list of all known commands

Marvell>> help mii_dump
mii_dump - Dump mii registers

Usage:
mii_dump
Marvell>> mii_dump
[ 0: 0: 0] = 1140
[ 0: 0: 1] = 7949
[ 0: 0: 2] = 141
[ 0: 0: 3] = ea1
[ 0: 0: 4] = 5e1
[ 0: 0: 5] = 0
[ 0: 0: 6] = 4
[ 0: 0: 7] = 2001
[ 0: 0: 8] = 0
[ 0: 0: 9] = f00
[ 0: 0: a] = 4000
[ 0: 0: b] = 0
[ 0: 0: c] = 0
[ 0: 0: d] = 3
[ 0: 0: e] = 0
[ 0: 0: f] = 3000
[ 0: 0:10] = 3360
[ 0: 0:11] = 8010
[ 0: 0:12] = 0
[ 0: 0:13] = 40
[ 0: 0:14] = 20
[ 0: 0:15] = 0
[ 0: 0:16] = 0
[ 0: 0:17] = 0
[ 0: 0:18] = 0
[ 0: 0:19] = 0
[ 0: 0:1a] = 40
[ 0: 0:1b] = 0
[ 0: 0:1c] = 0
[ 0: 0:1d] = 0
[ 0: 0:1e] = 0
[ 0: 0:1f] = 0
Marvell>>
Not too helpful, sorry.
Re: Debian on Action Tech SG200
January 21, 2021 10:21PM
bkallus,

Could you describe briefly how the box should be opened.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
bkallus
Re: Debian on Action Tech SG200
January 22, 2021 11:09AM
I don't have all the parts with me, but I'll try my best to remember:

The red part on the front with the LEDs and WPS button had to come off first. I'm pretty sure I just took out every screw I could see, then wedged a guitar pick around the red piece until it came off. That revealed a few more screws that I had to take out as well. After that, the two halves of the case separated easily with a guitar pick.
Re: Debian on Action Tech SG200
January 22, 2021 03:20PM
> The red part on the front with the LEDs and WPS
> button had to come off first. I'm pretty sure I
> just took out every screw I could see, then wedged
> a guitar pick around the red piece until it came
> off. That revealed a few more screws that I had to
> take out as well. After that, the two halves of
> the case separated easily with a guitar pick.

Thanks! my box will arrive soon in a few days.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200
January 24, 2021 06:10PM
bkallus,

Could you also post the serial header pinouts. Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
bkallus
Re: Debian on Action Tech SG200 and MI424WR-rev-I
January 24, 2021 09:13PM
Here's the one the PandoraBox people posted. I don't know what the other three pins are, but I guess it doesn't really matter. It's at 115200 baud.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
January 25, 2021 04:25PM
bkallus Wrote:
-------------------------------------------------------
> Here's the one the
> PandoraBox people posted.
I don't know what
> the other three pins are, but I guess it doesn't
> really matter. It's at 115200 baud.

Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 05, 2021 07:04PM
Ok so I got my MI424WR-rev-I (Verizon router) from eBay. Will write some posts to restate the info bkallus has posted above about serial consolse and box opening.

I also looked inside the OpenRG system. Spawn a shell to browse the Linux root file system. And found the stock u-boot binary

Wireless Broadband Router> system shell

-rw-rw-rw-    1 0        0          531.0k Jun 27  2014 /mnt/cramfs//etc/uboot-revI-128MbFlash.bin

Perhaps one of us should copy this u-boot image and post here.

======

The busybox in this rootfs is quite lacking. There is no dmesg, fdisk, lsusb, lspci, reboot, shutdown. So I can't see how to mount a USB drive yet to copy this u-boot. I might have to set it up to connect to the network through the user Web innterface, to copy my Debian Squeeze busybox in.

To do a lot of testing, we need to be able to reboot the box at will. Do Debian shutdown and flip the power rocker button is not feasible if we are not sitting in front of the box, i.e. most of the time I am not.

Right now, I am looking for the Restart drivers in this stock OS. Which Restart driver is being used here (i.e. why standard Kirkwood restart did not work).

GPL source for this box: patches are clearly delineated, but no documentation or no comment about which GPIO is for what purpose.

======


Edited to remove Poweroff issue. It is working OK to shutdown with poweroff or shutdown -h now.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 02/05/2021 11:33PM by bodhi.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 05, 2021 11:49PM
The Restart issue was that the system-controller was missing in the DTSI.

I'll upload another DTB version here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 06, 2021 12:09AM
Attached is the new DTB and DTS files for the MI424WR-I.

Reboot is working in this version. Crypto is still not working but will be quiet in the kernel log.

Please try testing reboot with :

shutdown -r now

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - avanta-mi424wr-dts.tar (30 KB)
bkallus
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 07, 2021 05:51PM
Looks good! Excited to test this out. Also, I looked through the web interface and found this update link. It has the stock U-Boot buried inside it, accessible with binwalk.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 07, 2021 10:31PM
bkallus,

> It has the stock U-Boot buried
> inside it, accessible with binwalk.

Thanks! can you extract it and post it here?

You can also test kwboot with that to see if it can be loaded over UART.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 08, 2021 08:42AM
Me too! I'm prepped and ready, but had to leave the house for work.

Dave
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 08, 2021 05:44PM
Is it significant that I see these messages?

[ 12.016908] mvneta f1074000.ethernet: can't power up port
[ 12.068583] mvneta: probe of f1074000.ethernet failed with error -22

The kernel module loads, and reports a mac address just after these.

Dave
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 08, 2021 05:58PM
Dave,

Yes it is. Ethernet is not working yet.

The old DTS binding from Claudio needs a lot of adjustment in the new kernel. So I've been updating the DTS.

Also, the old Marvell Ethernet Switch driver used in Claudio's DTS has been removed from the kernel for quite a long time. I'm also upgrading to use the Marvell DSA switch architecture, and ran into problem with interrupts conflicts. I suspect that I might need to write a lot more nodes in the DTS so that the kernel can handle the interrupts assigning properly.

Let me upload my most recent DTS and DTB here shortly.

In the mean time, if anybody can get the stock u-boot image (available in stock /etc) or from somewhere, try to boot with UART. Example:

https://forum.doozan.com/read.php?3,51739,51919#msg-51919

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 08, 2021 06:07PM
Here is the new DTB tarball (with source DTS files). Extract and copy the avanta-mi424wr.dtb to the USB rootfs /boot/dts/.

And then recreate the uImage using this new DTB.

I've cleaned up quite a bit more, and commented out the crypto nodes to make the boot log less noisy(we don't care much about crypto right now).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Attachments:
open | download - avanta-mi424wr-dts.tar (30 KB)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 10, 2021 07:57PM
Attached is the stock U-Boot.
Attachments:
open | download - uboot-revI-128MbFlash.bin (531 KB)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 10, 2021 09:23PM
Also ,which file should I try to send over with kwboot, exactly? I don't have any kwb files to test it out with.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 10, 2021 10:22PM
bkallus,

Use the image uboot-revI-128MbFlash.bin you've attached.

In the old days it is simply named with .bin. But it is actually a flash-ready image. Later inmainline, the naming convention changed to .kwb to make it clearer that it is not just a .bin (which has no header).

So try running kwboot with option -p.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 11, 2021 05:17AM
Looks like kwboot is working.

Of course it is the same u-boot! but we can guess that it is the u-boot image from UART by the absence of BootROM version logging in normal boot.

kwboot -t -B 115200 /dev/ttyUSB0 -b uboot-revI-128MbFlash.bin  -p

Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]

 97 % [......................................................................]
 98 % [.................................................]
[Type Ctrl-\ + c to quit]

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_ 
        | | | |___|  _ \ / _ \ / _ \| __| 
        | |_| |___| |_) | (_) | (_) | |_ 
         \___/    |____/ \___/ \___/ \__| 
 ** LOADER **


U-Boot 2009.08 (May 22 2014 - 18:26:38) Marvell version: 2.1.6_NQ

Board: MI424WR-I
SoC:   88F6560 A0
CPU:   Marvell Feroceon (Rev 1) - LE
       CPU @ 1200Mhz, L2 @ 480Mhz
       DDR3 @ 400Mhz, TClock @ 200Mhz
PEX 0: Root Complex Interface, Detected Link X1
PEX 1: Detected No Link.
DRAM:  128 MB
       CS 0: base 0x00000000 size 128 MB
       Addresses 10M - 0M are saved for the U-Boot usage.
NAND:  1bit HM ECC, Size: 128 MiB
USB 0: Host Mode
Shutting down unused interfaces:
       PON
       SATA
       3xFE-PHY
Modules Detected:
       No PON module.
       RGMIIA Module on Switch port #6.
       RGMIIB Module on MAC0.
       Ethernet Switch on MAC1.
       QSGMII Module.
Initialized 1545 PHY
Net:   egiga0, egiga1 [PRIME]
Hit any key to stop autoboot:  0

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 11, 2021 05:51AM
Wifi is working!

Add your network credential (example: myssid/mypassword) to /etc/network/interfaces.

I assigned the static IP for this box as 192.168.0.240 to make it easier to find (DHCP works fine too). 192.168.0.1 is the IP address of my router.

root@mi424:~# tail /etc/network/interfaces
#iface wlp1s0 inet dhcp 
iface wlp1s0 inet static
        address 192.168.0.240
        netmask 255.255.255.0
        gateway 192.168.0.1
wpa-ssid "myssid" 
wpa-psk "mypassword"

And make sure you set the permission to /etc/network/interfaces so only root can read it:

chmod 600  /etc/network/interfaces


root@mi424:~# dmesg | grep -i ath
[   30.190765] ath9k 0000:01:00.0: assign IRQ: got 30
[   30.300593] ath: EEPROM regdomain sanitized
[   30.300608] ath: EEPROM regdomain: 0x64
[   30.300615] ath: EEPROM indicates we should expect a direct regpair map
[   30.300630] ath: Country alpha2 being used: 00
[   30.300637] ath: Regpair used: 0x64
[   30.312116] ieee80211 phy0: Atheros AR9287 Rev:2 mem=0x888a0000, irq=30
[   30.377652] ath9k 0000:01:00.0 wlp1s0: renamed from wlan0

root@mi424:~# dmesg | grep -i wlp
[   30.377652] ath9k 0000:01:00.0 wlp1s0: renamed from wlan0
[   43.047363] wlp1s0: authenticate with xxxxxxxxxxx
[   43.071543] wlp1s0: send auth to xxxxxxxxxxx  (try 1/3)
[   43.082278] wlp1s0: authenticated
[   43.090054] wlp1s0: associate with xxxxxxxxxxx (try 1/3)
[   43.104023] wlp1s0: RX AssocResp from xxxxxxxxxxx  (capab=0x31 status=0 aid=3)
[   43.113245] wlp1s0: associated
[   43.148210] wlp1s0: Limiting TX power to 27 (27 - 0) dBm as advertised by xxxxxxxxxxx
(xxxxxxxxxxx is the MAC address of my router).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 02/11/2021 04:22PM by bodhi.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 13, 2021 10:42AM
I'm trying to UART boot mine, and it's telling me this:

./kwboot -t -B 115200 /dev/ttyACM0 -b uboot-revI-128MbFlash.bin -p
uboot-revI-128MbFlash.bin: Invalid image.

Did you use the image I uploaded? I've been using a precompiled kwboot from the other thread; do you think it would make a difference if I compile my own?

EDIT:
I cloned the u-boot repository and ran
make defconfig
make tools-all
to build a new kwboot binary.

With the new binary, I get this error instead:
Sending boot message. Please reboot the target...|
Sending boot image...
  0 % [+++++++++++++++++xmodem: Bad message



Edited 1 time(s). Last edit at 02/13/2021 11:21AM by bkallus.
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 13, 2021 03:32PM
bkallus,

> Did you use the image I uploaded?

Yes, I did post above:
kwboot -t -B 115200 /dev/ttyUSB0 -b uboot-revI-128MbFlash.bin  -p

> I've been using
> a precompiled kwboot from the other thread

Use the one in your host LInux distro should be fine.

> do you
> think it would make a difference if I compile my
> own?

Don't bother. This box BootROM is quite old, so any kwboot will work.

When you see this error:

0 % [+++++++++++++++++xmodem: Bad message

Just recall the kwboot command and execute it right away, repleat this as many time as you could until it handshakes.

Also, as one of our forum member found out, the serial wires should be placed away from the power plug. Oftently, the wires we used are not shielded, so it could be interference.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 13, 2021 04:38PM
I'll have to rebuild this stock u-boot at some point.

It's very annoying that the bootdelay in this u-boot is always reset to 1 internally, even though I've set it to 10 in the envs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Action Tech SG200 and MI424WR-rev-I
February 13, 2021 08:34PM
Bodhi,

Does it also automagically set the bootcmd? I find it extremely annoying when vendors try to lock down u-boot by setting very short bootdelay and forcing a particular bootcmd.

Ray
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: