Welcome! Log In Create A New Profile

Advanced

u-boot via uart on mvebu

Posted by hmartin 
u-boot via uart on mvebu
June 02, 2017 03:45PM
Does anyone know the logistics to boot an mvebu device via uart?

In the GPL source code from Western Digital for the EX2100, building u-boot generates the following files:
u-boot-a38x-Yosemite_2014T3_PQ-nand.bin
u-boot-a38x-Yosemite_2014T3_PQ-nand-uart.bin

However, trying to boot the u-boot-a38x-Yosemite_2014T3_PQ-nand-uart.bin using kwboot doesn't work, the boot process is never interrupted and the image is not uploaded.

I also tried to build u-boot v2017.05 and boot via kwboot, but each time it fails:
./kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb 
Sending boot message. Please reboot the target.../
Sending boot image...
  0 % [+++++++++++++++++xmodem: Bad message

I am guessing this is because kwboot is only for Kirkwood, and mvebu is incompatible.

There is a command "doimage" included in the u-boot tools/marvell directory in the WD GPL archive which creates the -uart.bin file. This utility does not exist in mainline u-boot. Here is the utility usage:
==============================================================================================

Marvell doimage Tool version 2.10
Supported SoC devices: 
	Marvell Armada and xCAT series
==============================================================================================

Usage: 
doimage <mandatory_opt> [other_options] [bootrom_output] <image_in> <image_out> [header_out]

<mandatory_opt> - can be one or more of the following:
==============================================================================================

-T image_type:   sata\uart\flash\bootrom\nand\hex\bin\pex\mmc
-D image_dest:   image destination in dram (in hex)
-E image_exec:   execution address in dram (in hex)
                 if image_type is 'flash' and image_dest is 0xffffffff
                 then execution address on the flash
-S image_source: if image_type is sata then the starting sector of
                 the source image on the disk
                 if image_type is flash\nand then the starting offset of
                 the source image at the flash - optional for flash\nand
-W hex_width :   HEX file width, can be 8,16,32,64 
-M twsi_file:    ascii file name that contains the I2C init regs set by h/w.
                 this is used in i2c boot only

The following options are mandatory for NAND image type:
-----------------------------------------------------------------------------------------------

-L nand_blk_size:NAND block size in KBytes (decimal int in range 64-16320)
                 This parameter is ignored for flashes with  512B pages
                 Such small page flashes always use 16K block sizes
-N nand_cell_typ:NAND cell technology type (char: M for MLC, S for SLC)
-P nand_pg_size: NAND page size: (decimal 512, 2048, 4096 or 8192)

Secure boot mode options - all options are mandatory once secure mode is selected by Z switch:
-----------------------------------------------------------------------------------------------

-Z [prv_key_file]: Create image with RSA signature for secure boot mode
                   If the private key file name is missing, a new key pair will be generated
                   and saved in files named rsa_prv.key and rsa_pub.key
                   A new file named sha2_pub.txt will be generated for a public key
-J jtag_delay:   Enable JTAG and delay boot execution by "N" ms
-B hex_box_id:   Box ID (hex) - from 0 to 0xffffffff
-F hex_flash_id: Flash ID (hex) - from 0 to 0xffff 


[other_options] - optional and can be one or more of the following:
==============================================================================================

-A [aes_key_file]: Valid in secure mode only. Encrypt the boot image using AES-128 key
                   If the aes key file name is missing, a new AES-128 key will be generated
                   and saved in file named aes_key.txt suitable for eFuse storage
-G exec_file:    ascii file name that contains binary routine (ARM 5TE THUMB)
                 to run before the bootloader image execution.
                 The routine must contain an appropriate code for saving 
                 all registers at the routine start and restore them 
                 before return from the routine 
-R dram_file:    ascii file name that contains the list of dram regs
-C hdrs_file:    ascii file name that defines BIN/REG headers order and their sources
-X pre_padding_size (hex)
-Y post_padding_size (hex)
-H header_mode: Header mode, can be:
                -H 1 : will create one file (image_out) for header and image
                -H 2 : will create two files, (image_out) for image , (header_out) for header
                -H 3 : will create one file (image_out) for header only 
                -H 4 : will create one file (image_out) for image only 

[bootrom_output] - optional and can be one or more of the following:
==============================================================================================

-p               Disable BootROM messages output to UART port (enabled by default)
-b baudrate      Set BootROM debug port UART baudrate 
                 value = 2400,4800,9600,19200,38400,57600,115200 (use default baudrate is omitted)
-u port_num      Set BootROM debug port UART number value = 0-3 (use default port if omitted)
-m mpp_config    Select BootROM debug port MPPs configuration value = 0-7 (BootROM-specific)

Command examples: 

doimage -T hex -W width image_in image_out
doimage -T bootrom image_in image_out
doimage -T resume image_in image_out
doimage -T sata -S sector -D image_dest -E image_exec
         [other_options] image_in image_out header_out

doimage -T flash -D image_dest -E image_exec [-S address]
         [other_options] image_in image_out

doimage -T pex -D image_dest -E image_exec 
         [other_options] image_in image_out

doimage -T nand -D image_dest -E image_exec [-S address] -P page_size
         -L 2 -N S [other_options] image_in image_out

doimage -T uart -D image_dest -E image_exec
         [other_options] image_in image_out

doimage -T pex -D image_dest -E image_exec 
         [other_options] image_in image_out

Edit: it seems there was a patch in 2015 to add mvebu support to kwboot:
https://lists.denx.de/pipermail/u-boot/2015-August/225219.html

So any ideas why kwboot is not working?



Edited 1 time(s). Last edit at 06/02/2017 03:49PM by hmartin.
Re: u-boot via uart on mvebu
June 02, 2017 04:09PM
hmartin,

This has been thoroughly discussed and tried in the NAS326 thread:
http://forum.doozan.com/read.php?2,27108

Not possible, atm.

-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/02/2017 04:10PM by bodhi.
Re: u-boot via uart on mvebu
June 02, 2017 04:13PM
However,

The WD Mycloud EXx100 might be different from the Xyzel. So try:

./kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb -p

-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: u-boot via uart on mvebu
June 02, 2017 04:16PM
I'd suggest this thread be done under the same Debian thread we already have for WD EX4100 (booting UART is part of the specific box idiosyncracy, not u-boot or SoC).

-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: u-boot via uart on mvebu
June 02, 2017 04:31PM
Quote
bodhi
The WD Mycloud EXx100 might be different from the Xyzel. So try:
> ./kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb -p

I already tried. It doesn't work.

I will continue the discussion in the Debian thread!
Re: u-boot via uart on mvebu
July 04, 2017 04:53AM
@bodhi: Did you have any luck trying to kwboot NAS326 using the modified kwboot?

Wondering if/when there is any progress on newer u-boot for mvebu.



Edited 1 time(s). Last edit at 07/04/2017 04:55AM by hmartin.
Re: u-boot via uart on mvebu
July 04, 2017 05:36AM
hmartin,

I'm starting to get to play with the NAS326 UART booting with new kwboot now that we are basically done with WD EX4100.

-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: u-boot via uart on mvebu
July 05, 2017 03:26PM
hmartin,

> @bodhi: Did you have any luck trying to kwboot NAS
> 326

No luck :) even with the fallback patch, my NAS326 does not respond to the kwboot handshake correctly. It just fell through and started stock u-boot. The Armada XP timing parameter is not right for this box.

And now that I looked at that fallback patch closely, I don't think it applies to the NAS326. The fallback apparently did the trick for the WD EXT4100/2100. But NAS326 has a slightly different setting on power on.

I think when I have time, I will just start building new u-boot for it. And hope by the time I'm done, there will be a solution to UART booting for NAS326 :)

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