2d2687700699b281d3b81ccf894c1add73da02bf
[coreboot.git] / util / flashrom / README
1 -------------------------------------------------------------------------------
2 Flashrom README
3 -------------------------------------------------------------------------------
4
5 Flashrom is a utility for reading, writing, and erasing flash ROM chips.
6 It's often used to flash BIOS/coreboot/firmware images.
7
8 It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and
9 TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
10 or SPI.
11
12 (see http://coreboot.org for details on coreboot)
13
14
15 Build Requirements
16 ------------------
17
18 To build the flashrom utility you need to install the following packages:
19
20 * pciutils
21 * pciutils-devel / pciutils-dev / libpci-dev
22 * zlib-devel / zlib1g-dev
23
24
25 Usage
26 -----
27
28  $ flashrom [-rwvEVfLhR] [-c chipname] [-s exclude_start] [-e exclude_end]
29             [-m [vendor:]part] [-l file.layout] [-i imagename] [file]
30    -r | --read:                      read flash and save into file
31    -w | --write:                     write file into flash (default when
32                                      file is specified)
33    -v | --verify:                    verify flash against file
34    -E | --erase:                     erase flash device
35    -V | --verbose:                   more verbose output
36    -c | --chip <chipname>:           probe only for specified flash chip
37    -s | --estart <addr>:             exclude start position
38    -e | --eend <addr>:               exclude end postion
39    -m | --mainboard <[vendor:]part>: override mainboard settings
40    -f | --force:                     force write without checking image
41    -l | --layout <file.layout>:      read rom layout from file
42    -i | --image <name>:              only flash image name from flash layout
43    -L | --list-supported:            print supported devices
44    -h | --help:                      print this help text
45    -R | --version:                   print the version (release)
46
47  If no file is specified, then all that happens
48  is that flash info is dumped and the flash chip is set to writable.
49
50
51 Exit status
52 -----------
53
54 Flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
55 (/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
56
57
58 coreboot Table and Mainboard Identification
59 --------------------------------------------
60
61 Flashrom reads the coreboot table to determine the current mainboard. If no
62 coreboot table could be read or if you want to override these values, you can
63 specify -m, e.g.:
64
65  $ flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom
66
67 See the 'Supported mainboards' section in the output of 'flashrom -L' for
68 a list of boards which require the specification of the board name, if no
69 coreboot table is found.
70
71
72 ROM Layout Support
73 ------------------
74
75 Flashrom supports ROM layouts. This allows you to flash certain parts of
76 the flash chip only. A ROM layout file looks like follows:
77
78   00000000:00008fff gfxrom
79   00009000:0003ffff normal
80   00040000:0007ffff fallback
81
82   i.e.:
83   startaddr:endaddr name
84
85   All addresses are offsets within the file, not absolute addresses!
86   
87 If you only want to update the normal image in a ROM you can say:
88
89   flashrom -w --layout rom.layout --image normal agami_aruma.rom
90      
91 To update normal and fallback but leave the VGA BIOS alone, say:
92
93   flashrom -w -l rom.layout -i normal -i fallback agami_aruma.rom
94  
95 Currently overlapping sections are not supported.
96
97 ROM layouts should replace the -s and -e option since they are more 
98 flexible and they should lead to a ROM update file format with the 
99 ROM layout and the ROM image in one file (cpio, zip or something?).
100
101
102 Supported Flash Chips / Chipsets / Mainboards
103 ---------------------------------------------
104
105 Please check the output of 'flashrom -L' for the list of supported
106 flash chips, chipsets/southbridges, and mainboards.
107
108 See also http://coreboot.org/Flashrom for more details.
109