1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

1717 Commits

Author SHA1 Message Date
Stefan Tauner
d3b98fb833 Add (untested) board enable for ASUS P4PE-X/TE
REed by roxfan and Michael Karcher, patch by Stefan Tauner.

Corresponding to flashrom svn r1653.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-03-04 01:41:56 +00:00
Kyösti Mälkki
c54adc5852 Add M25P20-old
This older (ST-branded) revision of M25P20 chip does not support RDID and
hence was not detected correctly. This patch adds a workaround similar
to M25P40-old.

Corresponding to flashrom svn r1652.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-03-04 01:20:28 +00:00
Stefan Tauner
50d67aaa79 Make write granularity a chip attribute
Corresponding to flashrom svn r1651.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-03-03 23:49:48 +00:00
Stefan Tauner
352e50b79e Add a bunch of new/tested stuff and various small changes 17
Tested Mainboards:
OK:
 - Acer V75-M (used in IBM Aptiva 2170-G)
   http://www.flashrom.org/pipermail/flashrom/2012-December/010300.html
 - Acorp 6M810C
   http://www.flashrom.org/pipermail/flashrom/2013-January/010433.html
 - ASRock G31M-S rev 2.0
   http://www.flashrom.org/pipermail/flashrom/2013-February/010538.html
 - ASUS F1A75-V PRO
   http://paste.flashrom.org/view.php?id=1528
 - ASUS M5A97 (rev. 1.0)
   http://www.flashrom.org/pipermail/flashrom/2013-February/010483.html
 - ASUS P5KPL-AM IN/GB
   http://www.flashrom.org/pipermail/flashrom/2013-January/010455.html
 - GABYTE GA-H77M-D3H
   http://www.flashrom.org/pipermail/flashrom/2013-February/010538.html

NOT OK:
 - GIGABYTE GA-Z77MX-D3H
   http://paste.flashrom.org/view.php?id=1529
   http://paste.flashrom.org/view.php?id=1530

Tested flash chips:
 - Winbond W25X10 to PREW (+PREW)
   Reported on IRC(?)
 - Eon EN25Q32(A/B) to PREW (+REW)
   http://www.flashrom.org/pipermail/flashrom/2013-February/010533.html
 - Eon EN25Q64 to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2013-January/010466.html

Miscellaneous:
- Fix superflouos line breaks in wiki mainboard and laptop output.
- Use the .nh (no hyphenation) command in the manpage to enforce
  single-line URLs where useful.
- Reference the manpage (besides the Laptops wiki page) in the laptop warning.
- Minor output and whitespace fixes.
- Add Fidelix IDs.
- Add ISSE clones of PMC chips.
- Fix typo: EMST -> ESMT.
- Add ID of ESMT F25D08QA.
- Refine GigaDevice GD25Q series (missing voltages and comments).
- Use underscore instead of lower-case x as wildcard in Sharp chip names.

Corresponding to flashrom svn r1650.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-02-22 15:58:45 +00:00
Nico Huber
77fa67d2df dedirpog: add a parameter 'spispeed' to set the SPI clock rate
The following rates are
available (in Hz):
  375k, 750k, 1.5M, 2.18M, 3M, 8M, 12M and 24M

The original driver reinitializes the programmer after setting the
speed, so the initialization calls have moved into a new function
dediprog_setup() which is called twice.

Corresponding to flashrom svn r1649.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-02-20 18:03:36 +00:00
Stefan Tauner
e038e9082c Fix building for MacOSX
- Add a new macro named IS_MACOSX to hwaccess.c and use it to enable iopl().
  This was broken since r1638. This fix does *not* restore the very permissive
  concept where iopl() was activated in an #else branch that was inplace before
  r1638.
- Make printing the image file's size in flashrom.c platform independent.

Bonus: remove definitions of off64_t and lseek64 which are not necessary
anymore for about 1000 commits.

Thanks to SJ for reporting the issue and testing the solution.

Corresponding to flashrom svn r1648.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-02-04 04:38:42 +00:00
Stefan Tauner
f656e8088e Update Macronix MX25L512, MX25L1005, MX25L2005, MX25L4005, MX25L8005
Update MX25L512 with references to and data about
  MX25L512E, MX25V512, MX25V512C.
