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 | |
Stefan Tauner | 23e10b8 | 2016-01-23 16:16:49 +0000 | [diff] [blame] | 11 | It supports a wide range of flash chips (most commonly found in SOIC8, DIP8, |
| 12 | SOIC16, WSON8, PLCC32, DIP32, TSOP32, and TSOP40 packages), which use various |
| 13 | protocols such as LPC, FWH, parallel flash, or SPI. |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 14 | |
Stefan Tauner | 23e10b8 | 2016-01-23 16:16:49 +0000 | [diff] [blame] | 15 | Do not use flashrom on laptops (yet)! The embedded controller (EC) present in |
| 16 | many laptops might interact badly with any attempts to communicate with the |
| 17 | flash chip and may brick your laptop. |
Carl-Daniel Hailfinger | 2702376 | 2010-04-28 15:22:14 +0000 | [diff] [blame] | 18 | |
| 19 | Please make a backup of your flash chip before writing to it. |
| 20 | |
Stefan Reinauer | 009c51b | 2010-01-03 23:50:28 +0000 | [diff] [blame] | 21 | Please see the flashrom(8) manpage. |
| 22 | |
Uwe Hermann | 2dc5f42 | 2006-11-20 20:32:35 +0000 | [diff] [blame] | 23 | |
Carl-Daniel Hailfinger | a23041c | 2009-06-12 14:49:10 +0000 | [diff] [blame] | 24 | Packaging |
| 25 | --------- |
| 26 | |
| 27 | To package flashrom and remove dependencies on subversion, either use |
| 28 | make export |
| 29 | or |
| 30 | make tarball |
| 31 | |
| 32 | make export will export all flashrom files from the subversion repository at |
| 33 | revision BASE into a directory named $EXPORTDIR/flashrom-$VERSION-r$SVNREVISION |
| 34 | and will additionally modify the Makefile in that directory to contain the svn |
| 35 | revision of the exported tree. |
| 36 | |
| 37 | make tarball will simply tar up the result of make export and gzip compress it. |
| 38 | |
| 39 | The snapshot tarballs are the result of make tarball and require no further |
| 40 | processing. |
| 41 | |
| 42 | |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 43 | Build Instructions |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 44 | ------------------ |
| 45 | |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 46 | To build flashrom you need to install the following software: |
| 47 | |
| 48 | * pciutils+libpci (if you want support for mainboard or PCI device flashing) |
James Laird | c60de0e | 2013-03-27 13:00:23 +0000 | [diff] [blame] | 49 | * libusb (if you want FT2232, Dediprog or USB-Blaster support) |
| 50 | * libftdi (if you want FT2232 or USB-Blaster support) |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 51 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 52 | Linux et al: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 53 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 54 | * pciutils / libpci |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 55 | * pciutils-devel / pciutils-dev / libpci-dev |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 56 | * zlib-devel / zlib1g-dev (needed if libpci was compiled with libz support) |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 57 | |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 58 | On FreeBSD, you need the following ports: |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 59 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 60 | * devel/gmake |
| 61 | * devel/libpci |
Idwer Vollering | 5e410de | 2009-05-03 23:33:05 +0000 | [diff] [blame] | 62 | |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 63 | On OpenBSD, you need the following ports: |
| 64 | |
| 65 | * devel/gmake |
| 66 | * sysutils/pciutils |
| 67 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 68 | To compile on Linux, use: |
Carl-Daniel Hailfinger | 9abf529 | 2009-05-01 16:34:32 +0000 | [diff] [blame] | 69 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 70 | make |
| 71 | |
Stefan Tauner | 8d21ff1 | 2015-01-10 09:33:06 +0000 | [diff] [blame] | 72 | To compile on FreeBSD, OpenBSD or DragonFly BSD, use: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 73 | |
| 74 | gmake |
| 75 | |
Carl-Daniel Hailfinger | 10572fa | 2009-08-17 16:30:53 +0000 | [diff] [blame] | 76 | To compile on Nexenta, use: |
| 77 | |
| 78 | make |
| 79 | |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 80 | To compile on Solaris, use: |
| 81 | |
Carl-Daniel Hailfinger | 10572fa | 2009-08-17 16:30:53 +0000 | [diff] [blame] | 82 | gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2 |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 83 | |
Stefan Tauner | 8d21ff1 | 2015-01-10 09:33:06 +0000 | [diff] [blame] | 84 | To compile on NetBSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use: |
Carl-Daniel Hailfinger | b63b067 | 2010-07-02 17:12:50 +0000 | [diff] [blame] | 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 | |
Carl-Daniel Hailfinger | f992c19 | 2010-10-06 23:16:10 +0000 | [diff] [blame] | 90 | Install DirectHW from coresystems GmbH. |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 91 | DirectHW is available at http://www.coreboot.org/DirectHW . |
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 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 95 | Get packages of the DJGPP cross compiler and install them: |
| 96 | djgpp-filesystem djgpp-gcc djgpp-cpp djgpp-runtime djgpp-binutils |
| 97 | As an alternative, the DJGPP web site offers packages for download as well: |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 98 | djcross-binutils-2.19.1-10ap.i386.rpm |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 99 | djcross-gcc-4.3.2-8ap.i686.rpm |
Idwer Vollering | 9c31b50 | 2010-10-05 13:31:12 +0000 | [diff] [blame] | 100 | djcrx-2.04pre_20090725-13ap.i386.rpm |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 101 | The cross toolchain packages for your distribution may have slightly different |
| 102 | names (look for packages named *djgpp*). |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 103 | |
| 104 | You will need the following library source trees containing their compiled |
| 105 | static libraries either in the parent directory of the flashrom source or |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 106 | specify the base folder on compile time with the LIBS_BASE parameter. |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 107 | The default as described above is equal to calling |
Stefan Tauner | be62d3f | 2015-01-10 09:32:44 +0000 | [diff] [blame] | 108 | 'make djgpp-dos LIBS_BASE=..' |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 109 | |
| 110 | To get and build said libraries... |
| 111 | Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 112 | Compile pciutils, see README.DJGPP for instructions. |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 113 | Download and compile http://flashrom.org/File:Libgetopt.tar.gz |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 114 | Enter the flashrom directory. |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 115 | Run either (change settings where appropriate) |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 116 | make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip |
Carl-Daniel Hailfinger | 50415d2 | 2010-03-21 14:54:57 +0000 | [diff] [blame] | 117 | or (above settings hardcoded) |
| 118 | make djgpp-dos |
Stefan Tauner | 449abe2 | 2013-09-11 23:34:57 +0000 | [diff] [blame] | 119 | To run flashrom.exe, download http://flashrom.org/File:Csdpmi7b.zip and |
| 120 | unpack CWSDPMI.EXE into the current directory or one in PATH. |
Stefan Reinauer | 06b2c4d | 2005-12-01 10:51:08 +0000 | [diff] [blame] | 121 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 122 | To cross-compile on Linux for Windows: |
| 123 | |
| 124 | Get packages of the MinGW cross compiler and install them: |
| 125 | mingw32-filesystem mingw32-cross-cpp mingw32-cross-binutils mingw32-cross-gcc |
| 126 | mingw32-runtime mingw32-headers |
| 127 | The cross toolchain packages for your distribution may have slightly different |
| 128 | names (look for packages named *mingw*). |
| 129 | PCI-based programmers (internal etc.) are not supported on Windows. |
| 130 | Run (change CC= and STRIP= settings where appropriate) |
| 131 | make CC=i686-w64-mingw32-gcc STRIP=i686-w64-mingw32-strip |
| 132 | |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 133 | Processor architecture dependent features: |
| 134 | |
Carl-Daniel Hailfinger | 60d9bd2 | 2012-08-09 23:34:41 +0000 | [diff] [blame] | 135 | On non-x86 architectures a few programmers don't work (yet) because they |
| 136 | use port-based I/O which is not directly available on non-x86. Those |
| 137 | programmers will be disabled automatically if you run "make". |
Carl-Daniel Hailfinger | 9e3a6c4 | 2010-10-08 12:40:09 +0000 | [diff] [blame] | 138 | |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 139 | Installation |
| 140 | ------------ |
| 141 | |
| 142 | In order to install flashrom and the manpage into /usr/local, type: |
| 143 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 144 | make install |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 145 | |
| 146 | For installation in a different directory use DESTDIR, e.g. like this: |
| 147 | |
Carl-Daniel Hailfinger | a472b8b | 2009-10-03 17:08:02 +0000 | [diff] [blame] | 148 | make DESTDIR=/usr install |
| 149 | |
| 150 | If you have insufficient permissions for the destination directory, use sudo |
| 151 | by adding sudo in front of the commands above. |
Uwe Hermann | d1129ac | 2009-05-28 15:07:42 +0000 | [diff] [blame] | 152 | |
| 153 | |
Joerg Mayer | 7221d5f | 2009-08-24 13:24:52 +0000 | [diff] [blame] | 154 | Contact |
Uwe Hermann | e94dbf2 | 2009-05-22 13:18:38 +0000 | [diff] [blame] | 155 | ------- |
| 156 | |
| 157 | The official flashrom website is: |
| 158 | |
Stefan Reinauer | 22ea8cd | 2009-07-30 13:32:26 +0000 | [diff] [blame] | 159 | http://www.flashrom.org/ |
Uwe Hermann | b6d2832 | 2006-12-04 08:15:47 +0000 | [diff] [blame] | 160 | |
Joerg Mayer | 7221d5f | 2009-08-24 13:24:52 +0000 | [diff] [blame] | 161 | The IRC channel is |
| 162 | |
| 163 | #flashrom at irc.freenode.net |
| 164 | |
Uwe Hermann | 4e3d0b3 | 2010-03-25 23:18:41 +0000 | [diff] [blame] | 165 | The mailing list address is |
Joerg Mayer | 7221d5f | 2009-08-24 13:24:52 +0000 | [diff] [blame] | 166 | |
| 167 | flashrom@flashrom.org |