Loading...
 

Update the Bootloader

 Warning

Following the steps in this page to update the bootloader image will potentially brick the MACCHIATObin board, especially when you have modified the bootloader source code by your own, or the MACCHIATObin board experiences power loss during the update procedure, etc. Please proceed with caution.


The bootloader image for MACCHIATObin can be obtained by following the steps in Build from source - Bootloader or by downloading the image from our Software page. This page will walk you through the bootloader update process via network, i.e. using the TFTP server. Aside from updating the bootloader through the TFTP, it can also be updated via USB stick, SATA disk, etc.

The following instructions will assume you have already successfully setup the TFTP server on your build machine which will host the new bootloader image - flash-image.bin.

First, you will need to copy the new bootloader image to the directory where the TFTP server hosts the files. In this tutorial we used the /var/lib/tftpboot directory as the root directory for TFTP server file sharing, and we created a sub directory mcbin to hold the bootloader binary:

mcbin@buildserver:~/atf-marvell$ sudo cp build/a80x0_mcbin/release/flash-image.bin /var/lib/tftpboot/mcbin/


Now power on the MACCHIATObin, interrupt the autoboot process, and have the MACCHIATObin stay in the U-Boot command prompt. Follow the instructions on the page Use network in U-Boot to setup the network.

 Note

You'll just need to setup the proper Ethernet interface (ethact & ethprime), ipaddr and serverip, and make sure the network connection is valid by checking with ping test. To simplify the setup, please use the 1G Ethernet interface egiga2. Starting from the armada-17.06 release, the U-Boot version is upgraded from 2015.01 to 2017.03. So, if you are already using the U-Boot from armada-17.06, the 1G Ethernet port will no longer be egiga2, it should be eth2 (mvpp2-4) instead.


Once you have a working network under U-Boot, please issue the command bubt to update the bootloader. Make sure that the MACCHIATObin board does not experience power loss during the entire updating process, otherwise it will be bricked due to an unfinished bootloader update.

Marvell>> bubt flash-image.bin
Burning U-BOOT image "flash-image.bin" from "tftp" to "mmc"
Using mvpp2-4 device
TFTP from server 192.168.5.3; our IP address is 192.168.5.6
Filename 'flash-image.bin'.
Load address: 0x5000000
Loading: #################################################################
	 ################
	 3.8 MiB/s
done
Bytes transferred = 1180812 (12048c hex)
Image checksum...OK!
Done!


After the bootloader update is done, reset or power cycle the MACCHIATObin, check the log info of the ATF and bootloader to confirm if the update is successful. 

The screen below shows a successful boot log for a 17.10 bootloader release.

BootROM - 2.03
Starting CP-0 IOROM 1.07
Booting from SD 0 (0x29)
Found valid image at boot postion 0x000
lNOTICE:  Starting binary extension
NOTICE:  SVC: SW Revision 0x0. SVC is not supported
mv_ddr: mv_ddr-armada-17.10.4-gcc280f0 (Feb 02 2018 - 13:57:45)
mv_ddr: completed successfully
NOTICE:  Cold boot
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.3(release):armada-17.10.6:84c1c1d
NOTICE:  BL1: Built : 13:57:53, Feb  2 2018
NOTICE:  BL1: Booting BL2
lNOTICE:  BL2: v1.3(release):armada-17.10.6:84c1c1d
NOTICE:  BL2: Built : 13:57:55, Feb  2 2018
BL2: Initiating SCP_BL2 transfer to SCP
NOTICE:  SCP_BL2 contains 2 concatenated images
NOTICE:  Load image to CP1 MSS
NOTICE:  Loading MSS image from address 0x4023020 Size 0x1378 to MSS at 0xf4280000
NOTICE:  Done
NOTICE:  Load image to AP MSS
NOTICE:  Loading MSS image from address 0x4024398 Size 0x1f68 to MSS at 0xf0580000
N

FreeRTOS 7.3.0 - Marvell cm3 - A8K release armada-17.10.1

OTICE:  Done
NOTICE:  SCP Image doesn't contain PM firmware
NOTICE:  BL1: Booting BL31
lNOTICE:  MSS PM is not supported in this build
NOTICE:  BL31: v1.3(release):armada-17.10.6:84c1c1d
NOTICE:  BL31: Built : 13:57:59, Feb  2 2018
l

U-Boot 2017.03-armada-17.10.2-g6a6581a-dirty (Feb 02 2018 - 13:04:42 +0000)

...

 
For a complete reference of how to use the bubt command in U-Boot, please do a help bubt command to check the parameter definitions.

Marvell>> help bubt
bubt - Burn a u-boot image to flash

Usage:
bubt [file-name] [destination [source]]
        -file-name     The image file name to burn. Default = flash-image.bin
        -destination   Flash to burn to [spi, nor, nand, mmc, spinand]. Default = active boot device
        -source        The source to load image from [tftp, usb, mmc]. Default = tftp
Examples:
        bubt - Burn u-boot.bin from tftp to active boot device
        bubt latest-spi.bin nand - Burn latest-spi.bin from tftp to NAND flash
        bubt backup-nor.bin nor usb - Burn backup-nor.bin from usb to NOR flash


Starting from the armada-17.06 release, the U-Boot version is upgraded from 2015.01 to 2017.03. In order to avoid any possible incompatibility issues regarding to the environment variables. Please under the new U-Boot version, do env default -a to reset all the environment variables, then setup the desired variables again, and do env save to write them to the non-volatile storage.

Marvell>> env default -a
Marvell>> env save