Flash Update Application For Nuvoton Embedded Controllers User Guide
Flash Update Application For Nuvoton Embedded Controllers User Guide
3.0 Usage
Flupdate.exe [options] <binary file>
where <binary file> is the file containing the data to program into the flash, in binary format.
Option Description
-dislusb For DOS only: disable the Legacy USB SMI (only in Intel® chipsets) during the flash update
process.
Option Description
-cba <address> Set the Configuration Base Address of the device (in hex format); otherwise, try to locate the
device at the following addresses (in this order): 0x164E, 0x2E, 0x4E.
-novr Ignore BIOS model and version check.
Verify the integrity of the load process using the read command rather than using the default checksum
-vrd 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.
Enable EC FW to perform operations before the Flash Update process starts. This flag requires the
-pfu EC FW to implement the command “Pre-Flash Update” (see the specific EC Software User Guide).
Override Calibration Values in the flash with the values provided in the binary file. By default, the
-ocv 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.
For DOS only. This flag is used to change the default value of the video mode. It should be used
–vm <value> 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 Generates a Binary Script File (BSF) from a Text Script File (TSF). The BSF name is the same
name> as the TSF, but with a different extension (*.bsf instead of *.tsf).
Runs the commands in the Binary Script File (BSF) during the Flash Update process.
–runbsf <BSF
If the flupdate.bsf file exists in the Flash Update root directory, it is executed automatically (i.e.,
name> without the need for the input “-runbsf flupdate.bsf”).
[START CONFIG]
# NexFlash
# ---------------
FLASH_ID = 0x14EF # Device ID & Manufacturer.
FLASH_SIZE = 2048 # (2M) Flash size in Kbytes.
SECTOR_DEF = 512:4K # 512 sectors of 4K.
# The format is: n:sK,n:sK,....,n:sK.
# n - number of sectors.
# s - size of sectors in Kbytes.
BLOCK_SIZE = 64 # (64K) block size in Kbytes. If block erase is
# not supported, block size should be equal
# to FLASH_SIZE.
PAGE_SIZE = 256 # Page size in bytes.
PROG_SIZE =8 # Max number of bytes that can be programmed at
# one time. An FF value means PAGE_SIZE is used.
READ_DEV_ID_TYPE =0 # Read Device ID type.
# There are two ways to read the flash ID
#(depending on the flash type).
# A. Send the “Read ID” op-code, send 3 dummy
# address bytes and then read the ID bytes.
# B. Send the “Read ID” op-code and immediately
# read the ID bytes.
# When the value in this field is 0x47, method B
# is used. Otherwise (any other value) method A
[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 com-
mand 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:
7.1 COMMANDS
There are three commands: I/O Write, Memory Write and PCI Register Write.
Syntax
IOW : <Width> <Address> <Data> [Mask]
Field Descriptions
<Width> - “b” for byte, “w” for word, “d” for double word.
<Address> - The address to be written.
<Data> - The data to be written.
[Mask] - Cleared bits in this parameter preserve the original value of the equivalent bits in the address. For example, if the
current value in <Address> is 0xAA, <Data> is 0x55 and <Mask> is 0x0F, then after a successful execution of IOW, the new
value is 0xA5. Note: This parameter is optional. If it is not provided, the default is 0xFFFFFFFF (i.e., all the bits of the value
in the Address are changed, according to Width).
Syntax
MEMW : <Width> <Address> <Data> [Mask]
Field Descriptions
Same as the IOW command.
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.
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]
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 Intel’s 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, traf-
fic 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 indem-
nify Nuvoton for any damages resulting from such improper use or sales.
Taipei Office Winbond Electronics Corporation Japan Nuvoton Technology (H.K.) Ltd.
9F, No.480, Rueiguang Rd., NO. 2 Ueno-Bldg., 7-18, 3-chome Unit 9-15, 22F, Millennium City 2,
Neihu District, Taipei, 114, Shinyokohama Kohoku-ku, 378 Kwun Tong Rd.,
Taiwan, R.O.C. Yokohama, 222-0033 Kowloon, Hong Kong
TEL: 886-2-2658-8066 TEL: 81-45-4781881 TEL: 852-27513100
FAX: 886-2-8751-3579 FAX: 81-45-4781800 FAX: 852-27552064
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