Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3247

u-boot via uart on mvebu (4 replies)

$
0
0
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?

Viewing all articles
Browse latest Browse all 3247

Trending Articles