blob: b9a253a4f48ebfc9c94ff900032ac42cce1f191f [file] [log] [blame]
Uwe Hermann2dc5f422006-11-20 20:32:35 +00001-------------------------------------------------------------------------------
Peter Stuge44dd3042009-04-20 12:34:30 +00002flashrom README
Uwe Hermann2dc5f422006-11-20 20:32:35 +00003-------------------------------------------------------------------------------
Ronald G. Minnich1e5003f2002-04-10 18:02:07 +00004
Peter Stuge261cafa2009-05-01 14:52:50 +00005flashrom is a utility for reading, writing, verifying and erasing flash ROM
6chips. It's often used to flash BIOS/coreboot/firmware images.
Uwe Hermanne74b9f82009-04-10 14:41:29 +00007
Uwe Hermannd42009c2009-04-11 13:59:00 +00008It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and
9TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
10or SPI.
Uwe Hermann42eb17f2008-01-18 17:48:51 +000011
12(see http://coreboot.org for details on coreboot)
13
Uwe Hermann2dc5f422006-11-20 20:32:35 +000014
15Build Requirements
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000016------------------
17
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000018To build the flashrom utility you need to install the following packages:
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000019
20* pciutils
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000021* pciutils-devel / pciutils-dev / libpci-dev
Uwe Hermann83f0db22006-12-20 14:53:22 +000022* zlib-devel / zlib1g-dev
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000023
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000024To compile on Solaris, use the commands below:
25gmake LDFLAGS="-L$pathtolibpci -lpci -lz" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
26
27To compile on DragonFly BSD, use the commands below:
28ln -s /usr/pkg/include/pciutils pci
29gmake CFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -lpci -lz"
30
31To compile and run on Darwin/Mac OS X:
32Install DirectIO from coresystems GmbH.
33DirectIO is available at http://www.coresystems.de/en/directio
34
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000035
Uwe Hermann3d5f96c2009-04-23 14:57:55 +000036Usage / Options
37---------------
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000038
Uwe Hermann3d5f96c2009-04-23 14:57:55 +000039Please see the flashrom(8) manpage.
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000040
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000041
Peter Stuge42688e52009-01-26 02:20:56 +000042Exit status
43-----------
Uwe Hermanne74b9f82009-04-10 14:41:29 +000044
Peter Stuge44dd3042009-04-20 12:34:30 +000045flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
Peter Stuge42688e52009-01-26 02:20:56 +000046(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
47
48
Stefan Reinauere3f3e2e2008-01-18 15:33:10 +000049coreboot Table and Mainboard Identification
Ollie Lho184a4042005-11-26 21:55:36 +000050--------------------------------------------
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000051
Peter Stuge44dd3042009-04-20 12:34:30 +000052flashrom reads the coreboot table to determine the current mainboard. If no
Uwe Hermanne74b9f82009-04-10 14:41:29 +000053coreboot table could be read or if you want to override these values, you can
54specify -m, e.g.:
Ollie Lho184a4042005-11-26 21:55:36 +000055
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000056 $ flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000057
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000058See the 'Supported mainboards' section in the output of 'flashrom -L' for
59a list of boards which require the specification of the board name, if no
60coreboot table is found.
Uwe Hermann67808fe2007-10-18 00:29:05 +000061
Ollie Lho184a4042005-11-26 21:55:36 +000062
Uwe Hermann2dc5f422006-11-20 20:32:35 +000063ROM Layout Support
Ollie Lho184a4042005-11-26 21:55:36 +000064------------------
65
Peter Stuge44dd3042009-04-20 12:34:30 +000066flashrom supports ROM layouts. This allows you to flash certain parts of
Uwe Hermann2dc5f422006-11-20 20:32:35 +000067the flash chip only. A ROM layout file looks like follows:
Ollie Lho184a4042005-11-26 21:55:36 +000068
69 00000000:00008fff gfxrom
70 00009000:0003ffff normal
71 00040000:0007ffff fallback
72
73 i.e.:
74 startaddr:endaddr name
75
Uwe Hermann67808fe2007-10-18 00:29:05 +000076 All addresses are offsets within the file, not absolute addresses!
Ollie Lho184a4042005-11-26 21:55:36 +000077
Uwe Hermann2dc5f422006-11-20 20:32:35 +000078If you only want to update the normal image in a ROM you can say:
Ollie Lho184a4042005-11-26 21:55:36 +000079
Uwe Hermann67808fe2007-10-18 00:29:05 +000080 flashrom -w --layout rom.layout --image normal agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000081
Uwe Hermann2dc5f422006-11-20 20:32:35 +000082To update normal and fallback but leave the VGA BIOS alone, say:
Ollie Lho184a4042005-11-26 21:55:36 +000083
Uwe Hermann67808fe2007-10-18 00:29:05 +000084 flashrom -w -l rom.layout -i normal -i fallback agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000085
Uwe Hermann2dc5f422006-11-20 20:32:35 +000086Currently overlapping sections are not supported.
Ollie Lho184a4042005-11-26 21:55:36 +000087
Uwe Hermann2dc5f422006-11-20 20:32:35 +000088ROM layouts should replace the -s and -e option since they are more
89flexible and they should lead to a ROM update file format with the
Uwe Hermann67808fe2007-10-18 00:29:05 +000090ROM layout and the ROM image in one file (cpio, zip or something?).
Ollie Lho184a4042005-11-26 21:55:36 +000091
92
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000093Supported Flash Chips / Chipsets / Mainboards
94---------------------------------------------
Uwe Hermannb6d28322006-12-04 08:15:47 +000095
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000096Please check the output of 'flashrom -L' for the list of supported
97flash chips, chipsets/southbridges, and mainboards.
Uwe Hermannb6d28322006-12-04 08:15:47 +000098
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000099See also http://coreboot.org/Flashrom for more details.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000100