getrevision.sh: Make sure we don't get translated output.

(And explicitly require bash.)

Signed-Off-By: Joerg Mayer <jmayer@loplof.de>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1716 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Introduce serialport_config().

This allows to easily reconfigure a serial port as needed in
the Bus Pirate speedup patch.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1717 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add additional error handling to pcidev_readbar() callers.

This is mostly a leftover of Niklas' "remove exit call from pcidev_init" patch.
While not explicitly necessary detecting errors early is usually a good idea.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1718 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Get rid of sp_die().

- Add return values to sp_flush_stream(), sp_pass_writen(),
  sp_execute_opbuf(), sp_execute_opbuf_noflush(),
  sp_check_opbuf_usage(), sp_do_read_n().
- Use those return values to propagate errors instead of exiting.
  In some places this has to wait for core API changes (error handling for
  chip_readb, chip_readn, chip_write) hence comments are added instead.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1719 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
IT87: Add ability to select between chips on GIGABYTE DualBIOS boards.

Thanks to Vadim Girlin for finding out how to do that.
This is known to work on GA-MA770-UD3, GA-B75M-D3V, GA-B75N and
GA-H61M-S1 (only M_BIOS is populated).

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Tested-by: Damien Zammit <damien@zamaudio.com>
Tested-by: Anton Kochkov <anton.kochkov@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1720 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Makefile: Explain process of handling CONFIG_* variables.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1721 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Fujitsu MBM29LV160BE/TE.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1722 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Atmel AT45DB* chips.

Signed-off-by: Aidan Thornton <makosoft@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1723 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for AT45DB321C.

It seems like this model is one-of-a-kind... it shares some properties
with the older versions of the AT45DB series as well as with new ones.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1724 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for AT45CS1282.

This one is even more strange than the AT45DB chips. Like the AT45DB321C
it does not support any power-of-2 page sizes. There is only one asymmetrical
eraser and that uses two opcodes.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1725 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
libpayload: By default build libflashrom.a instead of flashrom.

flashrom won't build nor run as native payload very soon (or ever).
This patch changes a special GNU make variable that allows to select
the default goal which is taken if no goal is given explicitly on
the command line. Normally this would be the first rule in Makefile,
i.e. all. This won't compile if the target OS is libpayload, hence
change it to "libflashrom.a" in that case.

This requires two not completely ancient GNU make features:
 - MAKECMDGOALS
 - .DEFAULT_GOAL

Checking for these with ancient-only GNU make features is non-trivial
and hereby postponed.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

git-svn-id: svn://flashrom.org/flashrom/trunk@1726 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Improve getrevision.sh.

 - remove bashism.
 - simplify some git-related code.
 - improved parameter and error handling.
 - additional -d/--date action which is similar to the timestamp action.
 - support for an optional path parameter.
 - there is only one sane time format.
 - and only one sane date format too.
 - use UTC dates and times only.
 - vastly improve git_url() to print the correct remote url and
   "nearest" branch.
 - remove username from repository URLs.
 - add "-dirty" to local revisions if there are uncommitted changes.
 - indicate in local revisions how many git-only commits were done
   since branching from upstream svn.
 - fix svn_revision() fallback to svn info and remove git-svn.
 - print leading r in script instead of hardcode it in the makefile;
   no more "0.9.7-runknown".
 - make retrieving the upstream revision work even in cloned git-svn
   repositories.
 - more abstractions and helper functions.
 - less fragmentation of actual functionality.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1727 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Automatically add version and date to the manpage.

To avoid funny effects of ever changing files tracked by the VCS this patch
moves the manpage data to flashrom.8.tmpl and generates the actual
manpage with a new makefile target if needed.

Signed-Off-By: Joerg Mayer <jmayer@loplof.de>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1728 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add now auto-generated manpage to svn:ignore.

I had to touch svn directly, where is my reimbursement?

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>


git-svn-id: svn://flashrom.org/flashrom/trunk@1729 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
libpayload: Remove file I/O in flashrom.c.

read_buf_from_file() and write_buf_to_file() use file streams which are
not supported in libpayload.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1730 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
layout: Rename romimages to num_rom_entries.

Since we are planning to support image files for rom entries, rename the
variable used to count the number of known rom entries to avoid confusion.
There is already num_include_args with similar semantics, hence we use
num_rom_entries.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1731 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
layout: Rename romlayout_t to romentry_t.

The type describes one entry of the whole layout actually.
Using layout_entry_t or something similar would be more correct,
but due to it length we will use "rom" instead of "layout" here and
in upcoming code.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1732 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add board enable for Bcom WinNET P680.

This patch replaces Alex Mauer's previous patch for this board (from 2008).
Tested to read, erase, and write on 2 different boards, both with AMIC
A29040BL flash chips, using both stock BIOS and coreboot images.

This patch marks the AMIC chip as tested at the same time.

Signed-off-by: Corey Osgood <corey.osgood@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1733 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
DOS refinements.

This allows to use the DOS library trees stored in a user-specified directory.

I have mirrored the needed patches, sources and binaries (the latter
are properly licensed to allow that) in the flashrom wiki, so use those
URLs instead of the original sources.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1734 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add an internal DMI decoder.

Previously we had to rely on dmidecode to decode the DMI/SMBIOS table.
This patch integrates a DMI decoder into flashrom. The old behavior of calling
dmidecode can be brought back by using CONFIG_INTERNAL_DMI=no.

Significant portions of this patch were taken from dmidecode, hence add its
authors to the copyright notice (dmidecode is also GPL2+). We do a few things
differently though. First of all we do more bounds checking to prevent accessing
unmapped memory. We do not support disovery via EFI (yet), but memory
scanning only. We handle the chassis-type lock bit correctly which dmidecode
did not for a long while.

The API to the rest of flashrom remains stable, but the output changes slightly.
To share as much code as possible (which actually is not much), i have added
dmi_fill methods that get called in dmi_init. They are reponsible to fill the
dmi_strings array and setting the is_laptop variable. After it is called, dmi_init
prints all dmi_strings. Previously the strings were printed in the order they were
discovered, followed by the chassis-type, which is now output earlier (in dmi_fill).

Because DJGPP does not support strnlen a simple implementation was added
for it.

This is still only available on x86; actually it is not even compiled in for other
architectures at all anymore.

Signed-off-by: Sean Nelson<audiohacked@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Tested-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Tested-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://flashrom.org/flashrom/trunk@1735 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1