blob: a4eee499dd385b805ff68fa9dd4ac794667b2993 [file] [log] [blame]
Uwe Hermann2dc5f422006-11-20 20:32:35 +00001-------------------------------------------------------------------------------
2Flashrom README
3-------------------------------------------------------------------------------
Ronald G. Minnich1e5003f2002-04-10 18:02:07 +00004
Uwe Hermanne74b9f82009-04-10 14:41:29 +00005Flashrom is a utility for reading, writing, and erasing flash ROM chips.
6It's often used to flash BIOS/coreboot/firmware images.
7
8It supports a wide range of DIP32, PLCC32, DIP8, and TSOP chips, which use
9various protocols such as LPC, FWH, parallel flash, or SPI.
Uwe Hermann42eb17f2008-01-18 17:48:51 +000010
11(see http://coreboot.org for details on coreboot)
12
Uwe Hermann2dc5f422006-11-20 20:32:35 +000013
14Build Requirements
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000015------------------
16
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000017To build the flashrom utility you need to install the following packages:
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000018
19* pciutils
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000020* pciutils-devel / pciutils-dev / libpci-dev
Uwe Hermann83f0db22006-12-20 14:53:22 +000021* zlib-devel / zlib1g-dev
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000022
23
Uwe Hermann2dc5f422006-11-20 20:32:35 +000024Usage
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000025-----
26
Idwer Vollering4cf3eef2009-01-11 03:31:02 +000027 $ flashrom [-rwvEVfLhR] [-c chipname] [-s exclude_start] [-e exclude_end]
Peter Stuge6b53fed2008-01-27 16:21:21 +000028 [-m [vendor:]part] [-l file.layout] [-i imagename] [file]
29 -r | --read: read flash and save into file
30 -w | --write: write file into flash (default when
31 file is specified)
32 -v | --verify: verify flash against file
33 -E | --erase: erase flash device
34 -V | --verbose: more verbose output
35 -c | --chip <chipname>: probe only for specified flash chip
36 -s | --estart <addr>: exclude start position
37 -e | --eend <addr>: exclude end postion
38 -m | --mainboard <[vendor:]part>: override mainboard settings
39 -f | --force: force write without checking image
40 -l | --layout <file.layout>: read rom layout from file
41 -i | --image <name>: only flash image name from flash layout
Idwer Vollering4cf3eef2009-01-11 03:31:02 +000042 -L | --list-supported: print supported devices
43 -h | --help: print this help text
44 -R | --version: print the version (release)
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000045
Ollie Lho184a4042005-11-26 21:55:36 +000046 If no file is specified, then all that happens
47 is that flash info is dumped and the flash chip is set to writable.
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000048
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000049
Peter Stuge42688e52009-01-26 02:20:56 +000050Exit status
51-----------
Uwe Hermanne74b9f82009-04-10 14:41:29 +000052
53Flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
Peter Stuge42688e52009-01-26 02:20:56 +000054(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
55
56
Stefan Reinauere3f3e2e2008-01-18 15:33:10 +000057coreboot Table and Mainboard Identification
Ollie Lho184a4042005-11-26 21:55:36 +000058--------------------------------------------
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000059
Uwe Hermanne74b9f82009-04-10 14:41:29 +000060Flashrom reads the coreboot table to determine the current mainboard. If no
61coreboot table could be read or if you want to override these values, you can
62specify -m, e.g.:
Ollie Lho184a4042005-11-26 21:55:36 +000063
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000064 $ flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000065
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000066See the 'Supported mainboards' section in the output of 'flashrom -L' for
67a list of boards which require the specification of the board name, if no
68coreboot table is found.
Uwe Hermann67808fe2007-10-18 00:29:05 +000069
Ollie Lho184a4042005-11-26 21:55:36 +000070
Uwe Hermann2dc5f422006-11-20 20:32:35 +000071ROM Layout Support
Ollie Lho184a4042005-11-26 21:55:36 +000072------------------
73
Uwe Hermann42eb17f2008-01-18 17:48:51 +000074Flashrom supports ROM layouts. This allows you to flash certain parts of
Uwe Hermann2dc5f422006-11-20 20:32:35 +000075the flash chip only. A ROM layout file looks like follows:
Ollie Lho184a4042005-11-26 21:55:36 +000076
77 00000000:00008fff gfxrom
78 00009000:0003ffff normal
79 00040000:0007ffff fallback
80
81 i.e.:
82 startaddr:endaddr name
83
Uwe Hermann67808fe2007-10-18 00:29:05 +000084 All addresses are offsets within the file, not absolute addresses!
Ollie Lho184a4042005-11-26 21:55:36 +000085
Uwe Hermann2dc5f422006-11-20 20:32:35 +000086If you only want to update the normal image in a ROM you can say:
Ollie Lho184a4042005-11-26 21:55:36 +000087
Uwe Hermann67808fe2007-10-18 00:29:05 +000088 flashrom -w --layout rom.layout --image normal agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000089
Uwe Hermann2dc5f422006-11-20 20:32:35 +000090To update normal and fallback but leave the VGA BIOS alone, say:
Ollie Lho184a4042005-11-26 21:55:36 +000091
Uwe Hermann67808fe2007-10-18 00:29:05 +000092 flashrom -w -l rom.layout -i normal -i fallback agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000093
Uwe Hermann2dc5f422006-11-20 20:32:35 +000094Currently overlapping sections are not supported.
Ollie Lho184a4042005-11-26 21:55:36 +000095
Uwe Hermann2dc5f422006-11-20 20:32:35 +000096ROM layouts should replace the -s and -e option since they are more
97flexible and they should lead to a ROM update file format with the
Uwe Hermann67808fe2007-10-18 00:29:05 +000098ROM layout and the ROM image in one file (cpio, zip or something?).
Ollie Lho184a4042005-11-26 21:55:36 +000099
100
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000101Supported Flash Chips / Chipsets / Mainboards
102---------------------------------------------
Uwe Hermannb6d28322006-12-04 08:15:47 +0000103
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000104Please check the output of 'flashrom -L' for the list of supported
105flash chips, chipsets/southbridges, and mainboards.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000106
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000107See also http://coreboot.org/Flashrom for more details.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000108