Loading...
 

Setup alternative boot sources

Table of contents

 

By default, the MACCHIATObin is setup to load the bootloader(ARM Trusted Firmware + U-Boot) binary from the on board SPI flash during the boot stage. The board can also be setup to load the bootloader image from the different sources such as on board eMMC and removable Micro SD Card. To find out the DIP switch settings for different boot sources, please refer to the Ports and Interfaces page, section Boot Selection.

 Note

As of revision 1.3 (MACCHIATObin Single Shot and MACCHIATObin Double Shot), the DIP switches have been replaced with 2x10 100mil pin header. When working with jumpers, an "ON" entry in the tables below means that a jumper is placed, whereas "OFF" means no jumper is placed.

Boot from Micro SD Card


You'll need to make a Micro SD Card that is bootable to the MACCHIATObin board in order to support this feature. The example instructions below assumes that you have a Micro SD CARD plugged into a USB Micro SD Card reader and have it connected to the Linux machine, therefore the Micro SD device will show up as /dev/sdx in your Linux machine.

First, let's use the fdisk tool in the Linux to make partitions on the Micro SD Card. We'll need to use the first partition to keep the bootloader for MACCHIATObin. For the rest of the available space in the Micro SD Card, we can create a new partition to keep the Kernel images and root file system for the board. Please be sure to back up all the existing data before you are doing fdisk on the Micro SD card.

mcbin@buildserver:~$ sudo fdisk /dev/sdd


After partitioning, the partition table will be like this:

Command (m for help): p
Disk /dev/sdd: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdd1        4096    69631    65536   32M 83 Linux
/dev/sdd2       69632 15523839 15454208  7.4G 83 Linux


Please make sure the first partition (the partition holds the bootloader image) starts at the sector 4096. We reserve 32MB of the space in the first partition to keep the bootloader image. Then, we write the partition table and exit the fdisk tool. To confirm the partitions have been created, we can check this in the /dev directory.

mcbin@buildserver:~$ ls /dev/sdd*
/dev/sdd  /dev/sdd1  /dev/sdd2


Next, use the dd tool to write the bootloader image flash-image.bin to the first partition in the Micro SD Card. For the instructions on how to create the bootloader image, please refer to the page Build from source - Bootloader.

mcbin@buildserver:~$ sudo dd if=/home/mcbin/atf/build/a80x0/release/flash-image.bin of=/dev/sdd1 conv=fdatasync


Optionally, you can create the ext4 file system on the second partition with mkfs.ext4 tool and copy the root file system and kernel to the new file system, sample instructions can be found at page Boot from removable storage - Buildroot.

After you have everything finished on your Linux machine, remove the Micro SD Card and plug it back to the Micro SD Card slot on the MACCHIATObin.

Next step is to setup the DIP switch on the MACCHIATObin correctly to select the boot source to be SD CARD. Please refer to the page Ports and Interfaces page, section Boot Selection for the DIP switch settings.

Now power on the MACCHIATObin, and check the console output.

BootROM - 2.03
Starting CP-0 IOROM 1.07
Booting from SD 0 (0x29)
Found valid image at boot postion 0x002
lNOTICE:  Starting binary extension
NOTICE:  Gathering DRAM information
mv_ddr: mv_ddr-devel-17.04.0-gf0fda76 (Apr 10 2017 - 18:34:48)
mv_ddr: completed successfully


The log indicates the SoC BootROM found the valid bootloader image from the Micro SD card and proceed to the booting process for MACCHIATObin.