Linux Fastboot EP930x

From embeddedTS Manuals

Through software optimizations, the TS-7260, TS-7300, and TS-7400 ARM SBCs can now bootup entirely from an SD card to a Linux prompt in under 2 seconds after power-up (TS-7260 boots in 1.59s, TS-7400 boots in 1.56s, and TS-7300 boots in 1.84s). Other unique software solutions include easy software upgrades via a USB flash drive, hardware manipulation via shell scripts, and a Linux based bootloader for failsafe software upgrades.

embeddedTS provides a new SD Card image that includes tweaks to the kernel, initrd, and Debian filesystem on partition 3. In addition, fast boot optimizations have been applied to the TS-SDBOOT bootup firmware that resides in ROM memory.


Installing the Image

The new SD Card image that enables the fast bootup option is available on our FTP site

The SD Card image requires an SD Card with a minimum size of 256 MB. To install the image, follow the instructions below:

# Write the image to SD card
# From a Linux workstation (assuming /dev/sdb is the SD Card attached to the system):
bzcat sdimage.dd.bz2 > /dev/sdb
sync

# From the second SD Card slot of a TS-7300:
bzcat sdimage.dd.bz2 > /dev/sdcard1/disc0/disc
WARNING: This will completely overwrite the contents of the SD Card.


To use the image on a larger card (512MB, for example), first write the whole image above to the larger card, then use fdisk (or similar MBR partitioning tools) to increase the size of the 3rd partition to use the remaining space (taking care to keep the same start sector), then running ext2resize against that partition: <syntaxhilight lang=bash> fdisk /dev/sdcard1/disc0/disc ext2resize /dev/sdcard1/disc0/part3 </syntaxhighlight>


Next, for TS-7260 and TS-7400 platforms, download the proper kernel for the SD card:

# Using an SD Card reader utility, copy the kernel to the first partition of the SD Card (Assuming /dev/sdb is the correct device node):
dd if=<KERNEL> of=/dev/sdb1

# Or, using the second SD Card slot of your TS-7300:
dd if=<KERNEL> of=/dev/sdcard1/disc0/part1


For TS-7260 and TS-7400 platforms, download the tsbootrom-update utility and update preboot on the device itself:

mac=`ifconfig eth0 | grep HWaddr | cut -d' ' -f11` 
tsbootrom-update -s -m $mac
WARNING: Once a TS-7260 is set to boot from the SD card, there is no easy way to reverse the process so it boots from the flash again. tsbootrom-update is a generic utility and while the -f option will work on other platforms it doesn't work on the TS-7260.


Last, if using a TS-7400, update the kernel modules on the SD Card:

# From a Linux workstation, assuming /dev/sdb is the correct device node of the SD card:
mount /dev/sdb3 /mnt
tar xzvfp tskernelmodules-2.4.26-ts11-7400.tar.gz -C /mnt/lib/modules/
umount /mnt


How Fastboot Works

Note: The TS-7400 TS-FLASHBOOT (the default bootloader) also supports this feature.


The new SD image will look at the state of jumper 6 on a TS-7300 or in the case of a TS-7260 or TS-7400 will check for the presence of a file name /tsfastboot on the Linux partition (third partition). If jumper 6 is on (or /tsfastboot exists, the full Debian bootup will be bypassed and the system will instead drop straight to a shell prompt. Within 2 seconds after power-on, the serial console prompt is active and ~2.62 seconds after power-on the video console is displayed on the TS-7300. Video takes a bit longer to start up due to the fact that the FPGA must be initialized, a splash screen displayed, and USB keyboard kernel modules must be loaded. To initiate a full Debian startup, simply type exit at either the shell prompt on the serial port or the shell prompt on the VGA monitor (using a USB keyboard).

The time it takes for bootup is also displayed right before the shell prompt is printed. On new Rev. C CPLD TS-7300's, the CPLD has a 32-bit counter that starts at 0 at power-on and is used to measure the bootup time extremely accurately. On other platforms, the EP9302 983 KHz debug4 timer is used since it starts out as 0 also, but is slightly less accurate than the 32-bit 14.7 MHz counter implemented in the new CPLD rev.

In order to run an application, and not just a shell prompt, as soon as possible on bootup, edit the /linuxrc shell script in the initrd. The fastboot process is actually booting to an initrd with the Debian partition mounted read-only. After modifying the /linuxrc shell script on the initrd, run the save command to save the initrd back to the SD card, otherwise, changes made will be lost.

The bootup firmware was designed to be much faster than a x86 PC/SBC BIOS. So even better bootup times can be achieved with an RTOS, such as eCos, instead of Linux. Of the entire bootup time, about 1.4 seconds represents Linux bootstrap, while the rest is the hardware initialization.