Welcome! Log In Create A New Profile

Advanced

UART Booting HowTo for Selected Kirkwood Devices

Posted by davygravy 
UART Booting HowTo for Selected Kirkwood Devices
May 06, 2012 02:49PM
This tutorial/howto describes how to boot certain Kirkwood machines via UART/serial connection. Though there are at least three different utilities that support this, the kwboot tool by Daniel Stodden is the focus here. kwboot is, in my opinion, perhaps the best of this genre of utility, and has been submitted to U-Boot mainline for inclusion in tools/. Using this patch (from early May 2012), it automatically compiles for the build-host if CONFIG_KIRKWOOD is declared.

A precompiled binary of kwboot (built on a 64-bit Ubuntu system) is attached, in a tarball w/ man page. The contents of the man page are listed below, also.

0. What is this and why do it? UART-booting provides a way to test a U-Boot uboot.kwb image before actually flashing to NAND. It also provides a non-JTAG method of unbricking any compatible device that has a working serial connection. It has been tested quite a bit, and it works well for me, but YMMV and there is no warranty, express or implied. Use at your own risk.

1. Compatible Kirkwood devices: Any Kirkwood SoC that has a BootROM version 1.21 (perhaps others?)
Known working (please post if you can confirm other working devices):
  • Seagate GoFlex Net/Home
  • Pogoplug V4/Mobile
  • Zyxel NSA320
  • RaidSonic ICYBox NAS6220/NAS6210

Non-working (post if you know of others, or if you find a workaround!):
  • Pogoplug V2/E02
  • Seagate Dockstar
  • SheevaPlug

How to determine if UART-booting works: It seems like the best marker is the BootROM version. So far, all machines with version 1.21 do support it, but none of the version 1.11 machines seem to work with it. From within U-Boot (either serial or netconsole, execute the md memory-display command at offset ff00003c:
md ff00003c
If you see
ff00003c: 00000111
it is v1.11, and if you see
ff00003c: 00000121
it has v 1.21.


2. Hardware setup: Test this first and make sure it is working normally.
  • a working serial connection to a compatible Kirkwood device
  • (optional) network/ethernet connection for the same Kirkwood device
Note: UART booting is not possible over netconsole.


3. kwboot binary and uboot.kwb:
  • download the kwboot-tool tarball and untar it somewhere convenient on your system
  • copy the uboot.kwb that you wish to boot the device with to the same kwboot-tool directory
  • cd to the directory, issue the command with the appropriate options/flags, depending on the uboot.kwb's filename and type [NAND or UART]

UART-boot uboot.kwb images work without any special fixing:
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.uartpogoMobile-MMC-mtdparts-NoUSB.kwb


If the uboot.kwb is a regular image built for flashing NAND, then append the -p flag and it will attempt to patch the header of the transmitted image, on-the-fly. The uboot.kwb file will not be altered.
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.goflexnet-IDEpatched-netconsoleON.kwb -p

Note that the documentation states that the baudrate flag is optional, with a default setting of 115200.




4. (Re)Start your Kirkwood device:
davygravy@bitbaker64:~/Desktop/kwboot-tool/$ ./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.goflexnet-IDEpatched-netconsoleONdefault.kwb  -p
Sending boot message. Please reboot the target.../
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
 ...
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]


U-Boot 2011.12 (Apr 27 2012 - 23:06:45)
Seagate GoFlexNet

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Using egiga0 device

==================================================

man page for kwboot

KWBOOT(1)                                                                                                            KWBOOT(1)

NAME
       kwboot - Boot Marvell Kirkwood SoCs over a serial link.

SYNOPSIS
       kwboot [-b image] [-p] [-t] [-B baudrate] [TTY]

