summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Refine PMC Pm25LV seriesStefan Tauner2013-04-194-33/+90
| | | | | | | | | | | | | | | | | | | - Add missing bits and resort chips - Refine Pm25LV512(A) and Pm25LV010 Due to manufacturer ID continuation this one needs a new probing function: probe_spi_res3() which should be refactored in the future. The datasheet describes a very weird order of ID bytes: Vendor byte, model byte, vendor continuation byte. Let's pretend we did not read that or the datasheet is bogus (although the datasheet of the successor series describes the same but luckily additionally to RDID). - Add Pm25LV010A This was tested by Chi Zhang: http://paste.flashrom.org/view.php?id=1573 Corresponding to flashrom svn r1670. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Initialize sp_fd and fix baud rate setting on windowsStefan Tauner2013-04-131-2/+2
| | | | | | | Corresponding to flashrom svn r1669. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Get rid of perror()Stefan Tauner2013-04-073-17/+17
| | | | | | | | | | It prints to stderr and that's not what we want necesserily; using msg_*err gives us more control. Corresponding to flashrom svn r1668. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Usleep() is not found in all versions of MinGW, use Sleep() on WindowsMaksim Kuleshov2013-04-053-5/+16
| | | | | | | | | | Handle long sleeps on non-Windows correctly. Corresponding to flashrom svn r1667. Signed-off-by: Maksim Kuleshov <mmcx@mail.ru> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Refine granularity handling in preparation of AT45DB series supportStefan Tauner2013-04-012-25/+63
| | | | | | | | | | | This adds a number of new granularitie and refines the handling of n-byte granularities by extracting the respective code into a helper function which reduces the pain of the above significantly. Corresponding to flashrom svn r1666. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Enable serprog on WindowsStefan Tauner2013-04-012-13/+13
| | | | | | | | | | | | | Sockets are not ported (yet). Tested on Windows 7 with my Atmega32U2 serprog implementation. http://paste.flashrom.org/view.php?id=1566 Corresponding to flashrom svn r1665. 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>
* serial.c: be more pedanticStefan Tauner2013-04-011-16/+44
| | | | | | | | | | Check more return codes and close the file handle in case of errors in sp_openserport(). Corresponding to flashrom svn r1664. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Replace native calls in serprog with wrapper callsStefan Tauner2013-04-012-29/+16
| | | | | | | | | | Read(), write(), usleep() are replaced. Corresponding to flashrom svn r1663. 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>
* Introduce serialport_write_nonblock()Stefan Tauner2013-04-013-14/+78
| | | | | | | | | | | | | It seems useful to have a generic and platform-independent method to read and write to a serial port without blocking. This is the write part. This allows to get rid of the explicit temporary disabling of blocking I/O in serprog's sp_synchronize(). Corresponding to flashrom svn r1662. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Replace sp_sync_read_timeout() with serialport_read_nonblock()Stefan Tauner2013-04-013-24/+75
| | | | | | | | | | | | | | | It seems useful to have a generic and platform-independent method to read and write to a serial port without blocking. This is the read part. It stores the current blocking properties before disabling blocking and restores them after reading. The timeout is implemented as previously by retrying every millisecond until the timeout is reached or enough characters are available. Corresponding to flashrom svn r1661. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* serial.c: round baudrates to valid onesStefan Tauner2013-04-011-40/+63
| | | | | | | | | | | | | | | | | MSDN says: "The baud rate at which the communications device operates. This member can be an actual baud rate value, or one of the following indexes." But it is not specified what happens for different values, so we round down to valid ones (or to the minimum of 9600) by reusing the existing struct baudentry sp_baudtable[] and the new function round_baud(). Do similarly on non-Windows where arbitrary values are not allowed anyway. Corresponding to flashrom svn r1660. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* serial.c: abstract system error printingStefan Tauner2013-04-011-6/+28
| | | | | | | | | | | Windows is awkward. The win32 API does not support errno/strerror as one might expect. Introduce a new msg_* function that alleviates the pain a bit (my head still hurts very badly). Corresponding to flashrom svn r1659. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Add Altera USB-Blaster SPI programmerJames Laird2013-03-276-7/+282
| | | | | | | | | | | | | Adds support for the Altera USB-Blaster programming dongle in Active Serial (AS) mode. Tested on both original product and a clone dongle. Corresponding to flashrom svn r1658. Signed-off-by: James Laird <jhl@mafipulation.org> Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Fix evil twins of Macronix MX25L1605, MX25L3205, MX25L6405Stefan Tauner2013-03-162-26/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to the patch in r1647 this one updates the chips identified as above with references to and data about their respective twins. Unlike previously this one deals with the more evil details. Helge Wagner from GE discovered some problems with chips sharing IDs and proposed a patch to tackle (some of) them, see: http://patchwork.coreboot.org/patch/3709/ That patch was bitrotting in our mailboxes for a long time and it is still not ready for merge, but we increasingly get reports about problems (e.g. http://paste.flashrom.org/view.php?id=1525) regarding these chips and hence must act to ensure users' safety. This patch splits the chip definitions of evil twins into separate ones which correctly declare the respective attributes (the main problems are the erase block sizes for the 0x20 opcode and hence my changes combine different chips with partly different attributes apart from their names as long as the erasers layout it the same). This forces the user to select the (right) chip definition with the -c/--chip parameter and hence will break a number of previously perfectly working environments. 0x2015 is used by and split to - MX25L1605 (64kB sectors in 0x20 erases) - MX25L1605A/MX25L1606E (4kB in 0x20 erases and an additional 0x52 opcode with 64kB blocks) - MX25L1605D/MX25L1608D (4k sectors in 0x20 erases) 0x2016 is used by and split to - MX25L3205/MX25L3205A (64kB 0x20) - MX25L3205D/MX25L3208D (4kB 0x20) - MX25L3206E (4k 0x20, 64k 0x52) 0x2017 is used by and split to - MX25L6405/MX25L6405D (64k 0x20) - MX25L6406E/MX25L6436E (4k 0x20) - MX25L6445E (4k 0x20, 64k 0x52) Bonus: add some minor details to MX25L1635D, MX25L1635E, MX25L3235D, MX25L12805D. Tested with MX25L3206E, MX25L64036E. Corresponding to flashrom svn r1657. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Add support for Intel Lynx Point low-power and WellsburgDuncan Laurie2013-03-152-17/+89
| | | | | | | | | | | | | | New IDs taken from Intel's patches for the Linux kernel. Also, refine original Lynx Point naming etc. Corresponding to flashrom svn r1656. Based on the chromiumos patch Change-Id: I303a05baa80e4449e70d20adf78ebc7128b88d8e Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Add support for Macronix MX25U1635E, MX25U3235E/F and MX25U6435E/FVincent Palatin2013-03-152-0/+126
| | | | | | | | | | | | | | | | | | | | Macronix MX25U3235 is a 4MB (32Mbits) 1.8v SPI flash supporting QPI. Code for it was refined after merging it from chromium: Change-Id: I62c7db070254ba3ec68090e783f57b25a6e8d15a Reviewed-on: https://gerrit.chromium.org/gerrit/44395 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Based on that support for MX25U1635E and MX25U6435E/F was added by Stefan Tauner. Also, add a feature flag for QPI-enabled chips: FEATURE_QPI. Corresponding to flashrom svn r1655. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Add utility to print all chip names in flashchips.h that are not in flashchips.cStefan Tauner2013-03-091-0/+23
| | | | | | | | | | | | | | | This allows to list yet unsupported chips easily. First it tries to find the directory containing the files, then it uses sed to extract the macro names of chips from flashchips.h, greps for them in flashchips.c and prints it if it is not found. If verbose mode is activated by giving at least one additional parameter it prints the chip ID and comment following the macro definition too. Corresponding to flashrom svn r1654. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
* Add (untested) board enable for ASUS P4PE-X/TEStefan Tauner2013-03-042-0/+2
| | | | | | | | | 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>
* Add M25P20-oldKyösti Mälkki2013-03-042-3/+33
| | | | | | | | | | | 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>
* Make write granularity a chip attributeStefan Tauner2013-03-032-3/+3
| | | | | | | 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>
* Add a bunch of new/tested stuff and various small changes 17Stefan Tauner2013-02-227-45/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dedirpog: add a parameter 'spispeed' to set the SPI clock rateNico Huber2013-02-202-60/+81
| | | | | | | | | | | | | | | 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>
* Fix building for MacOSXStefan Tauner2013-02-043-11/+6
| | | | | | | | | | | | | | | | | | - 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>
* Update Macronix MX25L512, MX25L1005, MX25L2005, MX25L4005, MX25L8005Stefan Tauner2013-02-022-21/+26
| | | | | | | | | | | | | | | | | | | | 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>
* Fix duplicate 'const' declaration specifiersStefan Tauner2013-01-154-9/+9
| | | | | | | | | | 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>
* Fix compilation for DOS and non-x86 targetsCarl-Daniel Hailfinger2013-01-081-12/+7
| | | | | | | | | | 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>
* Decouple BAR reading from pci device init, handle errors gracefullyCarl-Daniel Hailfinger2013-01-0513-76/+109
| | | | | | | | | | | | | | | 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>
* Introduce msg_*warnStefan Tauner2013-01-0411-44/+43
| | | | | | | | | | 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>
* Unify PCI init and let pcidev clean itself upStefan Tauner2013-01-0413-41/+44
| | | | | | | | | | | | | | | | | | | 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>
* Add user interface to activate the Bus Pirate pull-up resistorsBrian Salcedo2013-01-032-11/+40
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Add a bunch of new/tested stuff and various small changes 16Stefan Tauner2013-01-0111-89/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Constify parameters and globalsNico Huber2012-12-304-8/+8
| | | | | | | | | | | 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>
* Simplify hwaccess.cPeter Lemenkov2012-12-291-68/+42
| | | | | | | | | | | | | | | | | | 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>
* Add support for Atmel's AT25F series of SPI flash chipsStefan Tauner2012-12-296-10/+250
| | | | | | | | | | | | | | | | | | 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>
* Add support for Intel S33 series flash chipsStefan Tauner2012-12-294-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add a generic SPI block unprotect functionStefan Tauner2012-12-291-109/+39
| | | | | | | | | | | 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>
* Improve SPI status register pretty printingStefan Tauner2012-12-298-731/+760
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* print_wiki.c: print programmers of type OTHER tooStefan Tauner2012-12-271-0/+16
| | | | | | | 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>
* Unify usbdev_status and pcidev_status into dev_entryStefan Tauner2012-12-2717-119/+72
| | | | | | | | | | | | | | | | | | | 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>
* Refactor PCI and USB device status printingStefan Tauner2012-12-276-193/+228
| | | | | | | | | | | | | | | | | 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>
* Add general programmer sanity checksStefan Tauner2012-12-262-4/+29
| | | | | | | | | 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>
* Fix memleaks in cli_classic.cStefan Tauner2012-12-262-1/+19
| | | | | | | | | | | | | | | | | | | 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>
* Add a "device" parameter for DediprogNathan Laredo2012-12-242-6/+45
| | | | | | | | | | | | | | | | | | | | | 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>
* Fix sp_openserport users on WindowsStefan Tauner2012-11-303-3/+3
| | | | | | | Corresponding to flashrom svn r1627. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Idwer Vollering <vidwer@gmail.com>
* Break endless loop in serialport_write()Stefan Tauner2012-11-301-3/+11
| | | | | | | | | | | 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>
* Fix linker flag bug introduced in r1623Carl-Daniel Hailfinger2012-11-291-3/+3
| | | | | | | | | 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>
* Improve --help and friendsStefan Tauner2012-11-243-45/+35
| | | | | | | | | | 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>
* Explicitly detect libusb-0.1 in the MakefileCarl-Daniel Hailfinger2012-11-201-17/+50
| | | | | | | | | | 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>
* Add (untested) board enable for Asus DSAN-DXStefan Tauner2012-11-052-0/+3
| | | | | | | | | | | 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>
* Support the new fast SPI mode present in Bus Pirate firmware v5.5 or newerCarl-Daniel Hailfinger2012-11-011-13/+77
| | | | | | | 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>
OpenPOWER on IntegriCloud