README 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. -------------------------------------------------------------------------------
  2. flashrom README
  3. -------------------------------------------------------------------------------
  4. flashrom is a utility for detecting, reading, writing, verifying and erasing
  5. flash chips. It is often used to flash BIOS/EFI/coreboot/firmware images
  6. in-system using a supported mainboard, but it also supports flashing of network
  7. cards (NICs), SATA controller cards, and other external devices which can
  8. program flash chips.
  9. It supports a wide range of flash chips (most commonly found in SOIC8, DIP8,
  10. SOIC16, WSON8, PLCC32, DIP32, TSOP32, and TSOP40 packages), which use various
  11. protocols such as LPC, FWH, parallel flash, or SPI.
  12. Do not use flashrom on laptops (yet)! The embedded controller (EC) present in
  13. many laptops might interact badly with any attempts to communicate with the
  14. flash chip and may brick your laptop.
  15. Please make a backup of your flash chip before writing to it.
  16. Please see the flashrom(8) manpage.
  17. Packaging
  18. ---------
  19. To package flashrom and remove dependencies on subversion, either use
  20. make export
  21. or
  22. make tarball
  23. make export will export all flashrom files from the subversion repository at
  24. revision BASE into a directory named $EXPORTDIR/flashrom-$VERSION-r$SVNREVISION
  25. and will additionally modify the Makefile in that directory to contain the svn
  26. revision of the exported tree.
  27. make tarball will simply tar up the result of make export and gzip compress it.
  28. The snapshot tarballs are the result of make tarball and require no further
  29. processing.
  30. Build Instructions
  31. ------------------
  32. To build flashrom you need to install the following software:
  33. * pciutils+libpci (if you want support for mainboard or PCI device flashing)
  34. * libusb (if you want FT2232, Dediprog or USB-Blaster support)
  35. * libftdi (if you want FT2232 or USB-Blaster support)
  36. Linux et al:
  37. * pciutils / libpci
  38. * pciutils-devel / pciutils-dev / libpci-dev
  39. * zlib-devel / zlib1g-dev (needed if libpci was compiled with libz support)
  40. On FreeBSD, you need the following ports:
  41. * devel/gmake
  42. * devel/libpci
  43. On OpenBSD, you need the following ports:
  44. * devel/gmake
  45. * sysutils/pciutils
  46. To compile on Linux, use:
  47. make
  48. To compile on FreeBSD, OpenBSD or DragonFly BSD, use:
  49. gmake
  50. To compile on Nexenta, use:
  51. make
  52. To compile on Solaris, use:
  53. gmake LDFLAGS="-L$pathtolibpci" CC="gcc -I$pathtopciheaders" CFLAGS=-O2
  54. To compile on NetBSD (with pciutils, libftdi, libusb installed in /usr/pkg/), use:
  55. gmake
  56. To compile and run on Darwin/Mac OS X:
  57. Install DirectHW from coresystems GmbH.
  58. DirectHW is available at http://www.coreboot.org/DirectHW .
  59. To cross-compile on Linux for DOS:
  60. Get packages of the DJGPP cross compiler and install them:
  61. djgpp-filesystem djgpp-gcc djgpp-cpp djgpp-runtime djgpp-binutils
  62. As an alternative, the DJGPP web site offers packages for download as well:
  63. djcross-binutils-2.19.1-10ap.i386.rpm
  64. djcross-gcc-4.3.2-8ap.i686.rpm
  65. djcrx-2.04pre_20090725-13ap.i386.rpm
  66. The cross toolchain packages for your distribution may have slightly different
  67. names (look for packages named *djgpp*).
  68. You will need the following library source trees containing their compiled
  69. static libraries either in the parent directory of the flashrom source or
  70. specify the base folder on compile time with the LIBS_BASE parameter.
  71. The default as described above is equal to calling
  72. 'make djgpp-dos LIBS_BASE=..'
  73. To get and build said libraries...
  74. Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz
  75. Compile pciutils, see README.DJGPP for instructions.
  76. Download and compile http://flashrom.org/File:Libgetopt.tar.gz
  77. Enter the flashrom directory.
  78. Run either (change settings where appropriate)
  79. make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
  80. or (above settings hardcoded)
  81. make djgpp-dos
  82. To run flashrom.exe, download http://flashrom.org/File:Csdpmi7b.zip and
  83. unpack CWSDPMI.EXE into the current directory or one in PATH.
  84. To cross-compile on Linux for Windows:
  85. Get packages of the MinGW cross compiler and install them:
  86. mingw32-filesystem mingw32-cross-cpp mingw32-cross-binutils mingw32-cross-gcc
  87. mingw32-runtime mingw32-headers
  88. The cross toolchain packages for your distribution may have slightly different
  89. names (look for packages named *mingw*).
  90. PCI-based programmers (internal etc.) are not supported on Windows.
  91. Run (change CC= and STRIP= settings where appropriate)
  92. make CC=i686-w64-mingw32-gcc STRIP=i686-w64-mingw32-strip
  93. Processor architecture dependent features:
  94. On non-x86 architectures a few programmers don't work (yet) because they
  95. use port-based I/O which is not directly available on non-x86. Those
  96. programmers will be disabled automatically if you run "make".
  97. Compiler quirks:
  98. If you are using clang and if you want to enable only one driver, you may hit an
  99. overzealous compiler warning from clang. Compile with "make WARNERROR=no" to
  100. force it to continue and enjoy.
  101. Installation
  102. ------------
  103. In order to install flashrom and the manpage into /usr/local, type:
  104. make install
  105. For installation in a different directory use DESTDIR, e.g. like this:
  106. make DESTDIR=/usr install
  107. If you have insufficient permissions for the destination directory, use sudo
  108. by adding sudo in front of the commands above.
  109. Contact
  110. -------
  111. The official flashrom website is:
  112. http://www.flashrom.org/
  113. The IRC channel is
  114. #flashrom at irc.freenode.net
  115. The mailing list address is
  116. flashrom@flashrom.org