DESCRIPTION
       The  kwboot program boots boards based on Marvell's Kirkwood platform over their integrated UART. Boot image files will
       typically contain a second stage boot loader, such as U-Boot. The image file must conform to Marvell's BootROM firmware
       image format (kwbimage), created using a tool such as .B mkimage.

       Following  power-up  or  a system reset, system BootROM code polls the UART for a brief period of time, sensing a hand‐
       shake message which initiates an image upload. This program sends this  boot  message  until  it  receives  a  positive
       acknowledgement. The image is transfered using Xmodem.

       Additionally,  this program implements a minimal terminal mode, which can be used either standalone, or entered immedi‐
       ately following boot image transfer completion. This is often useful to catch  early  boot  messages,  or  to  manually
       interrupt a default boot procedure performed by the second-stage loader.

OPTIONS
       -b image
              Handshake; then upload file image over TTY.

              Note  that  for the encapsulated boot code to be executed, image must be of type "UART boot" (0x69). Boot images
              of different types, such as backup images of vendor firmware downloaded from flash memory (type 0x8B), will  not
              work (or not as expected). See -p for a workaround.

              This mode writes handshake status and upload progress indication to stdout.

       -p     In combination with -b, patches the header in image prior to upload, to "UART boot" type.

              This  option  attempts on-the-fly conversion of some none-UART image types, such as images which were originally
              formatted to be stored in flash memory.

              Conversion is performed in memory. The contents of image will not be altered.

       -t     Run a terminal program, connecting standard input and output to TTY.

              If used in combination with -b, terminal mode is entered immediately following a successful image upload.

              If standard I/O streams connect to a console, this mode will terminate after receiving 'ctrl-\' followed by  'c'
              from console input.

       -B baudrate
              Adjust the baud rate on TTY. Default rate is 115200.

SEE ALSO
       mkimage(1)

AUTHORS
       Daniel Stodden <daniel.stodden@gmail.com>

                                                          2012-05-02                                                 KWBOOT(1)

References & Other:
http://www.solinno.co.uk/public/kwuartboot/
http://lists.debian.org/debian-arm/2011/10/msg00012.html
https://doukki.net/doku.php?id=wiki:tutoriels:u-boot.uart

=====================================================



Edited 5 time(s). Last edit at 05/06/2012 03:26PM by davygravy.
Attachments:
open | download - kwboot-tool.tar.gz (7.1 KB)
The UART boot works for NetGear OpenStora as well, ref this thread

Workaround for bootrom 1.11 is mentioned in a post in that thread and reproduced here, uncertain if this is universally applicable for other bootrom 1.11 devices, the post is reproduced here:

Tip: If you have an 88F6281 revision A0 CPU:

1. Power down the Stora.
2. Prepare picocom by hitting C+a C+e, then entering the u-boot uart filename BUT DON'T PRESS RETURN.
3. Press the Stora power button and count 1000, 2000, 3000.
4. Hit enter in picocom.
5. Success.

Works for me 99% of the time now. Suspect bootROM 1.21 waits to see if another bb11223344556677 comes around before declaring the uart boot process dead.

So it is possible, but it doesn't work in quite the same way as later CPUs.
Re: UART Booting HowTo for Selected Kirkwood Devices
May 07, 2012 05:18PM
openstoraU Wrote:
-------------------------------------------------------
> The UART boot works for NetGear OpenStora as well,
> ref
> http://www.openstora.com/phpBB3//viewtopic.ph
> p?t=1211]this thread
>
> Workaround for bootrom 1.11 is mentioned in a post
> in that thread and reproduced here, uncertain if
> this is universally applicable for other bootrom
> 1.11 devices, the post is reproduced here:
>
>
> Tip: If you have an 88F6281 revision A0 CPU:
> 
> 1. Power down the Stora.
> 2. Prepare picocom by hitting C+a C+e, then
> entering the u-boot uart filename BUT DON'T PRESS
> RETURN.
> 3. Press the Stora power button and count 1000,
> 2000, 3000.
> 4. Hit enter in picocom.
> 5. Success.
> 
> Works for me 99% of the time now. Suspect bootROM
> 1.21 waits to see if another bb11223344556677
> comes around before declaring the uart boot
> process dead.
> 
> So it is possible, but it doesn't work in quite
> the same way as later CPUs.
>


Something about this looks inconclusive/not-definitive... quoting the writer, the sentence just below/after what was posted above, makes the idea of UART-booting on the v1.11 BootROM machines look ... well... unsure and ... ???

