blob: 604e793dcea111ff0c055df14f4372dd7315cbae [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
Carl-Daniel Hailfinger1ebf8452009-08-18 23:50:14 +00005flashrom is a utility for detecting, reading, writing, verifying and erasing
6flash chips. It is often used to flash BIOS/EFI/coreboot/firmware images
7in-system using a supported mainboard, but it also supports flashing of network
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +00008cards (NICs), SATA controller cards, and other external devices which can
9program flash chips.
Uwe Hermanne74b9f82009-04-10 14:41:29 +000010
Stefan Tauner23e10b82016-01-23 16:16:49 +000011It supports a wide range of flash chips (most commonly found in SOIC8, DIP8,
12SOIC16, WSON8, PLCC32, DIP32, TSOP32, and TSOP40 packages), which use various
13protocols such as LPC, FWH, parallel flash, or SPI.
Uwe Hermann42eb17f2008-01-18 17:48:51 +000014
Stefan Tauner23e10b82016-01-23 16:16:49 +000015Do not use flashrom on laptops (yet)! The embedded controller (EC) present in
16many laptops might interact badly with any attempts to communicate with the
17flash chip and may brick your laptop.
Carl-Daniel Hailfinger27023762010-04-28 15:22:14 +000018
19Please make a backup of your flash chip before writing to it.
20
Stefan Reinauer009c51b2010-01-03 23:50:28 +000021Please see the flashrom(8) manpage.
22
Uwe Hermann2dc5f422006-11-20 20:32:35 +000023
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +000024Packaging
25---------
26
27To package flashrom and remove dependencies on subversion, either use
28make export
29or
30make tarball
31
32make export will export all flashrom files from the subversion repository at
33revision BASE into a directory named $EXPORTDIR/flashrom-$VERSION-r$SVNREVISION
34and will additionally modify the Makefile in that directory to contain the svn
35revision of the exported tree.
36
37make tarball will simply tar up the result of make export and gzip compress it.
38
39The snapshot tarballs are the result of make tarball and require no further
40processing.
41
42
Uwe Hermannd1129ac2009-05-28 15:07:42 +000043Build Instructions
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000044------------------
45
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +000046To build flashrom you need to install the following software:
47
48 * pciutils+libpci (if you want support for mainboard or PCI device flashing)
James Lairdc60de0e2013-03-27 13:00:23 +000049 * libusb (if you want FT2232, Dediprog or USB-Blaster support)
50 * libftdi (if you want FT2232 or USB-Blaster support)
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000051
Idwer Vollering5e410de2009-05-03 23:33:05 +000052Linux et al:
Uwe Hermann87c07932009-05-05 16:15:46 +000053
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +000054 * pciutils / libpci
Uwe Hermann87c07932009-05-05 16:15:46 +000055 * pciutils-devel / pciutils-dev / libpci-dev
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000056 * zlib-devel / zlib1g-dev (needed if libpci was compiled with libz support)
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000057
Idwer Vollering5e410de2009-05-03 23:33:05 +000058On FreeBSD, you need the following ports:
Idwer Vollering5e410de2009-05-03 23:33:05 +000059
Uwe Hermann87c07932009-05-05 16:15:46 +000060 * devel/gmake
61 * devel/libpci
Idwer Vollering5e410de2009-05-03 23:33:05 +000062
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +000063On OpenBSD, you need the following ports:
64
65 * devel/gmake
66 * sysutils/pciutils
67
Uwe Hermann87c07932009-05-05 16:15:46 +000068To compile on Linux, use:
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000069
Uwe Hermann87c07932009-05-05 16:15:46 +000070 make
71
Stefan Tauner8d21ff12015-01-10 09:33:06 +000072To compile on FreeBSD, OpenBSD or DragonFly BSD, use:
Uwe Hermann87c07932009-05-05 16:15:46 +000073
74 gmake
75
Carl-Daniel Hailfinger10572fa2009-08-17 16:30:53 +000076To compile on Nexenta, use:
77
78 make
79
Uwe Hermann87c07932009-05-05 16:15:46 +000080To compile on Solaris, use:
81
Carl-Daniel Hailfinger10572fa2009-08-17 16:30:53 +000082 gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
Uwe Hermann87c07932009-05-05 16:15:46 +000083
Stefan Tauner8d21ff12015-01-10 09:33:06 +000084To compile on NetBSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use:
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +000085
86 gmake
87
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000088To compile and run on Darwin/Mac OS X:
Uwe Hermann87c07932009-05-05 16:15:46 +000089
Carl-Daniel Hailfingerf992c192010-10-06 23:16:10 +000090 Install DirectHW from coresystems GmbH.
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000091 DirectHW is available at http://www.coreboot.org/DirectHW .
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000092
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000093To cross-compile on Linux for DOS:
94
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000095 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 Hailfinger50415d22010-03-21 14:54:57 +000098 djcross-binutils-2.19.1-10ap.i386.rpm
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000099 djcross-gcc-4.3.2-8ap.i686.rpm
Idwer Vollering9c31b502010-10-05 13:31:12 +0000100 djcrx-2.04pre_20090725-13ap.i386.rpm
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000101 The cross toolchain packages for your distribution may have slightly different
102 names (look for packages named *djgpp*).
Stefan Tauner449abe22013-09-11 23:34:57 +0000103
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 Taunerbe62d3f2015-01-10 09:32:44 +0000106 specify the base folder on compile time with the LIBS_BASE parameter.
Stefan Tauner449abe22013-09-11 23:34:57 +0000107 The default as described above is equal to calling
Stefan Taunerbe62d3f2015-01-10 09:32:44 +0000108 'make djgpp-dos LIBS_BASE=..'
Stefan Tauner449abe22013-09-11 23:34:57 +0000109
110 To get and build said libraries...
111 Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000112 Compile pciutils, see README.DJGPP for instructions.
Stefan Tauner449abe22013-09-11 23:34:57 +0000113 Download and compile http://flashrom.org/File:Libgetopt.tar.gz
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000114 Enter the flashrom directory.
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000115 Run either (change settings where appropriate)
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000116 make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000117 or (above settings hardcoded)
118 make djgpp-dos
Stefan Tauner449abe22013-09-11 23:34:57 +0000119 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 Reinauer06b2c4d2005-12-01 10:51:08 +0000121
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000122To 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 Hailfinger9e3a6c42010-10-08 12:40:09 +0000133Processor architecture dependent features:
134
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000135 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 Hailfinger9e3a6c42010-10-08 12:40:09 +0000138
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000139Installation
140------------
141
142In order to install flashrom and the manpage into /usr/local, type:
143
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000144 make install
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000145
146For installation in a different directory use DESTDIR, e.g. like this:
147
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000148 make DESTDIR=/usr install
149
150If you have insufficient permissions for the destination directory, use sudo
151by adding sudo in front of the commands above.
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000152
153
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000154Contact
Uwe Hermanne94dbf22009-05-22 13:18:38 +0000155-------
156
157The official flashrom website is:
158
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000159 http://www.flashrom.org/
Uwe Hermannb6d28322006-12-04 08:15:47 +0000160
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000161The IRC channel is
162
163 #flashrom at irc.freenode.net
164
Uwe Hermann4e3d0b32010-03-25 23:18:41 +0000165The mailing list address is
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000166
167 flashrom@flashrom.org