10 update, 11 recovery mechanism, Am4150 u-boot bootloader u-boot usage – Kontron AM4150 U-Boot Bootloader User Manual

Page 47

Advertising
background image

AM4150 U-Boot Bootloader

U-Boot Usage

ID 1052-5678, Rev. 1.0

Page 47

P R E L I M I N A R Y

6.10

Update

The environment contains two scripts which allow an update of various components, e.g. U-
Boot, bootrom for VxWorks, data in EEPROMs, etc.

The script “update” checks for a U-Boot script “update” in the directory “update” in the first par-
tition of the SD card with “ext2” or “fat” filesystem. If unsuccessful, the check continues with the
first NAND chip, volume “boot”, and again U-Boot searches in the subdirectory “update” for the
script “update”. If the script “update” is found, it is loaded to memory and executed.

So, to actually execute an update, e.g. an SD card should be prepared with a directory “update”
on the first partition. Kontron provides an update e.g. for U-Boot as a compressed archive (zip,
tar.bz2, tar.gz) which must be unpacked in the directory “update”.

After the SD card is inserted, U-Boot should be stopped at the console after power-up. To man-
ually start the update, enter the following command:

In the case of a U-Boot update, only the standard SPI boot flash is updated.

The script “netupdate” tries to load a U-Boot script “update/update” from the server. If found, it
is loaded to memory and executed as in the case of the SD card.

As the script “netupdate” requires access to a server, the environment variable “serverip”
must be set correctly. Alternatively, it is possible to use the “dhcp” or “bootp” commands.

An automatic run of the update script at every startup takes place if the update script is started
in the preboot environment variable:

6.11

Recovery Mechanism

The are two SPI boot flashes available with each device holding a copy of U-Boot. In case the
contents of the standard SPI boot flash have been corrupted (e.g. as a result of a power failure
during an update), the IPMI subsystem detects the problem, switches the flashes and restarts
the CPU. The board starts from the recovery SPI boot flash. In this state, the standard SPI boot
flash can be programmed again with the “update” or “netupdate” scripts described in the previ-
ous Chapter “6.9 Update”.

The update scripts provided ensure that prior to the update the standard SPI boot flash is se-
lected and the U-Boot update image is available and correct.

The contents of the recovery SPI boot flash should never be updated in order to avoid a com-
pletely inoperable system with no accessing capability.

run update

setenv preboot 'run update'

saveenv

Advertising