Quote
justnine from www.openstora.com/phpBB3//viewtopic.php?t=1211
Works for me 99% of the time now. Suspect bootROM 1.21 waits to see if another bb11223344556677 comes around before declaring the uart boot process dead.

So it is possible, but it doesn't work in quite the same way as later CPUs.

edit: I have bootROM 1.11. And after a quick nand erase 0x0 0x2000, the device is back to refusing to boot.

That last sentence is a real show-stopper... First he says 1.21 BootROM, then 1.11. Which is it? In any case, this seems odd, since he said after that quick erase, it was refusing to boot. If this is what he meant, was it really working in the first place?

============================

I've tried this sequence repeatedly on a Pogoplug E02 and Dockstar and haven't been able to get it to work. If someone can show output for it and post a reproducible set of steps that works reliably on these machines, please post back. Thanks.

=====================================================



Edited 3 time(s). Last edit at 05/07/2012 05:56PM by davygravy.
Re: UART Booting HowTo for Selected Kirkwood Devices
June 15, 2012 11:20AM
This is nice!
I can use this to test my uBoot builds!

Only wish it worked for the Dockstar, and that Allwinner A10 had similar utility.
Maybe now that A10 is wildly popular Marvell will get off their butts and make a newer SoC like A10 that can use this utility.
But Marvell is going to be hurting badly after introduction of A10/A13. They probably lost a few contracts already. Why would anybody make a new plug/server/tablet/etc. using Marvell when A10/A13 is more powerful and likely way cheaper at $7/$5. Kirkwood and devices based on it are now already obsolete (though it will be fine for my servers for a good while!). So it would probably better for more tools to become available for A10. It is open source and was just released late last year, so only a matter of time for more A10 tools to be widely available. Hopefully new plugs and more boxes like this will come soon.

Thanks for the info davy!!
Re: UART Booting HowTo for Selected Kirkwood Devices
November 04, 2012 10:14AM
davygravy Wrote:
-------------------------------------------------------
>all machines with version 1.21 do support it, but none of the version 1.11

Is it possible to update Dockstar and other Plugs like Pogo to BootROM 1.21 and how?
Re: UART Booting HowTo for Selected Kirkwood Devices
November 05, 2012 04:29AM
sambul14 Wrote:

> Is it possible to update Dockstar and other Plugs
> like Pogo to BootROM 1.21 and how?

