blob: 022c035e80a7ec01edd8e6de74cd9b24657b235f [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
Uwe Hermann87c07932009-05-05 16:15:46 +000045To build flashrom you need to install the following packages or ports:
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000046
Idwer Vollering5e410de2009-05-03 23:33:05 +000047Linux et al:
Uwe Hermann87c07932009-05-05 16:15:46 +000048
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +000049 * pciutils / libpci
Uwe Hermann87c07932009-05-05 16:15:46 +000050 * pciutils-devel / pciutils-dev / libpci-dev
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000051 * zlib-devel / zlib1g-dev (needed if libpci was compiled with libz support)
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000052
Idwer Vollering5e410de2009-05-03 23:33:05 +000053On FreeBSD, you need the following ports:
Idwer Vollering5e410de2009-05-03 23:33:05 +000054
Uwe Hermann87c07932009-05-05 16:15:46 +000055 * devel/gmake
56 * devel/libpci
Idwer Vollering5e410de2009-05-03 23:33:05 +000057
Uwe Hermann87c07932009-05-05 16:15:46 +000058To compile on Linux, use:
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000059
Uwe Hermann87c07932009-05-05 16:15:46 +000060 make
61
62To compile on FreeBSD, use:
63
64 gmake
65
Carl-Daniel Hailfinger10572fa2009-08-17 16:30:53 +000066To compile on Nexenta, use:
67
68 make
69
Uwe Hermann87c07932009-05-05 16:15:46 +000070To compile on Solaris, use:
71
Carl-Daniel Hailfinger10572fa2009-08-17 16:30:53 +000072 gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
Uwe Hermann87c07932009-05-05 16:15:46 +000073
Jonathan A. Kollasch3646c8f2010-01-08 21:18:08 +000074To compile on NetBSD or DragonFly BSD, use:
Uwe Hermann87c07932009-05-05 16:15:46 +000075
76 ln -s /usr/pkg/include/pciutils pci
Jonathan A. Kollaschd8dfc442010-02-16 00:49:50 +000077 gmake CPPFLAGS=-I. LDFLAGS="-L/usr/pkg/lib -Wl,-rpath-link,/usr/pkg/lib"
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000078
79To compile and run on Darwin/Mac OS X:
Uwe Hermann87c07932009-05-05 16:15:46 +000080
81 Install DirectIO from coresystems GmbH.
82 DirectIO is available at http://www.coresystems.de/en/directio.
Carl-Daniel Hailfinger9abf5292009-05-01 16:34:32 +000083
Carl-Daniel Hailfinger50415d22010-03-21 14:54:57 +000084To cross-compile on Linux for DOS:
85
86 Get RPMs of the cross compiler from the DJGPP site and install them:
87 djcross-binutils-2.19.1-10ap.i386.rpm
88 djcross-gcc-tools-4.4.1-1ap.i686.rpm
89 djcross-gcc-4.3.2-8ap.i686.rpm
90 Download pciutils 3.1.5 and apply http://assembler.cz/flashrom/pciutils.patch
91 Download and compile http://assembler.cz/flashrom/libgetopt/
92 Compile pciutils, see README.DJGPP for instructions.
93 Enter the flashrom directory.
94 ../libpci should contain pciutils source and binaries.
95 ../libgetopt should contain getopt.a from libgetopt.
96 Run either (change settings where appropriate)
97 make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip OS_ARCH=DOS
98 or (above settings hardcoded)
99 make djgpp-dos
100 You might have to add WARNERROR=no to the make command line.
101 To run flashrom.exe, download http://clio.rice.edu/djgpp/csdpmi7b.zip and
102 make sure CWSDPMI.EXE is in the current directory.
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +0000103
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000104Installation
105------------
106
107In order to install flashrom and the manpage into /usr/local, type:
108
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000109 make install
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000110
111For installation in a different directory use DESTDIR, e.g. like this:
112
Carl-Daniel Hailfingera472b8b2009-10-03 17:08:02 +0000113 make DESTDIR=/usr install
114
115If you have insufficient permissions for the destination directory, use sudo
116by adding sudo in front of the commands above.
Uwe Hermannd1129ac2009-05-28 15:07:42 +0000117
118
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000119Contact
Uwe Hermanne94dbf22009-05-22 13:18:38 +0000120-------
121
122The official flashrom website is:
123
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000124 http://www.flashrom.org/
Uwe Hermannb6d28322006-12-04 08:15:47 +0000125
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000126The IRC channel is
127
128 #flashrom at irc.freenode.net
129
Uwe Hermann4e3d0b32010-03-25 23:18:41 +0000130The mailing list address is
Joerg Mayer7221d5f2009-08-24 13:24:52 +0000131
132 flashrom@flashrom.org