Update MX25L1005 with references to and data about
  MX25L1005C, MX25L1006E.
Update MX25L2005 with references to and data about
  MX25L2005C.
Update MX25L4005 with references to and data about
  MX25L4005A, MX25L4005C.
Update MX25L8005 with references to and data about
  MX25V8005.

Bonus: add chip IDs of MX25U1635E, MX25U3235E/F, MX25U6435E/F.

Corresponding to flashrom svn r1647.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-02-02 15:35:44 +00:00
Stefan Tauner
67d163d2fa Fix duplicate 'const' declaration specifiers
Thanks to Idwer and clang for noticing these problems.

Corresponding to flashrom svn r1646.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-01-15 17:37:48 +00:00
Carl-Daniel Hailfinger
8225868465 Fix compilation for DOS and non-x86 targets
Fixup for r1638.
Thanks to Idwer Vollering for testing.

Corresponding to flashrom svn r1645.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-01-08 22:49:12 +00:00
Carl-Daniel Hailfinger
a2faddf7d3 Decouple BAR reading from pci device init, handle errors gracefully
Pcidev_init() now returns struct pci_device * instead of a BAR stored in
PCI config space. This allows for real error checking instead of having
exit(1) everywhere in pcidev.c.
Thanks to Niklas Söderlund for coming up with the original error
handling patch which was slightly modified and folded into this patch.
Move the declaration of struct pci_device in programmer.h before the
first user.

Corresponding to flashrom svn r1644.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-01-05 23:52:45 +00:00
Stefan Tauner
c6fa32d2b5 Introduce msg_*warn
Also, unify all outputs of "Warning:" and "Error:" to use normal
capitalization instead of mixing it with all capitals.

Corresponding to flashrom svn r1643.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2013-01-04 22:54:07 +00:00
Stefan Tauner
5561955b11 Unify PCI init and let pcidev clean itself up
Previously the internal programmer used its own code to initialize pcilib.
This patch extracts the common code from the internal programmer and
pcidev_init() into pcidev_init_common().
This fixes the non-existent PCI cleanup of the internal programmer and adds
an additional safety by checking for an already existing PCI context.

We got a nice shutdown function registration infrastructure, but did not use it
very wisely. Instead we added shutdown functions to a myriad of programmers
unnecessarily. In this patch we get rid of those that do only call pci_cleanup(pacc)
by adding a shutdown function the pcidev.c itself that gets registered by
pcidev_init().

Corresponding to flashrom svn r1642.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-01-04 22:24:58 +00:00
Brian Salcedo
30dfdbaf3a Add user interface to activate the Bus Pirate pull-up resistors
When working with some flash chips using the Bus Pirate programmer, the
use of the Bus Pirate's on-board pull-up resistors is sometimes
necessary.

On v3 hardware the use of said pull-up resistors requires the user to apply a
voltage to the VPU pin of the Bus Pirate, and then command it to use them.
For v4 hardware which supports also fixed internal 3.3V and 5V sources no
documentation could be found.

Here is a link to information pertaining to what this patch does:
http://dangerousprototypes.com/docs/SPI_(binary)#0100wxyz_-_Configure_peripherals_w.3Dpower.2C_x.3Dpull-ups.2C_y.3DAUX.2C_z.3DCS

Bonus: small cleanup of superfluous stack variables.

Corresponding to flashrom svn r1641.

