付録A Hermit-At Bootloader

Hermit-At is a functional downloader and bootloader used on Atmark Techno products. The Hermit-At bootloader prompt is displayed when an Armadillo board is booted in maintenance mode. From the prompt it is possible to enter commands for a variety of operations such as updating flash memory and setting Linux kernel parameters. The following gives details on the most well used functions.

A.1. version

This command displays version information.

Syntax: version

図A.1 version Syntax


A.1.1. version Example

hermit> version
Hermit-At v2.0.0 (armadillo4x0) compiled at 23:03:08, Mar 08 2010

図A.2 version Example


A.2. info

This command displays board information.

Syntax: info

図A.3 info Syntax


A.2.1. info Example

hermit> info
 Board Type: 0x00000440
Hardware ID: 0x00000300
    DRAM ID: 0x00000002
     Jumper: 0x00000001
    Tact-SW: 0x00000000

図A.4 info Example


A.3. memmap

This command displays the flash memory and DRAM memory map.

Syntax: memmap

図A.5 memmap Syntax


A.3.1. memmap Example

hermit> memmap
0xa0000000:0xa1ffffff FLA all bf:8K bl:4x32K/l,255x128K/l
0xa0000000:0xa001ffff FLA bootloader bf:8K bl:4x32K/l
0xa0020000:0xa021ffff FLA kernel bf:8K bl:16x128K
0xa0220000:0xa1fdffff FLA userland bf:8K bl:238x128K
0xa1fe0000:0xa1ffffff FLA config bf:8K bl:1x128K
0x80000000:0x87ffffff RAM dram-1

図A.6 memmap Example


A.4. mac

This command displays the MAC address.

Syntax: mac

図A.7 mac Syntax


A.4.1. mac Example

hermit> mac
00:11:0c:00:00:00

図A.8 mac Example


A.5. md5sum

This command calculates and displays the md5sum value of the specified memory region.

Syntax: md5sum <start address> <size>

図A.9 md5sum Syntax


A.5.1. md5sum Example

To calculate and display the md5sum value of the first 1024 bytes of the bootloader region, execute the command shown in 図A.10「md5sum Example」.

hermit> memmap
0xa0000000:0xa1ffffff FLA all bf:8K bl:4x32K/l,255x128K/l
0xa0000000:0xa001ffff FLA bootloader bf:8K bl:4x32K/l
0xa0020000:0xa021ffff FLA kernel bf:8K bl:16x128K
0xa0220000:0xa1fdffff FLA userland bf:8K bl:238x128K
0xa1fe0000:0xa1ffffff FLA config bf:8K bl:1x128K
0x80000000:0x87ffffff RAM dram-1
hermit> md5sum 0xa0000000 1024
fd44ce938f65726dc59669f537154429

図A.10 md5sum Example


A.6. erase

This command erases flash memory.

Syntax: erase [address]

図A.11 erase Syntax


A.6.1. erase Example

hermit> erase 0xa0fe0000

図A.12 erase Example


A.7. setenv and clearenv

These commands are used to set Linux kernel parameters. The parameters set with setenv are passed to the kernel at boot time. Executing clearenv clears any configuration. The parameters are saved in flash memory and are therefore maintained even after rebooting.

Syntax: setenv [kernel parameter]...
Explanation: Sets kernel parameters. Shows current configuration if executed without any options specified.

Syntax: clearenv
Explanation: Clears all set options.

図A.13 setenv/clearenv Syntax


A.7.1. setenv/clearenv Example

hermit> setenv console=ttymxc1
hermit> setenv
1: console=ttymxc1
hermit> clearenv
hermit> setenv
hermit>

図A.14 setenv and clearenv Example


A.7.2. Linux Kernel Parameters

Example Linux kernel parameters are shown in 表A.1「Well Used Linux Kernel Parameters」. For information on other options, please refer to linux-2.6/Documentation/kernel-parameters.txt.

表A.1 Well Used Linux Kernel Parameters

OptionDescription
consoleSpecify device to be used for kernel console.
rootSpecify root filesystem related settings.
rootdelaySeconds to wait before attempting to mount root filesystem.
rootwaitWait until the root filesystem is accessible before attempting to mount it.
noinitrdSpecify what should happen with the initrd data after the kernel has booted.
nfsrootSpecify root filesystem place and NFS options when using NFS.

[警告]

When ttymxc1,2,4 is specified for the console option, the serial interface used by Hermit-At will also change to that interface after the next boot.

A.8. setbootdevice

This command is used to specify the boot device holding the Linux kernel. This setting is saved in flash memory and is therefore maintained even after rebooting.

Syntax: setbootdevice flash
Explanation: Extract the kernel image stored in the kernel flash memory region to RAM and boot it

Syntax: setbootdevice tftp <client IP address> <server IP address> [--kernel=<path>] [--userland=<path>]
Explanation: Download kernel and/or userland image from TFTP server, extract to RAM and boot

Syntax: setbootdevice mmcblk0pN
Explanation: Extract kernel image from /boot/ directory in partition N of MMC/SD card to RAM and boot

図A.15 setbootdevice Syntax


A.8.1. setbootdevice Example

To boot the kernel image stored in flash memory, execute the command shown in 図A.16「Assigning Flash Memory As Boot Device」.

hermit> setbootdevice flash

図A.16 Assigning Flash Memory As Boot Device


