Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 1 | ------------------------------------------------------------------------------- |
Peter Stuge | 44dd304 | 2009-04-20 12:34:30 +0000 | [diff] [blame] | 2 | flashrom README |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 3 | ------------------------------------------------------------------------------- |
Ronald G. Minnich | 1e5003f | 2002-04-10 18:02:07 +0000 | [diff] [blame] | 4 | |
Peter Stuge | 261cafa | 2009-05-01 14:52:50 +0000 | [diff] [blame] | 5 | flashrom is a utility for reading, writing, verifying and erasing flash ROM |
| 6 | chips. It's often used to flash BIOS/coreboot/firmware images. |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 7 | |
Uwe Hermann | d42009c | 2009-04-11 13:59:00 +0000 | [diff] [blame] | 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. |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 11 | |
| 12 | (see http://coreboot.org for details on coreboot) |
| 13 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 14 | |
| 15 | Build Requirements |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 16 | ------------------ |
| 17 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame^] | 18 | To build the flashrom utility you need to install the following packages or |
| 19 | ports: |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 20 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame^] | 21 | Linux et al: |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 22 | * pciutils |
Uwe Hermann | f8a49fe | 2008-06-22 18:50:25 +0000 | [diff] [blame] | 23 | * pciutils-devel / pciutils-dev / libpci-dev |
Uwe Hermann | 83f0db2 | 2006-12-20 14:53:22 +0000 | [diff] [blame] | 24 | * zlib-devel / zlib1g-dev |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 25 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame^] | 26 | On FreeBSD, you need the following ports: |
| 27 | * devel/gmake |
| 28 | * devel/libpci |
| 29 | |
| 30 | To compile on FreeBSD, use the command below: |
| 31 | gmake |
| 32 | |
Carl-Daniel Hailfinger | 9abf529 | 2009-05-01 16:34:32 +0000 | [diff] [blame] | 33 | To compile on Solaris, use the commands below: |
| 34 | gmake LDFLAGS="-L$pathtolibpci -lpci -lz" CC="gcc -I$pathtopciheaders" CFLAGS=-O2 |
| 35 | |
| 36 | To compile on DragonFly BSD, use the commands below: |
| 37 | ln -s /usr/pkg/include/pciutils pci |
| 38 | gmake CFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -lpci -lz" |
| 39 | |
| 40 | To compile and run on Darwin/Mac OS X: |
| 41 | Install DirectIO from coresystems GmbH. |
| 42 | DirectIO is available at http://www.coresystems.de/en/directio |
| 43 | |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 44 | |
Uwe Hermann | 3d5f96c | 2009-04-23 14:57:55 +0000 | [diff] [blame] | 45 | Usage / Options |
| 46 | --------------- |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 47 | |
Uwe Hermann | 3d5f96c | 2009-04-23 14:57:55 +0000 | [diff] [blame] | 48 | Please see the flashrom(8) manpage. |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 49 | |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 50 | |
Peter Stuge | 42688e5 | 2009-01-26 02:20:56 +0000 | [diff] [blame] | 51 | Exit status |
| 52 | ----------- |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 53 | |
Peter Stuge | 44dd304 | 2009-04-20 12:34:30 +0000 | [diff] [blame] | 54 | flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem |
Peter Stuge | 42688e5 | 2009-01-26 02:20:56 +0000 | [diff] [blame] | 55 | (/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails. |
| 56 | |
| 57 | |
Stefan Reinauer | e3f3e2e | 2008-01-18 15:33:10 +0000 | [diff] [blame] | 58 | coreboot Table and Mainboard Identification |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 59 | -------------------------------------------- |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 60 | |
Peter Stuge | 44dd304 | 2009-04-20 12:34:30 +0000 | [diff] [blame] | 61 | flashrom reads the coreboot table to determine the current mainboard. If no |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 62 | coreboot table could be read or if you want to override these values, you can |
| 63 | specify -m, e.g.: |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 64 | |
Uwe Hermann | f8a49fe | 2008-06-22 18:50:25 +0000 | [diff] [blame] | 65 | $ flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 66 | |
Uwe Hermann | f8a49fe | 2008-06-22 18:50:25 +0000 | [diff] [blame] | 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. |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 70 | |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 71 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 72 | ROM Layout Support |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 73 | ------------------ |
| 74 | |
Peter Stuge | 44dd304 | 2009-04-20 12:34:30 +0000 | [diff] [blame] | 75 | flashrom supports ROM layouts. This allows you to flash certain parts of |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 76 | the flash chip only. A ROM layout file looks like follows: |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 77 | |
| 78 | 00000000:00008fff gfxrom |
| 79 | 00009000:0003ffff normal |
| 80 | 00040000:0007ffff fallback |
| 81 | |
| 82 | i.e.: |
| 83 | startaddr:endaddr name |
| 84 | |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 85 | All addresses are offsets within the file, not absolute addresses! |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 86 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 87 | If you only want to update the normal image in a ROM you can say: |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 88 | |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 89 | flashrom -w --layout rom.layout --image normal agami_aruma.rom |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 90 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 91 | To update normal and fallback but leave the VGA BIOS alone, say: |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 92 | |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 93 | flashrom -w -l rom.layout -i normal -i fallback agami_aruma.rom |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 94 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 95 | Currently overlapping sections are not supported. |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 96 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 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 |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 99 | ROM layout and the ROM image in one file (cpio, zip or something?). |
Ollie Lho | 184a404 | 2005-11-26 21:55:36 +0000 | [diff] [blame] | 100 | |
| 101 | |
Uwe Hermann | f8a49fe | 2008-06-22 18:50:25 +0000 | [diff] [blame] | 102 | Supported Flash Chips / Chipsets / Mainboards |
| 103 | --------------------------------------------- |
Uwe Hermann | b6d2832 | 2006-12-04 08:15:47 +0000 | [diff] [blame] | 104 | |
Uwe Hermann | f8a49fe | 2008-06-22 18:50:25 +0000 | [diff] [blame] | 105 | Please check the output of 'flashrom -L' for the list of supported |
| 106 | flash chips, chipsets/southbridges, and mainboards. |
Uwe Hermann | b6d2832 | 2006-12-04 08:15:47 +0000 | [diff] [blame] | 107 | |
Uwe Hermann | f8a49fe | 2008-06-22 18:50:25 +0000 | [diff] [blame] | 108 | See also http://coreboot.org/Flashrom for more details. |
Uwe Hermann | b6d2832 | 2006-12-04 08:15:47 +0000 | [diff] [blame] | 109 | |