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 | |
Carl-Daniel Hailfinger | 1ebf845 | 2009-08-18 23:50:14 +0000 | [diff] [blame] | 5 | flashrom is a utility for detecting, reading, writing, verifying and erasing |
| 6 | flash chips. It is often used to flash BIOS/EFI/coreboot/firmware images |
| 7 | in-system using a supported mainboard, but it also supports flashing of network |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 8 | cards (NICs), SATA controller cards, and other external devices which can |
| 9 | program flash chips. |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 10 | |
Carl-Daniel Hailfinger | 1ebf845 | 2009-08-18 23:50:14 +0000 | [diff] [blame] | 11 | It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and TSOP40 |
| 12 | chips, which use various protocols such as LPC, FWH, parallel flash, or SPI. |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 13 | |
Carl-Daniel Hailfinger | 2702376 | 2010-04-28 15:22:14 +0000 | [diff] [blame] | 14 | Do not use flashrom on laptops! The embedded controller (EC) present in many |
| 15 | laptops interacts badly with any flash attempts and can brick your laptop |
| 16 | permanently. |
| 17 | |
| 18 | Please make a backup of your flash chip before writing to it. |
| 19 | |
Stefan Reinauer | 009c51b | 2010-01-03 23:50:28 +0000 | [diff] [blame] | 20 | Please see the flashrom(8) manpage. |
| 21 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 22 | |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 23 | Packaging |
| 24 | --------- |
| 25 | |
| 26 | To package flashrom and remove dependencies on subversion, either use |
| 27 | make export |
| 28 | or |
| 29 | make tarball |
| 30 | |
| 31 | make export will export all flashrom files from the subversion repository at |
| 32 | revision BASE into a directory named $EXPORTDIR/flashrom-$VERSION-r$SVNREVISION |
| 33 | and will additionally modify the Makefile in that directory to contain the svn |
| 34 | revision of the exported tree. |
| 35 | |
| 36 | make tarball will simply tar up the result of make export and gzip compress it. |
| 37 | |
| 38 | The snapshot tarballs are the result of make tarball and require no further |
| 39 | processing. |
| 40 | |
| 41 | |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 42 | Build Instructions |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 43 | ------------------ |
| 44 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 45 | To build flashrom you need to install the following packages or ports: |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 46 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 47 | Linux et al: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 48 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 49 | * pciutils / libpci |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 50 | * pciutils-devel / pciutils-dev / libpci-dev |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 51 | * zlib-devel / zlib1g-dev (needed if libpci was compiled with libz support) |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 52 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 53 | On FreeBSD, you need the following ports: |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 54 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 55 | * devel/gmake |
| 56 | * devel/libpci |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 57 | |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 58 | On OpenBSD, you need the following ports: |
| 59 | |
| 60 | * devel/gmake |
| 61 | * sysutils/pciutils |
| 62 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 63 | To compile on Linux, use: |
Carl-Daniel Hailfinger | 9abf529 | 2009-05-01 16:34:32 +0000 | [diff] [blame] | 64 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 65 | make |
| 66 | |
| 67 | To compile on FreeBSD, use: |
| 68 | |
| 69 | gmake |
| 70 | |
Carl-Daniel Hailfinger | 10572fa | 2009-08-17 16:30:53 +0000 | [diff] [blame] | 71 | To compile on Nexenta, use: |
| 72 | |
| 73 | make |
| 74 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 75 | To compile on Solaris, use: |
| 76 | |
Carl-Daniel Hailfinger | 10572fa | 2009-08-17 16:30:53 +0000 | [diff] [blame] | 77 | gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2 |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 78 | |
Jonathan A. Kollasch | 3646c8f | 2010-01-08 21:18:08 +0000 | [diff] [blame] | 79 | To compile on NetBSD or DragonFly BSD, use: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 80 | |
| 81 | ln -s /usr/pkg/include/pciutils pci |
Jonathan A. Kollasch | d8dfc44 | 2010-02-16 00:49:50 +0000 | [diff] [blame] | 82 | gmake CPPFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib" |
Carl-Daniel Hailfinger | 9abf529 | 2009-05-01 16:34:32 +0000 | [diff] [blame] | 83 | |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 84 | To compile on OpenBSD, use: |
| 85 | |
| 86 | gmake |
| 87 | |
Carl-Daniel Hailfinger | 9abf529 | 2009-05-01 16:34:32 +0000 | [diff] [blame] | 88 | To compile and run on Darwin/Mac OS X: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 89 | |
| 90 | Install DirectIO from coresystems GmbH. |
| 91 | DirectIO is available at http://www.coresystems.de/en/directio. |
Carl-Daniel Hailfinger | 9abf529 | 2009-05-01 16:34:32 +0000 | [diff] [blame] | 92 | |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 93 | To cross-compile on Linux for DOS: |
| 94 | |
| 95 | Get RPMs of the cross compiler from the DJGPP site and install them: |
| 96 | djcross-binutils-2.19.1-10ap.i386.rpm |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 97 | djcross-gcc-4.3.2-8ap.i686.rpm |
Idwer Vollering | 9c31b50 | 2010-10-05 13:31:12 +0000 | [diff] [blame] | 98 | djcrx-2.04pre_20090725-13ap.i386.rpm |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 99 | Download pciutils 3.1.5 and apply http://assembler.cz/flashrom/pciutils.patch |
| 100 | Download and compile http://assembler.cz/flashrom/libgetopt/ |
| 101 | Compile pciutils, see README.DJGPP for instructions. |
| 102 | Enter the flashrom directory. |
| 103 | ../libpci should contain pciutils source and binaries. |
| 104 | ../libgetopt should contain getopt.a from libgetopt. |
| 105 | Run either (change settings where appropriate) |
| 106 | make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip OS_ARCH=DOS |
| 107 | or (above settings hardcoded) |
| 108 | make djgpp-dos |
| 109 | You might have to add WARNERROR=no to the make command line. |
Idwer Vollering | 9c31b50 | 2010-10-05 13:31:12 +0000 | [diff] [blame] | 110 | To run flashrom.exe, download and unpack |
| 111 | http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi7b.zip and make sure |
| 112 | CWSDPMI.EXE is in the current directory. |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 113 | |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 114 | Installation |
| 115 | ------------ |
| 116 | |
| 117 | In order to install flashrom and the manpage into /usr/local, type: |
| 118 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 119 | make install |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 120 | |
| 121 | For installation in a different directory use DESTDIR, e.g. like this: |
| 122 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 123 | make DESTDIR=/usr install |
| 124 | |
| 125 | If you have insufficient permissions for the destination directory, use sudo |
| 126 | by adding sudo in front of the commands above. |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 127 | |
| 128 | |
Joerg Mayer | 7221d5f | 2009-08-24 13:24:52 +0000 | [diff] [blame] | 129 | Contact |
Uwe Hermann | e94dbf2 | 2009-05-22 13:18:38 +0000 | [diff] [blame] | 130 | ------- |
| 131 | |
| 132 | The official flashrom website is: |
| 133 | |
Stefan Reinauer | 22ea8cd | 2009-07-30 13:32:26 +0000 | [diff] [blame] | 134 | http://www.flashrom.org/ |
Uwe Hermann | b6d2832 | 2006-12-04 08:15:47 +0000 | [diff] [blame] | 135 | |
Joerg Mayer | 7221d5f | 2009-08-24 13:24:52 +0000 | [diff] [blame] | 136 | The IRC channel is |
| 137 | |
| 138 | #flashrom at irc.freenode.net |
| 139 | |
Uwe Hermann | 4e3d0b3 | 2010-03-25 23:18:41 +0000 | [diff] [blame] | 140 | The mailing list address is |
Joerg Mayer | 7221d5f | 2009-08-24 13:24:52 +0000 | [diff] [blame] | 141 | |
| 142 | flashrom@flashrom.org |