Signed-off-by: Brian Salcedo <bsalcedo@gmx.us>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Brian Salcedo <bsalcedo@gmx.us>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-01-03 20:44:30 +00:00
Stefan Tauner
e34e3e8a49 Add a bunch of new/tested stuff and various small changes 16
Tested Mainboards:
OK:
 - Acer V75-M (used in IBM Aptiva 2170-G
   http://www.flashrom.org/pipermail/flashrom/2012-December/010300.html
 - ASRock 4CoreDual-VSTA with W39V040FB
   http://paste.flashrom.org/view.php?id=1446
 - ASRock 775Dual-VSTA
   http://www.flashrom.org/pipermail/flashrom/2012-December/010294.html
 - ASRock E350M1/USB3
   http://paste.flashrom.org/view.php?id=1465
 - ASUS P5B-VM
   http://www.flashrom.org/pipermail/flashrom/2012-December/010351.html
 - ASUS SABERTOOTH 990FX R2.0
   http://www.flashrom.org/pipermail/flashrom/2012-December/010210.html
 - Elitegroup A928 (including a laptop whitelist board enable)
   http://www.flashrom.org/pipermail/flashrom/2012-November/010119.html
 - EVGA 122-CK-NF68
   Reported by Stephanie Daugherty on IRC
   http://paste.flashrom.org/view.php?id=1431
 - GIGABYTE GA-A75M-UD2H
   Reported by Soul_keeper on IRC
   http://paste.flashrom.org/view.php?id=1490
 - Intel D945GCNL
   Add board enable to override laptop detection too.
   http://www.flashrom.org/pipermail/flashrom/2012-December/010276.html
 - MSI G33M (MS-7357)
   http://www.flashrom.org/pipermail/flashrom/2012-October/010056.html
 - Shuttle FB61
   http://www.flashrom.org/pipermail/flashrom/2012-November/010105.html
 - Tyan S4882 (Thunder K8QS Pro)
   Reported on IRC
NOT OK:
   Alienware Aurora-R2
   http://www.flashrom.org/pipermail/flashrom/2012-December/010225.html
   Biostar H61MU3
   http://www.flashrom.org/pipermail/flashrom/2012-November/010144.html
   Dell OptiPlex 7010
   http://paste.flashrom.org/view.php?id=1481
   Intel DH67CL
   http://www.flashrom.org/pipermail/flashrom/2012-November/010112.html
   Supermicro X9DRT-HF+
   http://www.flashrom.org/pipermail/flashrom/2012-November/010155.html
   Supermicro X9DRW
   http://www.flashrom.org/pipermail/flashrom/2012-November/010150.html

Tested flash chips:
 - Atmel AT25FS010 to PREW (+PREW)
   http://paste.flashrom.org/view.php?id=1484
 - Eon EN25F64 to PREW (+EW)
   http://www.flashrom.org/pipermail/flashrom/2012-December/010210.html
 - Spansion S25FL032A/P to PREW (+EW)
   http://paste.flashrom.org/view.php?id=1510
 - ST M29F002T/NT to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2012-December/010300.html
 - Winbond W25X10 to PREW (+PREW)
   http://paste.flashrom.org/view.php?id=1486

Tested chipsets:
 - NVIDIA MCP78S http://www.flashrom.org/pipermail/flashrom/2012-November/010176.html
 - SiS 650 http://www.flashrom.org/pipermail/flashrom/2012-November/010119.html

Miscellaneous:
- Typo in GA-X58A-UDR3 (correct is GA-X58A-UD3R).
- Force 2-digit hex numbers in prints were it makes sense.
- Share code between enable_flash_sis530() and enable_flash_sis540().
- Some SST 25 series chips support both WRSR enable commands...
- S25FL032A and S25FL064A share the IDs with their P versions, so rename them.
- Fix a few memleaks in serprog.
- Dediprog uses UINT_MAX so include limits.h (fixes the Windows build of dediprog)
- Add (another) hint regarding the mandatory -p parameter to the manpage
  to make Debian bug #690478 happy.
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690478
- Fix whitespace issues.
- On shutdown, reset count of registered programmers (by Nico Huber)
- Fix atahpt.c shutdown.
  The order of pcidev_init, register_shutdown and rpci_write_* is important!
  Thanks to Roy for reporting the problem and testing the fix.

Corresponding to flashrom svn r1640.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-01-01 00:06:51 +00:00
Nico Huber
bcb2e5a708 Constify parameters and globals
This makes some stuff const (partially to get a more convenient
libflashrom interface).

Corresponding to flashrom svn r1639.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-30 01:23:17 +00:00
Peter Lemenkov
6282966cc0 Simplify hwaccess.c
Previously the code was focused on architectures which led to lots of
duplicate code and spread the information regarding differences between
the architectures accross the file.

With this patch there is a single function header for any function and the
differentiation between architectures (and OS where needed) happens
in one place for each function. Also, this patch adds simple defines to bundle
often used arch and os checks. A central check for unknown architectures
and OSes has been added on top.

Corresponding to flashrom svn r1638.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-29 19:26:55 +00:00
Stefan Tauner
57794ac158 Add support for Atmel's AT25F series of SPI flash chips
This adds support for the following chips:
 - AT25F512, AT25F512A, AT25F512B
 - AT25F1024, AT25F1024A
 - AT25F2048
 - AT25F4096

Besides the definitions of the the chips in flashchips.c this includes
- a dedicated probing method (probe_spi_at25f)
- pretty printing methods (spi_prettyprint_status_register_at25f*), and
- unlocking methods (spi_disable_blockprotect_at25f*)

Corresponding to flashrom svn r1637.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-29 15:04:20 +00:00
Stefan Tauner
54aaa4ae2b Add support for Intel S33 series flash chips
This includes:
Bottom boot block:
* 16Mb/2MB:
  QB25F160S33B8, QB25F016S33B8, QH25F160S33B8, QH25F016S33B8
* 32Mb/4MB:
  QB25F320S33B8, QH25F320S33B8
* 64Mb/8MB:
  QB25F640S33B8, QH25F640S33B8

Top boot block:
* 16Mb/2MB:
  QB25F160S33T8, QB25F016S33T8, QH25F160S33T8, QH25F016S33T8
* 32Mb/4MB:
  QB25F320S33T8, QH25F320S33T8
* 64Mb/8MB:
  QB25F640S33T8, QH25F640S33T8

At least some seem to be marketed by other vendors (too?) but also with
Intel's vendor ID.

Besides a 0xC7 chip erase and a 0xD8 uniform 64kB block erase they
support also erasing the top/bottom 8 8kB blocks with opcode 0x40.
But since this command fails for all addresses outside those ranges,
it is not easily implemented with flashrom's current code base and
hence left out.

Corresponding to flashrom svn r1636.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-29 15:04:12 +00:00
Stefan Tauner
9530a02212 Add a generic SPI block unprotect function
This does not only remove a huge pile of duplicate code, it does
also fix a bug in spi_disable_blockprotect_at25df(), which is also
a good example why duplicated code is a bad idea.

Corresponding to flashrom svn r1635.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-29 15:04:05 +00:00
Stefan Tauner
6ee37e2836 Improve SPI status register pretty printing
- Move all functions related to SPI status registers to a new file
   spi25_statusreg.c. This includes the generic as well as the
   SST-specific functions from spi25.c and the chip-specific functions
   from a25.c and at25.c.
 - introduce helper functions
    * spi_prettyprint_status_register_hex()
    * spi_prettyprint_status_register_bpl()
    * spi_prettyprint_status_register_plain()
   Use the latter on every compatible flash chip that has no better printlock
   function set and get rid of the implicit pretty printing in the SPI probing
   functions.
 - remove
    * spi_prettyprint_status_register_common()
    * spi_prettyprint_status_register_amic_a25lq032() because it can be fully
      substituted with spi_prettyprint_status_register_amic_a25l032().
    * spi_prettyprint_status_register() (old switch, no longer needed)
 - promote and export
    * spi_prettyprint_status_register_amic_a25l05p() as spi_prettyprint_status_register_default_bp1().
    * spi_prettyprint_status_register_amic_a25l40p() as spi_prettyprint_status_register_default_bp2().
    * spi_prettyprint_status_register_st_m25p() as spi_prettyprint_status_register_default_bp3().
 - add #define TEST_BAD_REW and use it for a number of Atmel chips which
   had only TEST_BAD_READ set even though they dont have erasers or a write
   function set.

Corresponding to flashrom svn r1634.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-29 15:03:51 +00:00
Stefan Tauner
2c421199ab print_wiki.c: print programmers of type OTHER too
Corresponding to flashrom svn r1633.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-27 18:40:40 +00:00
Stefan Tauner
4b24a2d70b Unify usbdev_status and pcidev_status into dev_entry
Once upon a time usbdev_status was created for the ft2232
programmer. Its IDs are semantically different to pcidev_status
because they indicate USB instead of PCI IDs, but apart from that
both data structures are equal. This change makes life easier for
everything involved in handling and printing the status of devices
that is noted in those structures by combining them into dev_entry.

It is still possible to distinguish between PCI and USB devices
indirectly by using the struct programmer's type field.

Also, add a programmer column to the PCI and USB devices lists.

Corresponding to flashrom svn r1632.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-12-27 18:40:36 +00:00
Stefan Tauner
af358d6af2 Refactor PCI and USB device status printing
To be able to get rid of lots of #ifdefs and centralize programmer-specific
data more...
 - introduce two new fields to struct programmer_entry, namely
   enum type (OTHER, USB, PCI) and union devs (pcidev_status, usbdev_status
   or char *note).
 - use those fields to generate device listings in print.c and print_wiki.c.

Bonus: add printing of USB devices to print_wiki.c and count supported PCI
and USB devices.

Corresponding to flashrom svn r1631.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-12-27 18:40:26 +00:00
Stefan Tauner
a6d9648017 Add general programmer sanity checks
And remove the completely unused vendor field.

Corresponding to flashrom svn r1630.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-12-26 19:51:23 +00:00
Stefan Tauner
b8911d6cec Fix memleaks in cli_classic.c
Frees the memory allocated for the following strings
- log file name
- layout file name
- image file name
- programmer parameter (and reset the associated global variable in flashrom.c)

Also, free the flashchip structs allocated by probe_flash.

The layout image names were not fixed due to the pending layout patches.

These bugs were found thanks to valgrind.

Corresponding to flashrom svn r1629.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-26 07:55:00 +00:00
Nathan Laredo
21541a6b22 Add a "device" parameter for Dediprog
This patch adds a "device" parameter for Dediprog which enables use of
multiple dediprogs connected to a single machine. Very handy for test racks.

Example usage:
flashrom -p dediprog:device=0
flashrom -p dediprog:device=1
etc...

The patch was originally written by Nathan Laredo.
Thanks to David Hendricks for submitting it upstream.
Additional error handling, man page etc. by Stefan Tauner.

Corresponding to flashrom svn r1628.

Signed-off-by: Nathan Laredo <nil@google.com>
Signed-off-by: David Hendricks <dhendrix@google.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-12-24 22:07:36 +00:00
Stefan Tauner
acfc4c6c2f Fix sp_openserport users on Windows
Corresponding to flashrom svn r1627.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2012-11-30 16:46:45 +00:00
Stefan Tauner
62574aa5c0 Break endless loop in serialport_write()
Serialport_write could loop endlessly when used with a seemingly valid port
that does always return 0 on writes instead of an error.
Give up after about 125 ms i.e. 250 tries with a period of 500 us.

Corresponding to flashrom svn r1626.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2012-11-30 16:46:41 +00:00
Carl-Daniel Hailfinger
26148ae3a8 Fix linker flag bug introduced in r1623
Spotted by Idwer Vollering.

Corresponding to flashrom svn r1625.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-11-29 22:22:04 +00:00
Stefan Tauner
b226cb1662 Improve --help and friends
More clear "variable" names, better explanation if no programmer is selected etc.

Corresponding to flashrom svn r1624.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
2012-11-24 18:59:39 +00:00
Carl-Daniel Hailfinger
e7a39bfc92 Explicitly detect libusb-0.1 in the Makefile
Avoid funny interactions between libpci and libusb detection.
Leave libftdi autodetection alone for now.

Corresponding to flashrom svn r1623.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-11-20 21:06:16 +00:00
Stefan Tauner
98546c9637 Add (untested) board enable for Asus DSAN-DX
IDs are from the host bridge and LPC controller. The enable function
was reverse engineered by roxfan, thanks!
User mezzo vanished without reporting any test results.

Corresponding to flashrom svn r1622.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-11-05 12:20:29 +00:00
Carl-Daniel Hailfinger
64263c7ed2 Support the new fast SPI mode present in Bus Pirate firmware v5.5 or newer
Corresponding to flashrom svn r1621.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-11-01 23:38:51 +00:00
Kyösti Mälkki
c31243e173 Add support for Winbond W39F010/W39L010/W39L020
W39F010 is a 128kB parallel 5V flash chip, 16k bootblocks.
W39L010 is a 128kB parallel 3.3V flash chip, 8k bootblocks.
W39L020 is a 256kB parallel 3.3V flash chip, 64k/16k bootblocks.

The W39F010 code was tested with a satasii programmer. The first write
attempt after an erase returned with verify failure, but the second
write attempt was succesful:
http://paste.flashrom.org/view.php?id=1418

Corresponding to flashrom svn r1620.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-28 01:50:08 +00:00
Stefan Tauner
78ffbeaa02 Do not read the flash chip twice in verification mode
Kyösti Mälkki noticed that we unnecessarily read the flash chip twice when
called with --verify. The first one is the mandatory read before everything
(to be able to detect the seriousness of errors), but the second one is not
necessary because we can just use the former for the comparison.

This introduces a small output change: previously we printed ERASE or
VERIFY depending on the callee. This special case has been dropped
because it is unnecessary to print it (and wrong for the verification
function to need to know why it is verifying exactly).
If an erase fails we mention that fact explicitly already, similar for verify.

Corresponding to flashrom svn r1619.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 15:36:56 +00:00
Stefan Tauner
92fefc921a serprog: add opcode to control the programmer's output drivers
This allowed me to let the clips remain attached on my D946GZIS while
playing with coreboot/serialice.

Corresponding to flashrom svn r1618.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 00:34:23 +00:00
Stefan Tauner
0d82e952f2 serprog: move the macro list to its own header file
Corresponding to flashrom svn r1617.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 00:34:18 +00:00
Stefan Tauner
94b39b47e4 Add support for Atmel AT26DF041
Wicked chip: No WRSR, no write enable command (but swallows our
default one without a problem), supports an auto-erasing page write
(but even without that page writes are recommended to write the
whole page i.e. operate on a completely erased page), mad
requirements on block refreshments if only partly written.

Found on my Intel D946GZIS and tested with my serprog in situ.
Using the page write by setting JEDEC_BYTE_PROGRAM to 0x11 and using
the spi_chip_write_256 command greatly improves performance and works
flawlessly.

Corresponding to flashrom svn r1616.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 00:06:02 +00:00
Stefan Tauner
d956f82249 Add support for Numonyx N25Q016 and N25Q032
The 32Mb version has 1.8V and 3.0V versions, the smaller one 1.8V only
(or Numonyx/Micron forgot to publish it). Another difference is that the
16Mb chip has 32 kB subsectors (erase opcode 0x52). As long as there
are no funky configurations like for the 128Mb chips, we got the smaller
parts covered with this change.

Corresponding to flashrom svn r1615.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-26 16:49:15 +00:00
Niklas Söderlund
ede2fa4d1e Remove exit calls from print_supported_chips
Propagate the error code using return values instead, but let cli_classic.c
still decide the ultimate return value of the process.
Also, remove setting the ret value again after print_supported_wiki() - 
success is the default.

Corresponding to flashrom svn r1614.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-23 13:06:46 +00:00
Stefan Tauner
d7d423bbc1 Add a bunch of new/tested stuff and various small changes 15
Tested Mainboards:
OK:
 - Foxconn P55MX
   http://www.flashrom.org/pipermail/flashrom/2012-October/010002.html

Tested flash chips:
 - Eon EN25F64 to PR (+PR)
   http://paste.flashrom.org/view.php?id=1426
 - Macronix MX25L1005 to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2012-October/010004.html
 - Set SST39VF512 to PREW (+W)
   http://www.flashrom.org/pipermail/flashrom/2012-September/009958.html

Tested chipsets:
 - Z77 (only reading was really tested)

Miscellaneous:
 - Fix ft2232_spi's parameter parsing.
 - Fix nicrealtek's init (always segfaulted since r1586 oops).
 - Add another T60 variant to the laptop whitelist.
 - Improve message shown when image file size does not match flash chip
 - Refine messages regarding the flash descriptor override strap according
   to the findings by Vladislav Bykov on his P55MX.
 - Fix the ID of EN25F64.
 - Demote and clarify debug message in serprog_delay().
 - Minor other cleanups.

Corresponding to flashrom svn r1613.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-20 09:13:16 +00:00
David Hendricks
99f947ddc8 Differentiate Numonyx N25Q064 1.8V and 3.0V versions
This patch differentiates between the N25Q064 1.8V version and 3.0V
version which have different JEDEC IDs.

It extends the chip name to include more characters of the part
number. The first two of those characters indicate the process
technology (65nm) and feature set (hold pin etc.), neither of which
matter for flashrom at the moment. The third and fourth characters
specify voltage and block/sector size and uniformity, which are
important and hence included.

To abstract the irrelevant portions of the part number leading up to
the characters we care about, dots are used. This helps prevent
unwanted changes in chip name that can break fragile scripts and
confuse people. More about this schema here:
http://www.flashrom.org/pipermail/flashrom/2012-July/009595.html

Corresponding to flashrom svn r1612.

Signed-off-by: David Hendricks <dhendrix@google.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-04 14:41:20 +00:00
Stefan Tauner
9e349e43c4 Add support for SST's 25WF series of SPI flash chips
This includes SST25WF512, SST25WF010, SST25WF020 and SST25WF040.
They require a VCC of 1.65 - 1.95V, which is why i could not test them.
The SOIC version of the SST25WF512 is used on an AMD X300-based
graphics card i own.

Corresponding to flashrom svn r1611.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-01 22:45:08 +00:00
Stefan Tauner
3e515e2883 Cleanup ft2322.c and add more detail to error messages
- Use libftdi's error string to add more detail.
 - Add full stops to messages.
 - Minor white space fixes.

Corresponding to flashrom svn r1610.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-26 00:48:16 +00:00
Ilya A. Volynets-Evenbakh
2c714ab224 Add support for FT232H
For older versions of libftdi we define TYPE_232H ourselves and this
seems to be enough to get at least basic support (and we don't need
more than that AFAICT).

Corresponding to flashrom svn r1609.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-26 00:47:09 +00:00
Stefan Tauner
fbc71ac494 Add support for all 4 possible channels to the ft2232_spi programmer
Add a check to validate the selected channel/interface, which not even
libftdi seems to do yet.
This patch changes default behavior: the new default channel/interface is A.
Also, this patch uses the word 'channel' in addition or in place of 'interface'
where possible without too much hassle because it is the term FTDI uses.

Corresponding to flashrom svn r1608.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-26 00:46:02 +00:00
Stefan Tauner
fd0d413537 Introduce a compile time option to select a default programmer
Heavily influenced by a discussion with (and based on code from) Peter Stuge.
Please read the comment in the Makefile before using this option.

Corresponding to flashrom svn r1607.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Peter Stuge <peter@stuge.se>
2012-09-25 21:24:55 +00:00
Stefan Tauner
98feaa5c2c Whitelist known working Thinkpads of the T60 and X60 series
This should get rid of the need to specify the laptop force
parameter on T60 and X60 series Thinkpads (including T60s and X60s)
that are using one of the Intel 94x northbridges and are known to have
no interfering EC. Please note that although the EC is no problem, flashrom
is not able to access the entire flash chip with the vendor BIOS, see the
coreboot wiki for details: http://www.coreboot.org/Lenovo_x60x

Corresponding to flashrom svn r1606.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
2012-09-25 21:08:41 +00:00
Stefan Tauner
fa9fa7131a Fix flashrom running on boards with coreboot
In r1577 we removed the discrimination of coreboot IDs and user-specified
mainboards. The problem is that the board enable code required to find
a board enable if either of these model strings were set. Therefore boards
running coreboot that do not need a board enable failed to execute flashrom
since then. This patch fixes this by handling coreboot IDs and user-supplied
IDs differently again.

Corresponding to flashrom svn r1605.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2012-09-24 21:29:29 +00:00
Stefan Tauner
4e6d346c6e Fix memleaks in dmi.c
In dmi_init() we populate static char *dmistrings[] with values that get
later compared in dmi_match(). Those strings are actually strduped in
get_dmi_string() and hence need to be freed later. This patch accomplishes
this by registering another shutdown method. Also, the tangling pointers are
nulled when the memories are freed.

This bug was found thanks to valgrind.

Corresponding to flashrom svn r1604.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-09-23 12:14:28 +00:00