Nope, its not posible cause it is part of the hardware...
It`s work only over serial cable ?
I try this method over serial-to-usb adapter, and it stop after display in console "[Type Ctrl-\ + c to quit]".
I wait 1-2 min, but no another messages, no uboot prompt
I'll answer:)
In DNS-320 seems to tricky uartboot.

Tried with serial-to-low3.3v adapter on a real computer with Sabayon Linux x86 - works from time to time with some
magic. But when work, it work fast - load u-boot.kwb in 50-60 sec.

Tried with serial-to-low3.3v adapter on a VirtualBox with Sabayon Linux x86 - work always, without triks.
But slow, load u-boot.kwb in 7-10 min.

Tried with usb-to-low3.3v adapter on a VirtualBox with Sabayon Linux x86 - work always, without triks.
But after succes load , only see "[Type Ctrl-\ + c to quit]".

Many thanks to the author, I have updated u-boot without the risk of flash and get a brick
Greg Langford
Re: UART Booting HowTo for Selected Kirkwood Devices
August 19, 2013 03:48PM
I can confirm this works on the Synology DS213, I managed to brick mine and then bought her back from the dead. Remember be careful don't rely on this it is a very last resort.
Help im just stuck at "Sending boot message. Please reboot the target..."

How can i fix?
After this message you must turn on your device, if nothing - check which uboot used - uart or nand, if nand you should run kwboot with "-p" key.
Re: UART Booting HowTo for Selected Kirkwood Devices
October 15, 2013 03:30PM
Fma965 Wrote:
-------------------------------------------------------
> Help im just stuck at "Sending boot message.
> Please reboot the target..."
>
> How can i fix?

Which plug do you have? How did you run kwboot ? It is best if you can post the log of what you are doing so we can help!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Booting HowTo for Selected Kirkwood Devices
December 27, 2013 05:02PM
I've bricked my GoFlex Net, following the advices within this thread:

http://forum.doozan.com/read.php?3,6965

I successfully downloaded the new u-boot image to the GFN
via tftp, then tried:

b. Erase and flash; execute

nand erase 0x0 0x80000
nand write.e 0x800000 0x0 0x80000


The write command failed (AFAIR something like "offset error"
was reported, maybe since I interpreted "0x800000" as a typo
and omitted one zero). Yeah. But luckily found this thread, so
there is probably still hope for that box.

Started a Knoppix distro running from a smaller thumb drive
succesfully so far, I had to face the next obstacle: it's a 32-bit
(debian based) system, not capable of running the kwboot
binary provided above.

It would be very nice if somebody here will provide me a
32-bit version of kwboot or at least points me to any
clue how to download and compile that tool.

TIA

Olaf
Re: UART Booting HowTo for Selected Kirkwood Devices
January 03, 2014 02:40PM
A happy new year to you guys.

Unfortunately my problem with kwboot is still pending.

I wasn't aware that my AMD C-50 netbook is capable of running
64bit-Linux (sorry, I didn't deal with Linux for a longer period of
time). But, changing over to the 64bit flavour of Knoppix let
me fail again.

The kwboot binary I downloaded here responded with:

bash: /usr/local/sbin/kwboot: Cannot execute file. (or so, I translated
on my own from german output: "Kann die Datei nicht ausführen.")

on that system. It also happens when kwboot is run from the local dir
with "./" invocation.

I guess that the problem must have to do with this:

$ uname -s -r
Linux 3.9.6-64

$ file `which kwboot`
/usr/local/sbin/kwboot: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.15 [...]

Will somebody please be so kind and point me to a Linux distro that's suitable?
Formerly I was somewhat familiar with SuSE, but I couldn't find anything that
might be into "kernel-2.6" on suse.com.

(meanwhile I am prepared to install such distro on my netbook, it has a bigger
HDD now with plenty of space).

Thanks for your attention

Olaf
Re: UART Booting HowTo for Selected Kirkwood Devices
January 04, 2014 03:36AM
Besides the GoFlex Net, do you have another Kirwood plug? or any ARM 32 based Linux box?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Booting HowTo for Selected Kirkwood Devices
January 04, 2014 10:51AM
Hello Bodhi,

I have a Raspberry Pi laying around, but AFAIK it's ARM but no Kirkwood device.
And I'm thinking of getting an Arduino Yun, will that one probably help?

Am I really stuck with Linux on PC?

Olaf
Re: UART Booting HowTo for Selected Kirkwood Devices
January 04, 2014 11:23AM
Olaf,

Perfect! download this kwboot and run it from the Raspi:

kwboot
md5:
0efd011bdb244436e432a8de33e639a1

It's ARM.So it should work whether it's kirkwood or not.

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



Edited 1 time(s). Last edit at 01/04/2014 11:24AM by bodhi.
Re: UART Booting HowTo for Selected Kirkwood Devices
July 26, 2014 09:53PM
I'm getting the following. Anyone know what's going on? Thanks

[root@vader kwboot-tool]# kwboot -t /dev/ttyUSB0 -b uboot.bin
Sending boot message. Please reboot the target...|
Sending boot image...
  0 % [+++++++++++++++++xmodem: Bad message
Re: UART Booting HowTo for Selected Kirkwood Devices
July 27, 2014 03:26AM
grayman4hire,

On which box and what is the source for this u-boot.bin?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Booting HowTo for Selected Kirkwood Devices
July 27, 2014 08:30AM
I'm using a Pogoplug E02 to run the kwboot binary. I got the precompiled binary from davy's kwboot thread - http://forum.doozan.com/read.php?3,7852,7852

Serial is connected to my Pogoplug Mobile 4 which I'm experimenting with. The uboot.bin is from Pogoplug v4 Arch Linux ARM installation scripting (http://archlinuxarm.org/os/ppv4/ppv4-install.sh),specifically this bin - http://archlinuxarm.org/os/ppv4/uboot.bin.gz. Should I try a different uboot file?

Thanks for the help.
Re: UART Booting HowTo for Selected Kirkwood Devices
July 27, 2014 02:49PM
grayman4hire,

You should try my latest u-boot Pogo V4 build.
./kwboot-tool/kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2014.07-tld-1.pogo_v4.mtd0.kwb -p

And here is how you boot the Pogo Mobile (it is different from other Kirkwood boxes, a little bit flaky):

- Start kwboot on a different Linux box using the above command.
- Power up the Pogo V4/Mobile.
- Within 1-2 seconds when the spinning | starts slowing down (but not too soon), Control-C to abort kwboot, and recall the command, execute kwboot again.
- Repeatedly run kwboot this way for a few times, it will handshake successfully eventually.

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



Edited 2 time(s). Last edit at 07/27/2014 03:03PM by bodhi.
Re: UART Booting HowTo for Selected Kirkwood Devices
December 28, 2014 07:03PM
Hello

Zyxel NSA-320S

Marvell>> md ff00003c
ff00003c: 00000000 00000000 00000000 00000000 ................
ff00004c: 00000000 00000000 00000000 00000000 ................
ff00005c: 00000000 00000000 00000000 00000000 ................
ff00006c: 00000000 00000000 00000000 00000000 ................
ff00007c: 00000000 00000000 00000000 00000000 ................
ff00008c: 00000000 00000000 00000000 00000000 ................
ff00009c: 00000000 00000000 00000000 00000000 ................
ff0000ac: 00000000 00000000 00000000 00000000 ................
ff0000bc: 00000000 00000000 00000000 00000000 ................
ff0000cc: 00000000 00000000 00000000 00000000 ................
ff0000dc: 00000000 00000000 00000000 00000000 ................
ff0000ec: 00000000 00000000 00000000 00000000 ................
ff0000fc: 00000000 00000000 00000000 00000000 ................
ff00010c: 00000000 00000000 00000000 00000000 ................
ff00011c: 00000000 00000000 00000000 00000000 ................
ff00012c: 00000000 00000000 00000000 00000000 ................

Marvell>> version

U-Boot 1.1.4 (Sep 3 2013 - 16:27:22) Marvell version: 3.6.0

Not sure if it works i dont know how to test
Attachments:
open | download - bootlog.txt (2.7 KB)
Re: UART Booting HowTo for Selected Kirkwood Devices
January 06, 2015 09:45AM
Hello,

ZyXEL NSA-325v2 - works

1. turn off
2. prepare command
3. turn on and count slowly 1,2,3 (did not work without this)
4. run the command

# kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2013.10-tld-1.nsa325.uart.kwb -p
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  2 % [......................................................................]
  5 % [......................................................................]
  8 % [......................................................................]
 11 % [......................................................................]
 14 % [......................................................................]
 17 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 25 % [......................................................................]
 28 % [......................................................................]
 31 % [......................................................................]
 34 % [......................................................................]
 37 % [......................................................................]
 40 % [......................................................................]
 43 % [......................................................................]
 45 % [......................................................................]
 48 % [......................................................................]
 51 % [......................................................................]
 54 % [......................................................................]
 57 % [......................................................................]
 60 % [......................................................................]
 63 % [......................................................................]
 65 % [......................................................................]
 68 % [......................................................................]
 71 % [......................................................................]
 74 % [......................................................................]
 77 % [......................................................................]
 80 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 88 % [......................................................................]
 91 % [......................................................................]
 94 % [......................................................................]
 97 % [................................................................]
[Type Ctrl-\ + c to quit]


U-Boot 2013.10-tld-1 (Aug 29 2014 - 22:07:26)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_??
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Warning: failed to set MAC address

MV88E1318 PHY initialized on egiga0
NSA325>
Re: UART Booting HowTo for Selected Kirkwood Devices
February 17, 2015 08:33AM
I got this result

the file uboot.2014.07-tld-2.sheevaplug.mtd0.kwb is only a test

[ovp@hp7 kwboot-tool]$ ./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2014.07-tld-2.sheevaplug.mtd0.kwb -p
Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 25 % [......................................................................]
 27 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]                                                                                                                 
 61 % [......................................................................]                                                                                                                 
 63 % [......................................................................]                                                                                                                 
 64 % [......................................................................]                                                                                                                 
 66 % [......................................................................]                                                                                                                 
 68 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]


U-Boot 2014.07-tld-2 (Dec 20 2014 - 20:20:31)
Marvell-Sheevaplug

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0 
Marvell>> printenv
arcNumber=2097
baudrate=115200
bootcmd=run bootcmd_uenv; run bootcmd_usb; reset
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
ethaddr=b6:d0:5e:0f:a1:17
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
rootdelay=10
rootfstype=ext2
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
stderr=serial
stdin=serial
stdout=serial
uenv_import=echo importing envs ...; env import -t 0x810000
uenv_load=usb start; ide reset; setenv uenv_loaded 0; for devtype in usb ide; do for disknum in 0; do run uenv_read_disk; done; done
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if $devtype part $disknum; then run uenv_read; fi
usb_boot=mw 0x800000 0 1; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=/dev/sda1

Environment size: 1372/131068 bytes
Marvell>> help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootz   - boot Linux zImage image from memory
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fdt     - flattened device tree utility commands
fsinfo  - print information about jffs filesystems
fsload  - load binary file from a jffs filesystem image
fsls    - list jffs files in a directory (default /)
go      - start application at address 'addr'
gpio    - query and control gpio pins
help    - print command description/usage
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mtdparts- define flash/nand partitions
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
Marvell>>

we can assume that the function works with Asus-NAS-M25 ?
Re: UART Booting HowTo for Selected Kirkwood Devices
February 17, 2015 12:12PM
balbes150,

It means that:

- The Asus-NAS-M25 has UART booting capability, good news :) Now you can experimenting with flashing newer u-boot, knowing there is a rescue mechanism.
- The Sheevaplug is the reference board, so it works with the ASUS.
- To build newer u-boot for the ASUS, the Sheevaplug's u-boot can be used as a base. But changes might be needed to make it work correctly (this is likely).

Yes, I think you should let it boot into a test rootfs (I would avoid using a real rootfs, just in case). And verify that all the functionalities works (usb, ethernet, sata,... whatever you can think of that make the ASUS different from the Sheevaplug). I would also try to verify the specs on paper to see if you can spot any significant difference (RAM, NAND capacity, network chip, rtc, ....).

Once you are satisified that it works fine basically, you can flash the sheevaplug u-boot to NAND.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Booting HowTo for Selected Kirkwood Devices
February 25, 2015 11:51AM
Hi!

I've tried UART boot via kwboot on Lenovo/Iomega ix2-dl - but without success. :/

The initial handshake dosen't happened at all: I try to power on ix2-dl while kwboot
is running and wating; power on, wait 1-2-3 and run kwboot after that.
I also try the "run - hit ^C - run - hit ^C..." trick - also with no luck.

Some people reports, that kwboot can fail due to bad serial connection.
Maybe I'm wrong, but I think my connection works well - I use MAX3232 level
convertor, powered from Iomega 3v3 power source at the TTL side and connected
to a standard DB9F connector at the RS232 side. I can see stock uBoot output
and issue commands at 115200 without any problem. So I think, there is some
other problem - not from the connection physics itself.
Also I use a true hardware serial port ttyS0 (Intel DG45FC mb have one connector).

I add some hexdump calls to kwboot sources to check, what really sent and
received via ttyS. I can see BB,11....77 message, sended by kwboot in a loop,
but cant catch any NAK from device. All received chars via serial are the same
boot text, that I can see in terminal at normal boot.

So either ix2-dl ignore UART boot procedures or something goes wrong.

I've read p.24.2.5.3 in "Marvell's 88F6281 Functional Specifications"
datasheet about how BootProm do UART sensing. Only MPP[4] and
MPP[11] pins checked during startup. AFAIK, MPP pins can map
rather freely. So maybe Iomega engineers map UART signals to a
completely different MPP pins? Maybe this is the reason of another
issue, I've stuck with:
No serial output from kernel on Iomega ix2-dl

Ix2-dl was built with Marvell Armada 300 (88F6282) SoC, it has different package
and I have no documentation of it - neither detailed HW specs, nor functional specs.
And tiny BGA package are also impossible to track :(

Have anyone any clues or suggestions?
Maybe someone have Marvell Docs for 88F6282?
Maybe disassembly of stock uBoot can help?

Thanks.
Re: UART Booting HowTo for Selected Kirkwood Devices
February 25, 2015 12:13PM
megov,

> So either ix2-dl ignore UART boot procedures or
> something goes wrong.

Did you check the bootROM version? it is not a reliable indicator if it is absent (it might or might not work), but it is quite reliable if you get the correct bootROM version (most likely will work).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Booting HowTo for Selected Kirkwood Devices
February 25, 2015 12:41PM
Hi!
Yes, I tried, but no version at 0xFF00003C:

Marvell>> md ff000000
ff000000: 00000000 00000000 00000000 00000000 ................
ff000010: 00000000 00000000 00000000 00000000 ................
ff000020: 00000000 00000000 00000000 00000000 ................
ff000030: 00000000 00000000 00000000 00000000 ................
ff000040: 00000000 00000000 00000000 00000000 ................
ff000050: 00000000 00000000 00000000 00000000 ................
ff000060: 00000000 00000000 00000000 00000000 ................
ff000070: 00000000 00000000 00000000 00000000 ................
ff000080: 00000000 00000000 00000000 00000000 ................
ff000090: 00000000 00000000 00000000 00000000 ................
ff0000a0: 00000000 00000000 00000000 00000000 ................
ff0000b0: 00000000 00000000 00000000 00000000 ................
ff0000c0: 00000000 00000000 00000000 00000000 ................
ff0000d0: 00000000 00000000 00000000 00000000 ................
ff0000e0: 00000000 00000000 00000000 00000000 ................
ff0000f0: 00000000 00000000 00000000 00000000 ................

The whole block is zeroed. As I can see in the docs on 6281, bootprom code
starts at 0xFFF00000. My device have also zeroes here:
Marvell>> md 0xfff00000
fff00000: 00000000 00000000 00000000 00000000 ................
fff00010: 00000000 00000000 00000000 00000000 ................
fff00020: 00000000 00000000 00000000 00000000 ................
fff00030: 00000000 00000000 00000000 00000000 ................

So I think, memory map on ix2-dl differs from other kirkwood devices.
Tough uBoot code, loaded into ram at 0x600000 are the
same as I can see in mtd0 after the 0x200 header:
Marvell>> md 0x600000
00600000: ea000012 e59ff014 e59ff014 e59ff014 ................
00600010: e59ff014 e59ff014 e59ff014 e59ff014 ................
00600020: 006001a0 00600200 00600260 006002c0 ..`...`.`.`...`.
00600030: 00600320 00600380 006003e0 deadbeef .`...`...`.....
00600040: 00600000 00600000 0067fff0 006cfb00 ..`...`...g...l.
00600050: e10f0000 e3c0001f e38000d3 e129f000 ..............).

So I dont find bootrom in address space yet, and dont know its
version either.
Re: UART Booting HowTo for Selected Kirkwood Devices
February 25, 2015 12:52PM
megov,

boot ROM is not a reliable indicator if it's not at 0xFF00003C. The NSA325 has UART booting, but no bootROM version found at 0xFF00003C.

Did the box reply with anything at all when you power up while kwboot running? or did it ignore the handshake and start stock u-boot right away?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: UART Booting HowTo for Selected Kirkwood Devices
February 25, 2015 12:59PM
I think, it is ignore the handshake. The original kwboot stuck in a loop,
waiting for NAK (as I can suppose from code). I add some debug
hexdump to stderr code into kwboot_tty_recv and can see the same
stock uBoot startup log. Nothing different from a normal boot.
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: