FlashUpdate UserGuide
FlashUpdate UserGuide
July 2009
Revision 1.6
1.0
2.0
Description
3.0
Usage
Description
-h
-v
Verbose operation - create a log file and report explicit error messages.
-shf
Assume the system has shared flash; i.e., BIOS and EC firmware (FW) are located on same
flash device.
-nshf
Assume the system has no shared flash; i.e., only FW is on the EC flash. By default (i.e., without
-shf or -nshf), the system type is recognized automatically.
-c <file name> Flash Configuration file name. By default, the tool looks for Flupdate.cfg.
-x <exit type>
Compare the given binary file with the flash data. In this mode, the flash is not programmed. If
this flag is provided in addition to the -ofs flag (see below), only the bytes starting from
<offset> are compared.
-bbl
Ignore protected sectors, as defined in the flash configuration file (see Section 4).
-noverify
-nocomp
Program the flash without first comparing its contents to the binary file data. By default, the contents
of each section are compared to the source file, and each section is programmed only if different.
-noreboot
Do not prompt the user to restart the computer after the download is finished.
-nopause
Start the download/compare without user approval. In addition, the application terminates
automatically after downloading the binary file to the flash (without restarting the computer).
-dislusb
For DOS only: disable the Legacy USB SMI (only in Intel chipsets) during the flash update
process.
www.nuvoton.com
Nuvoton Confidential
Option
Description
the Configuration Base Address of the device (in hex format); otherwise, try to locate the
-cba <address> Set
device at the following addresses (in this order): 0x164E, 0x2E, 0x4E.
-novr
-vrd
Verify the integrity of the load process using the read command rather than using the default checksum
command. This flag is effective only when the host writes to the shared memory via the I/O space.
-rfp
Remove Flash Protection when the protection window registers are accessible (i.e., not locked).
Load the provided binary file to the flash starting at offset <offset> from flash start. <offset>
-ofs <offset> must be aligned with the start address of a flash sector. If this flag is provided in addition to the
-compare flag, only the bytes starting from <offset> are compared.
-pfu
Enable EC FW to perform operations before the Flash Update process starts. This flag requires the
EC FW to implement the command Pre-Flash Update (see the specific EC Software User Guide).
-ocv
Override Calibration Values in the flash with the values provided in the binary file. By default, the
Flash Update Application automatically preserves the values when the EC contains an internal
clock. Therefore, this flag should be used only when the existing values need to be overridden.
vm <value>
For DOS only. This flag is used to change the default value of the video mode. It should be used
only if there is a known graphic limitation in the system.
Supported values are 18 (default), which uses 16 colors, and 17, which uses two colors.
genbsf <TSF
name>
Generates a Binary Script File (BSF) from a Text Script File (TSF). The BSF name is the same
as the TSF, but with a different extension (*.bsf instead of *.tsf).
runbsf <BSF
name>
Runs the commands in the Binary Script File (BSF) during the Flash Update process.
If the flupdate.bsf file exists in the Flash Update root directory, it is executed automatically (i.e.,
without the need for the input -runbsf flupdate.bsf).
4.0
The flash configuration file is provided to the Flash Update Application and determines which flash types are supported. A
flash configuration file can define up to 100 flash configurations.
The configuration file format is as follows:
[START CONFIG]
# NexFlash
# --------------FLASH_ID
FLASH_SIZE
SECTOR_DEF
= 0x14EF
= 2048
= 512:4K
BLOCK_SIZE
= 64
PAGE_SIZE
PROG_SIZE
= 256
=8
READ_DEV_ID_TYPE
=0
www.nuvoton.com
Revision 1.6
Nuvoton Confidential
[END CONFIG]
[START CONFIG]
.
.
.
.
.
[END CONFIG]
5.0
Flupdate.cmd
This is an optional file that provides configuration information. When the Flash Update Application is invoked with no command line parameters, it tries to locate the Flupdate.cmd file in the current directory. If the file exists, the Flash Update
Application reads its command line parameters from this file.
For example, if the contents of Flupdate.cmd content is:
-c flash.cfg flash.bin
the Flash Update Application runs as:
6.0
The BIOS Model and Version fields should be defined in the binary image file, as follows.
The Model field starts with $ML and ends with $; for example:
$MLABC$ defines the BIOS model as ABC.
The Version field starts with $VR and ends with $; for example:
$VR1.23.45$ defines the BIOS version as 1.23.45 (the Version field is a string).
Revision 1.6
www.nuvoton.com
# is used.
# Define SPI Flash commands
# -------------------------CMD_READ_DEV_ID
= 0x90
# Read Device ID command.
CMD_WRITE_STAT_EN = 0x06
# Enable Write to Status Register.
CMD_WRITE_EN
= 0x06
# Write Enable.
CMD_READ_STAT
= 0x05
# Read Status Register.
CMD_WRITE_STAT
= 0x01
# Write Status Register.
CMD_PROG
= 0x02
# Page Program or Byte Program.
CMD_SECTOR_ERASE
= 0x20
# Sector Erase.
CMD_BLOCK_ERASE
= 0xD8
# Block Erase.
# Define device busy bits in status register
# ------------------------------------------STATUS_BUSY_MASK
= 0x01
# Location (by mask) of busy bit located in
# the status register.
STATUS_REG_VAL
= 0x00
# Value of status register busy bit, when
# device is not busy. The device is
# considered not busy when:
# [status register value] & STATUS_BUSY_MASK = STATUS_REG_VAL.
# Define the protected sectors
# ----------------------------PROTECTED_SECTORS = 0-4
# Optional - Protected sectors in format sector
# number and/or range, separated by commas,
# e.g., 1,3,5-7. To avoid defining any protected
# sectors, make the line a remark line.
Nuvoton Confidential
6.1
It is recommended that both the Model and Version fields be located between offsets 0x50 and 0xA0 of the binary image
file. The value of each field has a maximum length of nine characters.
It is possible to change the location of the Model and Version fields using the Offset field, as follows.
The Offset field starts with $AD and ends with $; for example:
$AD3040$ defines the BIOS Model and Version fields as located between offsets 0x3040 and 0x3090
(the Offset field is a string).
7.0
The CHC enables the user to execute host commands that write to I/O, memory or PCI before and after the flash update process.
7.1
COMMANDS
There are three commands: I/O Write, Memory Write and PCI Register Write.
7.1.1
I/O Write
Syntax
Memory Write
Syntax
Syntax
PCIW : <Width> <Bus Number> <Device Number> <Function Number> <Register> <Data> [Mask]
Field Descriptions
<Width> - Same as the IOW command.
<Bus Number> - The bus number to be written.
<Device Number> - The device number to be written.
<Function Number> - The function number to be written.
<Register> - The register to be written.
<Data> - Same as the IOW command.
[Mask] - Same as the IOW command.
www.nuvoton.com
Revision 1.6
Nuvoton Confidential
In the CHC input files, define which CHC commands will be run and when they will be run (i.e., at what stage of the flash
update process). There are two types of input files: Text Script File (TSF), which is the source file, and Binary Script File
(BSF), which is compiled from the TSF.
Commands are first defined in the TSF. To run those commands, you must create a TSF, generate the BSF and then run
the BSF.
Binary Script File (*.bsf)
This is a binary file that is compiled from a Text Script File (TSF).
The -runbsf flag (see below) tells Flash Update to execute the commands defined in this file.
Text Script File (*.tsf)
This is the source file used to create a BSF. The TSF syntax is defined below.
To generate a BSF from a TSF, use the -genbsf flag (see example below).
7.2.1
TSF Syntax
Command Options
MEMW
IOW
PCIW
Stages
STAGE BEFORE FU commands in this section run before flash update starts.
STAGE AFTER FU commands in this section run after the flash update ends.
Syntax
Comment line - a line that starts with #
Tag indicating the start of the STAGE BEFORE FU section: [START STAGE BEFORE FU]
MEMW / IOW / PCIW command(s) Up to 40 commands are supported.
Tag indicating the end of the STAGE BEFORE FU section: [END STAGE BEFORE FU]
Tag indicating the start of the STAGE AFTER FU section: [START STAGE AFTER FU]
MEMW / IOW / PCIW command(s) Up to 40 commands are supported.
Tag indicating the end of the STAGE AFTER FU section: [END STAGE AFTER FU]
Revision 1.6
www.nuvoton.com
7.2
Nuvoton Confidential
7.2.2
CHC EXAMPLE
1)
2)
3)
www.nuvoton.com
Revision 1.6
Nuvoton Confidential
Dependencies
In systems with BIOS support for the Nuvoton EC, the system BIOS should configure the following:
Shared Memory registers in the SHM logical device (LDN 0Fh):
Shared Memory Base Address registers (index F8h-FBh)
SHM_CFG register (index F0h): field SHW_FWH_ID
WIN_CFG register (index F1h): bit SHWIN_ACC
The chipset should be configured to enable access to:
The I/O range of the EC logical device
The memory or I/O address range of the shared memory window
For example, in platforms where the SPI flash memory containing the EC firmware is not shared with the system BIOS (this
is one possible configuration with Intels Ibex Peak PCH), the BIOS is required to configure the I/O addresses as specified
in the EC Software User Guide, Shared Access RAM Window Section (see the sample code, which demonstrates how to
map the Window 2 base address to I/O address 400h). Then, the Flash Update Application can be used, as described in
Section 3.0 on page 1 (Flupdate.exe [options] <binary file>).
Important Notice
Nuvoton products are not designed, intended, authorized or warranted for use as components in systems or equipment intended
for surgical implantation, atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, or for other applications intended to support or sustain life. Furthermore,
Nuvoton products are not intended for applications wherein failure of Nuvoton products could result or lead to a situation wherein
personal injury, death or severe property or environmental damage could occur.
Nuvoton customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Nuvoton for any damages resulting from such improper use or sales.
Headquarters
No. 4, Creation Rd. 3,
Science-Based Industrial Park,
Hsinchu, Taiwan, R.O.C
TEL: 886-3-5770066
FAX: 886-3-5665577
http://www.nuvoton.com.tw/
Taipei Office
9F, No.480, Rueiguang Rd.,
Neihu District, Taipei, 114,
Taiwan, R.O.C.
TEL: 886-2-2658-8066
FAX: 886-2-8751-3579
Please note that all data and specifications are subject to change without notice.
All trademarks of products and companies mentioned in this document belong to their respective owners.
www.nuvoton.com
8.0