blob: 7f24cca175860fff7d3804d1dc4ae14e76abda5f [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
Carl-Daniel Hailfinger1ebf8452009-08-18 23:50:14 +000011It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and TSOP40
12chips, which use various protocols such as LPC, FWH, parallel flash, or SPI.
Uwe Hermann42eb17f2008-01-18 17:48:51 +000013
Carl-Daniel Hailfinger27023762010-04-28 15:22:14 +000014Do not use flashrom on laptops! The embedded controller (EC) present in many
15laptops interacts badly with any flash attempts and can brick your laptop
16permanently.
17
18Please make a backup of your flash chip before writing to it.
19
Stefan Reinauer009c51b2010-01-03 23:50:28 +000020Please see the flashrom(8) manpage.
21
Uwe Hermann2dc5f422006-11-20 20:32:35 +000022
Carl-Daniel Hailfingera23041c2009-06-12 14:49:10 +000023Packaging
24---------
25
26To package flashrom and remove dependencies on subversion, either use
27make export
28or
29make tarball
30
31make export will export all flashrom files from the subversion repository at
32revision BASE into a directory named $EXPORTDIR/flashrom-$VERSION-r$SVNREVISION
33and will additionally modify the Makefile in that directory to contain the svn
34revision of the exported tree.
35
36make tarball will simply tar up the result of make export and gzip compress it.
37
38The snapshot tarballs are the result of make tarball and require no further
39processing.
40
41
Uwe Hermannd1129ac2009-05-28 15:07:42 +000042Build Instructions
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000043------------------
44
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +000045To build flashrom you need to install the following software:
46
47 * pciutils+libpci (if you want support for mainboard or PCI device flashing)
James Lairdc60de0e2013-03-27 13:00:23 +000048 * libusb (if you want FT2232, Dediprog or USB-Blaster support)
49 * libftdi (if you want FT2232 or USB-Blaster support)
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000050
Idwer Vollering5e410de2009-05-03 23:33:05 +000051Linux et al:
Uwe Hermann87c07932009-05-05 16:15:46 +000052
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +000053 * pciutils / libpci
Uwe Hermann87c07932009-05-05 16:15:46 +000054 * pciutils-devel / pciutils-dev / libpci-dev
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000055 * zlib-devel / zlib1g-dev (needed if libpci was compiled with libz support)
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000056
Idwer Vollering5e410de2009-05-03 23:33:05 +000057On FreeBSD, you need the following ports:
Idwer Vollering5e410de2009-05-03 23:33:05 +000058
Uwe Hermann87c07932009-05-05 16:15:46 +000059 * devel/gmake
60 * devel/libpci
Idwer Vollering5e410de2009-05-03 23:33:05 +000061
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +000062On OpenBSD, you need the following ports:
63
64 * devel/gmake
65 * sysutils/pciutils
66
Uwe Hermann87c07932009-05-05 16:15:46 +000067To compile on Linux, use:
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000068
Uwe Hermann87c07932009-05-05 16:15:46 +000069 make
70
71To compile on FreeBSD, use:
72
73 gmake
74
Carl-Daniel Hailfinger10572fa2009-08-17 16:30:53 +000075To compile on Nexenta, use:
76
77 make
78
Uwe Hermann87c07932009-05-05 16:15:46 +000079To compile on Solaris, use:
80
Carl-Daniel Hailfinger10572fa2009-08-17 16:30:53 +000081 gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
Uwe Hermann87c07932009-05-05 16:15:46 +000082
Jonathan A. Kollasch3646c8f2010-01-08 21:18:08 +000083To compile on NetBSD or DragonFly BSD, use:
Uwe Hermann87c07932009-05-05 16:15:46 +000084
85 ln -s /usr/pkg/include/pciutils pci
Jonathan A. Kollaschc1c11252012-04-14 21:06:31 +000086 gmake CPPFLAGS="-I. -I/usr/pkg/include" \
87 LDFLAGS="-L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib"
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000088
Carl-Daniel Hailfingerb63b0672010-07-02 17:12:50 +000089To compile on OpenBSD, use:
90
91 gmake
92
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000093To compile and run on Darwin/Mac OS X:
Uwe Hermann87c07932009-05-05 16:15:46 +000094
Carl-Daniel Hailfingerf992c192010-10-06 23:16:10 +000095 Install DirectHW from coresystems GmbH.
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +000096 DirectHW is available at http://www.coreboot.org/DirectHW .
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000097
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000098To cross-compile on Linux for DOS:
99
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000100 Get packages of the DJGPP cross compiler and install them:
101 djgpp-filesystem djgpp-gcc djgpp-cpp djgpp-runtime djgpp-binutils
102 As an alternative, the DJGPP web site offers packages for download as well:
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000103 djcross-binutils-2.19.1-10ap.i386.rpm
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000104 djcross-gcc-4.3.2-8ap.i686.rpm
Idwer Vollering9c31b502010-10-05 13:31:12 +0000105 djcrx-2.04pre_20090725-13ap.i386.rpm
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000106 The cross toolchain packages for your distribution may have slightly different
107 names (look for packages named *djgpp*).
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000108 Download pciutils 3.1.5 and apply http://assembler.cz/flashrom/pciutils.patch
109 Download and compile http://assembler.cz/flashrom/libgetopt/
110 Compile pciutils, see README.DJGPP for instructions.
111 Enter the flashrom directory.
112 ../libpci should contain pciutils source and binaries.
113 ../libgetopt should contain getopt.a from libgetopt.
114 Run either (change settings where appropriate)
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000115 make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +0000116 or (above settings hardcoded)
117 make djgpp-dos
118 You might have to add WARNERROR=no to the make command line.
Idwer Vollering9c31b502010-10-05 13:31:12 +0000119 To run flashrom.exe, download and unpack
120 http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi7b.zip and make sure
121 CWSDPMI.EXE is in the current directory.
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +0000122
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000123To cross-compile on Linux for Windows:
124
125 Get packages of the MinGW cross compiler and install them:
126 mingw32-filesystem mingw32-cross-cpp mingw32-cross-binutils mingw32-cross-gcc
127 mingw32-runtime mingw32-headers
128 The cross toolchain packages for your distribution may have slightly different
129 names (look for packages named *mingw*).
130 PCI-based programmers (internal etc.) are not supported on Windows.
131 Run (change CC= and STRIP= settings where appropriate)
132 make CC=i686-w64-mingw32-gcc STRIP=i686-w64-mingw32-strip
133
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +0000134Processor architecture dependent features:
135
Carl-Daniel Hailfinger60d9bd22012-08-09 23:34:41 +0000136 On non-x86 architectures a few programmers don't work (yet) because they
137 use port-based I/O which is not directly available on non-x86. Those
138 programmers will be disabled automatically if you run "make".
Carl-Daniel Hailfinger9e3a6c42010-10-08 12:40:09 +0000139
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000140Installation
141------------
142
143In order to install flashrom and the manpage into /usr/local, type:
144
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000145 make install
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000146
147For installation in a different directory use DESTDIR, e.g. like this:
148
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000149 make DESTDIR=/usr install
150
151If you have insufficient permissions for the destination directory, use sudo
152by adding sudo in front of the commands above.
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000153
154
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000155Contact
Uwe Hermanne94dbf22009-05-22 13:18:38 +0000156-------
157
158The official flashrom website is:
159
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000160 http://www.flashrom.org/
Uwe Hermannb6d28322006-12-04 08:15:47 +0000161
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000162The IRC channel is
163
164 #flashrom at irc.freenode.net
165
Uwe Hermann4e3d0b32010-03-25 23:18:41 +0000166The mailing list address is
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000167
168 flashrom@flashrom.org