To download and boot a kernel image named linux.bin.gz from a TFTP server (IP address: 192.168.10.10), execute the command shown in 図A.17「Assigning TFTP Server As Boot Device」.

hermit> setbootdevice 192.168.10.10 192.168.10.1 --kernel=linux.bin.gz

図A.17 Assigning TFTP Server As Boot Device


To boot a kernel image stored in the first partition of a SD/MMC card, execute the command shown in 図A.18「Assign SD/MMC Card As Boot Device」.

hermit> setbootdevice mmcblk0p1

図A.18 Assign SD/MMC Card As Boot Device


A.9. frob

This command is used to enter a mode for reading or altering data at a specified address.

表A.2 frob Command

frob CommandDescription
peek [addr]Read 32bit data from specified address
peek16 [addr]Read 16bit data from specified address
peek8 [addr]Read 8bit data from specified address
poke [addr] [value]Write 32bit data to specified address
poke16 [addr] [value]Write 16bit data to specified address
poke8 [addr] [value]Write 8bit data to specified address

A.10. tftpdl

This command is used to download an image file from a TFTP server and write it to flash memory.

Syntax: tftpdl <client IP address> <server IP address> <option> [option]...
Explanation: Sets the local IP address to the specified client address, then downloads an image file from the TFTP server at the specified server IP address and writes it to flash memory.

図A.19 tftpdl Syntax


表A.3 tftpdl Options

OptionDescription
--bootloader=filepathSpecify file to be written to the bootloader region in place of filepath.
--kernel=filepathSpecify file to be written to the kernel region in place of filepath.
--userland=filepathSpecify file to be written to the userland region in place of filepath.
--fakeDownload the files, but do not actually write the files to flash memory.

A.10.1. tdtpdl Example

hermit> tftpdl 192.168.10.10 192.168.10.1 --kernel=linux.bin.gz

Client: 192.168.10.10
Server: 192.168.10.1
Region(kernel): linux.bin.gz

initializing net-device...OK
Filename : linux.bin.gz
.................................................................................
.................................................................................
....................
Filesize : 1841551

programing: kernel
###############

completed!!

図A.20 tftpdl Example


A.11. tftpboot

This command is used to download an image file from a TFTP server, extract it to RAM and then boot it. As opposed to the tftpdl command, the file is not written to flash memory. Also, the settings are not saved like they are when using the setbootdevice command.

Syntax: tftpboot <client IP address> <server IP address> <option> [option]...
Explanation: Sets the local IP address to the specified client address, then downloads the specified image file from the TFTP server at the specified server IP address, extracts it to RAM and boots it.

図A.21 tftpboot Syntax


The same options as shown in 表A.3「tftpdl Options」 can be used with this command. When --fake is specified, the file is downloaded but not booted.

A.11.1. tdtpboot Example

hermit> tftpboot 192.168.10.10 192.168.10.1 --kernel=linux.bin.gz

Client: 192.168.10.10
Server: 192.168.10.1
Region(kernel): linux.bin.gz

initializing net-device...OK
Filename : linux.bin.gz
.................................................................................
.................................................................................
....................
Filesize : 1841551

Uncompressing  kernel:net........................................................
.................................................done.
Uncompressing ramdisk............................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
............................................done.                             1
Linux version 2.6.26-at6 (2.6.26) (atmark@sv-build) (gcc version 4.3.2 (Debian 
4.3.2-1.1) ) #6 PREEMPT Wed Mar 10 19:19:13 JST 2010                          2
    :
    :

図A.22 tftpboot Example


1

The kernel and userland images are being extracted to RAM.

2

The kernel is booted and kernel boot log displayed.

A.12. boot

This command boots the Linux kernel image from the boot device specified with the setbootdevice command.

Syntax: boot

図A.23 boot Syntax


A.12.1. boot Example

hermit> boot
Uncompressing  kernel............................................................
.............................................done.
Uncompressing ramdisk............................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
.................................................................................
............................................done.                             1
Doing console=ttymxc1                                                         2
Linux version 2.6.26-at6 (2.6.26) (atmark@sv-build) (gcc version 4.3.2 (Debian 
4.3.2-1.1) ) #6 PREEMPT Wed Mar 10 19:19:13 JST 2010                          3
CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
Machine: Armadillo-440
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: console=ttymxc1
MXC IRQ initialized
    :
    :

図A.24 boot Example


1

The kernel and userland images are being extracted to RAM.

2

Kernel parameters set with the setenv command are displayed. All messages up to this point are from Hermit-At.

3

The kernel is booted and kernel boot log displayed.

A.13. Note On Versions

When a bootloader image based on hermit-at v2.0.0 source (loader-armadillo4x0-v2.0.0.bin etc) and a kernel image based on linux-2.6.26-at7 source (linux-a400-1.00.bin.gz etc) are used on Armadillo-440 Rev.C1 or later boards (S/N 100201-2195 or greater), a problem exists where the kernel may not boot. This problem only occurs with the above combination.

On Armadillo-440 Rev.C1 or later boards (S/N 100201-2195 and greater), please use a bootloader image based on hermit-at v2.0.1 or later source (loader-armadillo4x0-v2.0.1.bin or later).[20]



[20] On Armadillo-440 Rev.C1 and later boards, loader-armadillo4x0-v2.0.1.bin or a later version is written to flash memory in the default factory state.