第6章 Bootloader Specifications

This chapter explains about the boot modes and available functions of the bootloader.

6.1. Bootloader Boot Modes

When the bootloader starts up, it switches to one of two modes depending on the state of the slide switch of the USB serial converter. For details about the USB serial converter slide switch, refer to 「Slide Switch Configuration」.

表6.1 Bootloader Boot Modes

Boot Mode TypeSlide SwitchDescription
Maintenance modeOutsideThe U-Boot command prompt starts from which various configuration is possible.
Auto boot modeInsideThe Linux kernel is automatically booted after power on.

When a USB serial converter is not connected, auto boot mode is used and the Linux kernel boots.

6.2. Bootloader Functions

In the maintenance mode of U-Boot it is possible to perform configuration such as Linux Kernel Boot Options.

Useful commands that can be used in maintenance mode are shown in 表6.2「Useful Maintenance Mode Commands List」.

表6.2 Useful Maintenance Mode Commands List

CommandDescription

boot

Used to boot the operating system
bdinfoDisplays hardware information

md

mm

nm

mw

cp

cmp

Used for simple memory access

printenv

setenv

saveenv

Used to set environment variables. Operating system boot options can be set with environment variables.
crc32Used to display the checksum of a memory area
versionDisplays bootloader version

Help for each command can be displayed as shown in 図6.1「Displaying U-Boot Command Help」.

=> help [command]

図6.1 Displaying U-Boot Command Help


6.2.1. How to Specify the Linux Kernel Image and Device Tree Blob

For the bootloader loading of the operating system, it is possible to use a Linux kernel image and device tree blob saved in either the eMMC or an SD card.

To specify the device storing the file use the environment variable "mmcdev", and to specify the partition number use the environment variable "mmcpart".

Linuxカーネルイメージはファイル名 "uImage" で保存されたものを使用します。device tree blobはファイル名 "armadillo_iotg_w2.dtb" で保存されたものを使用します。

表6.3「mmcdev Configuration Values and Boot Devices」 shows the relationship between the values that can be set with "mmcdev" and the boot device.

表6.3 mmcdev Configuration Values and Boot Devices

Configuration ValueBoot Device
0SD card (connected to CON4)
1eMMC

When specifying partition 1 of eMMC, please do as shown in図6.2「Booting from a Linux Kernel Image Stored on Partition 1 of eMMC」.

=> setenv mmcdev 1
=> setenv mmcpart 1

図6.2 Booting from a Linux Kernel Image Stored on Partition 1 of eMMC


6.2.2. Specifying the Root File System

Devices on which a root file system is stored can be specified with the environment variable "mmcroot".

When specifying partition 2 of eMMC, do as shown in 図6.3「Specifying the Root File System Stored in Partition 2 of eMMC」.

=> setenv mmcroot /dev/mmcblk2p2

図6.3 Specifying the Root File System Stored in Partition 2 of eMMC


6.2.3. Saving Environment Variables

Environment variables can be saved with the "saveenv" command. If the power of Armadillo-IoT is turned off without performing the save, the environment variables set with setenv will be lost.

To restore all the environment variables to default values, see 図6.4「Restoring All Environment Variables to Default Values」.

=> env default -a
=> saveenv

図6.4 Restoring All Environment Variables to Default Values


6.2.4. Linux Kernel Boot Options

6.2.4.1. Typical Linux Kernel Boot Options

The Linux kernel has various startup options. For details, refer to the Linux reference books and the documentation (Documentation/kernel-parameters.txt) included in the Linux kernel source code.

In this section, typical startup options that can be used with Armadillo-IoT are shown in 表6.4「Linux Kernel Boot Options Examples」.

表6.4 Linux Kernel Boot Options Examples

Option SpecifierDescription
console=

Specify the initial console which outputs boot log etc.

In the following example ttymxc1 is specified for the console and 115200 for the baudrate.

console=ttymxc1,115200
root=

Specify the device on which the root file system is stored.

For the device, specify the device as recognized by the Linux kernel.

The initrd is set as the root file system as shown in the following example.

root=/dev/ram0

When storing the root file system on an SD card, specify the SD card's device file. In the following example, the second partition of the microSD card is specified for the device.

root=/dev/mmcblk0p2
rootwait

Delay the mounting of the root file system until the device specified with "root=" becomes available.

mem

Specify the amount of memory available to the Linux kernel. Specify this when part of RAM is to be used as dedicated memory.


6.2.4.2. Setting Linux Kernel Boot Options

Linux kernel boot options can be specified with the "mmcargs" environment variable.

The default value of "mmcargs" is set to the following value.

setenv mmcargs setenv bootargs console=${console},${baudrate} root=${mmcroot} ${optargs}

By default, the console is set to the environment variable "console", the baudrate of the console is set to the environment variable "baudrate", and the root file system is set to the environment variable "mmcroot".

When wanting to add Linux kernel boot options, it is convenient to use the "optargs" environment variable.

Next, as an example, how to set the amount of memory available to the Linux kernel to 384M is shown in 図6.5「Setting the Available Memory Amount to 384M」.

=> setenv optargs mem=384M
=> saveenv
=> printenv optargs
mem=384M

図6.5 Setting the Available Memory Amount to 384M