Home Forums Getting Started How to flash U-Boot

Tagged: 

This topic contains 13 replies, has 5 voices, and was last updated by  rager 3 weeks, 6 days ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #828

    wombat
    Participant

    Upstream U-Boot now supports the espressobin — but I can’t find any information as to how to flash it to the board.
    I assume that u-boot is held on the SPI NOR-Flash, so I could flash it from u-boot. But I worry about recovery if something goes wrong… the only info I’ve found about recovering is by using a proprietary windows^{TM} tool wtptp which is only avialable for Marvell customers under NDA.

    Will kwboot work?

    #848

    stappers
    Participant

    How to flash U-boot on espressobin is a good question.

    If it get answered it should go on the wiki.

    Yes I do understand that corrupting U-boot bricks the device. So that risk should also be documented.

    Groeten
    Geert Stappers

    #862

    wombat
    Participant

    I’ve been searching around (no help from the forum) and have come up with a lot of stuff that doesn1t work.

    Theporetically one can upload a bootloader via the serial port (instructions at http://wiki.espressobin.net/tiki-index.php?page=Recovery+option+from+UART ). You can get the tools for Linux from GitHub: https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell and the source to build BL1, BL2 and BL31 from https://github.com/MarvellEmbeddedProcessors/atf-marvell

    But when I do:
    `cd build/a3700/release
    $SRC/A3700-utils-marvell/wtptp_tool/linux/WtpDownload_linux -P UART -C 0 -R 115200 -B uart-images/TIM_ATF.bin -I uart-images/wtmi_h.bin -I uart-images/boot-image_h.bin -E`

    I see the images uploaded then I see:
    `Download time for image 3->0hr:1min:7s
    Success: Download file complete for image 3
    +`
    and the upload tool hangs.

    #890

    wombat
    Participant

    There’s been a new post on the WIKI at http://wiki.espressobin.net/tiki-index.php?page=Boot+ESPRESSObin+from+SATA+drive
    The interesting thing there is that despite all the other documentation saying that the boot image starts at LBA1, it actually starts at LBA0 — overwriting the MSDOS partition table. I guess if you use GPT it’ll be OK.

    #929

    wombat
    Participant

    This is what I see after building a flash image and putting it ont eh SATA:
    `
    SVC_REV:0
    VERBOSE: Skipping CPU specific reset operation for nonWARNING: Nothing to allocate, requested size is zero
    VERBOSE: Trusted SRAM seen by this BL image: 0x4001000 – 0x4080000
    VERBOSE: Code region: 0x4100000 – 0x8100000
    VERBOSE: Read-only data region: 0 – 0
    `
    and then nothing.

    I built using:
    `
    export CROSS_COMPILE=aarch64-linux-gnu-
    export BL33=$HOME/src/espressoBin/u-boot-marvell/u-boot.bin
    export WTP=$HOME/src/espressoBin/A3700-utils-marvell/
    make BOOTDEV=SATA PARTNUM=0 LOG_LEVEL=50 DEBUG=0 MARVELL_SECURE_BOOT=0 \
    PLAT=a3700 DDR_TOPOLOGY=2 SECURE=0 USE_COHERENT_MEM=0 CLOCKSPRESET=CPU_1000_DDR_800 fip
    `
    in the atf-marvell repository at 627667b8f9b (current tip of branch atf-v1.3-armada-17.08)
    A3700-utils-marvell and u-boot-marvell are also on the 17.08 branch.

    #1074

    adamierymenko
    Participant

    I attempted this and got the same thing.

    #1077

    adamierymenko
    Participant

    It seems like the board ships with trusted firmware enabled, in which case it’s only possible to get firmware and u-boot updates from Marvell or Globalscale. Is that correct?

    #1088

    pjd
    Participant

    No, you just need to use the arm trusted firmware software to build an untrusted (or trusted if you want) wrapper for u-boot. The marvell version of the software is on their github

    https://github.com/MarvellEmbeddedProcessors/atf-marvell

    #1090

    wombat
    Participant

    @pjd — have you managed to get this to work? If so, please tell us how!

    #1094

    pjd
    Participant

    Yes, I’d actually just got this to work yesterday, I’m in the process of documenting my steps for my own records so I’ll post that when it’s done. However if you look at the marvell docs for ATF here[1] then you can just take the flash image from the build directory and upload it with the bubt/tftp method described in the sata/u-boot docs.

    [1] https://github.com/MarvellEmbeddedProcessors/atf-marvell/blob/atf-v1.3-17.04/docs/marvell/build.txt

    #1110

    pjd
    Participant

    So I’m not going to cover the setting up of the cross compiler etc as that’s different for various distributions and there is documentation elsewhere on the wiki for that and also within most of the ‘docs’ directories of the git repositories used below. However here are the steps I’ve followed (and tested) to compile u-boot and flash it, remember to change /some/dir to wherever you’ve used and to change the ip addresses.

    Oh and also I’ve listed the current latest git branches here, you probably want to check for newer branches depending on when you’re reading this

    First make a directory to build everything in…

    
    mkdir marvell_u-boot_build
    cd marvell_u-boot_build
    

    get the tools, they should already contain binaries

    
    git clone https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
    
    cd A3700-utils-marvell/
    
    git checkout A3700_utils-armada-17.08
    
    export WTP=/some/dir/marvell_u-boot/A3700-utils-marvell
    
    cd ..
    

    build u-boot:

    
    git clone https://github.com/MarvellEmbeddedProcessors/u-boot-marvell.git
    
    cd u-boot-marvell/
    
    git checkout u-boot-2017.03-armada-17.08
    
    export CROSS_COMPILE=/some/dir/toolchain/gcc-linaro-5.2-2015.11-2-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
    
    make mvebu_espressobin-88f3720_defconfig
    
    make DEVICE_TREE=armada-3720-espressobin
    cd ..
    

    build an Arm Trusted Firmware wrapper for u-boot:

    
    git clone https://github.com/MarvellEmbeddedProcessors/atf-marvell.git
    
    cd atf-marvell/
    
    git checkout atf-v1.3-armada-17.08
    
    export BL33=/some/dir/uboot_build/u-boot-marvell/u-boot.bin
    
    make DEBUG=0 USE_COHERENT_MEM=0 LOG_LEVEL=20 SECURE=0 CLOCKSPRESET=CPU_1000_DDR_800 DDR_TOPOLOGY=2 BOOTDEV=SPINOR PARTNUM=0 PLAT=a3700 all fip
    

    To update the SPI nor flash via tftp copy the flash image into your tftp directory:

    cp build/a3700/release/flash-image.bin /var/lib/tftpboot/test_flash-image.bin

    At the existing u-boot prompt:

    
    Marvell>> setenv ipaddr 192.168.1.5
    Marvell>> setenv serverip 192.168.1.3
    Marvell>> bubt test_flash-image.bin spi tftp
    
    #1133

    wombat
    Participant

    I tried something similar, to create a u-boot that could be loaded from SATA.
    The changes I made were:

    make BOOTDEV=SATA PARTNUM=0 LOG_LEVEL=50 DEBUG=0 MARVELL_SECURE_BOOT=0 \
         PLAT=a3700 DDR_TOPOLOGY=2 SECURE=0 USE_COHERENT_MEM=0 CLOCKSPRESET=CPU_1000_DDR_800 all fip

    and the output I see when trying to boot from this after dumping it at sector 0 of the SATA drive is:

    SVC_REV:0                                                                       
    VERBOSE: Skipping CPU specific reset operation for nonWARNING: Nothing to alloco
    VERBOSE: Trusted SRAM seen by this BL image: 0x4001000 - 0x4080000              
    VERBOSE: Code region: 0x4100000 - 0x8100000                                     
    VERBOSE: Read-only data region: 0 - 0

    then nothing.

    #1134

    wombat
    Participant

    Ha! Got it at last. If I switch to gcc-5 (I was using gcc-7) it all works.

    #1716

    rager
    Participant

    I made it boot an image over UART on Linux as per the instructions from the docs. The step missing was to kill the terminal and disable modem control signals:

    3. Stop the terminal emulator program on the UART port attached to the
    target board (minicom) for releasing the serial port and allowing an application to use it for image download.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.

Signup to our newsletter

Technical specification tables can not be displayed on mobile. Please view on desktop