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 Type | Slide Switch | Description |
---|
Maintenance mode | Outside | The U-Boot command prompt starts from which various configuration is possible. |
Auto boot mode | Inside | The 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
Command | Description |
---|
boot | Used to boot the operating system |
bdinfo | Displays 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. |
crc32 | Used to display the checksum of a memory area |
version | Displays bootloader version |
Help for each command can be displayed as shown in 図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".
The Linux kernel image is saved with the filename "uImage". The device tree blob is saved with the filename "armadillo_iotg_g3.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 Value | Boot Device |
---|
0 | SD card (connected to CON4) |
1 | eMMC |
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」.
The default values of "mmcdev" and "mmcpart" differ between the bootloader for QSPI and the bootloader for SD. 表6.4「Bootloader Types and Default Values for mmcdev and mmcpart」 shows the relationship between the type of bootloader and the default values.
表6.4 Bootloader Types and Default Values for mmcdev and mmcpart
Bootloader Type | Bootloader Filename | mmcdev Default Value | mmcpart Default Value |
---|
For QSPI | u-boot-x1-at*.bin | 1 (eMMC) | 1 |
For SD | u-boot-x1-sd-at*.bin | 0 (SD) | 1 |
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」.
The default value of "mmcroot" differs between the bootloader for QSPI and the bootloader for SD. 表6.5「Bootloader Types and mmcroot Default Values」 shows the relationship between the type of bootloader and the default value.
表6.5 Bootloader Types and mmcroot Default Values
Bootloader Type | Bootloader Filename | mmcroot Default Value |
---|
For QSPI | u-boot-x1-v*.*.*.bin | /dev/mmcblk2p2 (eMMC partition 2) |
For SD | u-boot-x1-sd-v*.*.*.bin | /dev/mmcblk0p2(SD partition 2) |
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.
When using the QSPI bootloader environment variables are saved on the QSPI Flash. When using the SD bootloader, environment variables are saved on the SD.
To restore all the environment variables to default values, see 図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.6「Linux Kernel Boot Options Examples」.
表6.6 Linux Kernel Boot Options Examples
Option Specifier | Description |
---|
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.
|
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.
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.
|
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.
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」.