blob: 95397b20405498ff1847a719ab717cf4d694c62b [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
Idwer Vollering5e410de2009-05-03 23:33:05 +000018To build the flashrom utility you need to install the following packages or
19ports:
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000020
Idwer Vollering5e410de2009-05-03 23:33:05 +000021Linux et al:
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000022* pciutils
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000023* pciutils-devel / pciutils-dev / libpci-dev
Uwe Hermann83f0db22006-12-20 14:53:22 +000024* zlib-devel / zlib1g-dev
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000025
Idwer Vollering5e410de2009-05-03 23:33:05 +000026On FreeBSD, you need the following ports:
27* devel/gmake
28* devel/libpci
29
30To compile on FreeBSD, use the command below:
31gmake
32
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000033To compile on Solaris, use the commands below:
34gmake LDFLAGS="-L$pathtolibpci -lpci -lz" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
35
36To compile on DragonFly BSD, use the commands below:
37ln -s /usr/pkg/include/pciutils pci
38gmake CFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -lpci -lz"
39
40To compile and run on Darwin/Mac OS X:
41Install DirectIO from coresystems GmbH.
42DirectIO is available at http://www.coresystems.de/en/directio
43
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000044
Uwe Hermann3d5f96c2009-04-23 14:57:55 +000045Usage / Options
46---------------
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000047
Uwe Hermann3d5f96c2009-04-23 14:57:55 +000048Please see the flashrom(8) manpage.
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000049
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000050
Peter Stuge42688e52009-01-26 02:20:56 +000051Exit status
52-----------
Uwe Hermanne74b9f82009-04-10 14:41:29 +000053
Peter Stuge44dd3042009-04-20 12:34:30 +000054flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
Peter Stuge42688e52009-01-26 02:20:56 +000055(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
56
57
Stefan Reinauere3f3e2e2008-01-18 15:33:10 +000058coreboot Table and Mainboard Identification
Ollie Lho184a4042005-11-26 21:55:36 +000059--------------------------------------------
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000060
Peter Stuge44dd3042009-04-20 12:34:30 +000061flashrom reads the coreboot table to determine the current mainboard. If no
Uwe Hermanne74b9f82009-04-10 14:41:29 +000062coreboot table could be read or if you want to override these values, you can
63specify -m, e.g.:
Ollie Lho184a4042005-11-26 21:55:36 +000064
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000065 $ flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000066
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000067See the 'Supported mainboards' section in the output of 'flashrom -L' for
68a list of boards which require the specification of the board name, if no
69coreboot table is found.
Uwe Hermann67808fe2007-10-18 00:29:05 +000070
Ollie Lho184a4042005-11-26 21:55:36 +000071
Uwe Hermann2dc5f422006-11-20 20:32:35 +000072ROM Layout Support
Ollie Lho184a4042005-11-26 21:55:36 +000073------------------
74
Peter Stuge44dd3042009-04-20 12:34:30 +000075flashrom supports ROM layouts. This allows you to flash certain parts of
Uwe Hermann2dc5f422006-11-20 20:32:35 +000076the flash chip only. A ROM layout file looks like follows:
Ollie Lho184a4042005-11-26 21:55:36 +000077
78 00000000:00008fff gfxrom
79 00009000:0003ffff normal
80 00040000:0007ffff fallback
81
82 i.e.:
83 startaddr:endaddr name
84
Uwe Hermann67808fe2007-10-18 00:29:05 +000085 All addresses are offsets within the file, not absolute addresses!
Ollie Lho184a4042005-11-26 21:55:36 +000086
Uwe Hermann2dc5f422006-11-20 20:32:35 +000087If you only want to update the normal image in a ROM you can say:
Ollie Lho184a4042005-11-26 21:55:36 +000088
Uwe Hermann67808fe2007-10-18 00:29:05 +000089 flashrom -w --layout rom.layout --image normal agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000090
Uwe Hermann2dc5f422006-11-20 20:32:35 +000091To update normal and fallback but leave the VGA BIOS alone, say:
Ollie Lho184a4042005-11-26 21:55:36 +000092
Uwe Hermann67808fe2007-10-18 00:29:05 +000093 flashrom -w -l rom.layout -i normal -i fallback agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000094
Uwe Hermann2dc5f422006-11-20 20:32:35 +000095Currently overlapping sections are not supported.
Ollie Lho184a4042005-11-26 21:55:36 +000096
Uwe Hermann2dc5f422006-11-20 20:32:35 +000097ROM layouts should replace the -s and -e option since they are more
98flexible and they should lead to a ROM update file format with the
Uwe Hermann67808fe2007-10-18 00:29:05 +000099ROM layout and the ROM image in one file (cpio, zip or something?).
Ollie Lho184a4042005-11-26 21:55:36 +0000100
101
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000102Supported Flash Chips / Chipsets / Mainboards
103---------------------------------------------
Uwe Hermannb6d28322006-12-04 08:15:47 +0000104
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000105Please check the output of 'flashrom -L' for the list of supported
106flash chips, chipsets/southbridges, and mainboards.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000107
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000108See also http://coreboot.org/Flashrom for more details.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000109