summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix wiki board enable parameter printingCarl-Daniel Hailfinger2010-06-073-9/+10
| | | | | | | | | | The logic was incorrect in one place which had && instead of ||. Move the board info #define B to the file where it is used. Corresponding to flashrom svn r1035. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Create dependencies on the fly rather than in a separate stepStefan Reinauer2010-06-071-9/+6
| | | | | | | Corresponding to flashrom svn r1034. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Fix libpci linkage on NetBSDCarl-Daniel Hailfinger2010-06-041-2/+4
| | | | | | | | | | | | | | NetBSD needs libpciutils (which is called libpci on pretty much every other platform and lives in the pciutils package) and apparently the libpciutils on NetBSD needs the NetBSD-native libpci (no equivalent on other platforms). Thanks to Jonathan A. Kollasch for reporting. Corresponding to flashrom svn r1033. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
* Gcc and clang can check format strings of printf-like functionsCarl-Daniel Hailfinger2010-06-043-3/+4
| | | | | | | | | | | | Since we don't support any other compilers right now, enable that extension unconditionally. Fix the bugs found by format string checking. Corresponding to flashrom svn r1032. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Sean Nelson <audiohacked@gmail.com>
* Internal: introduce processor enables and abort if top/bottom alignment is ↵Carl-Daniel Hailfinger2010-06-044-3/+83
| | | | | | | | | | | | | | | | unknown The internal programmer needs correct information about flash_base and chip window top/bottom alignment on non-x86 before it can be used. Abort any internal programmer action for now until the code is fixed. Add the concept of a processor enable for systems where flashing is impacted by processor settings or processor model. Corresponding to flashrom svn r1031. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Make the 'flashrom --help' output look a bit nicerUwe Hermann2010-06-042-23/+22
| | | | | | | | | | | | | | | | | | Only print "flashrom" as the program name unconditionally, not the full path and program name (e.g. "/home/foo/bar/baz/flashrom" or on Windows "C:\Foo\Bar\Whatever\flashrom.exe"). The path or exact executable name is not really useful to print here, if you managed to run --help you already know it, and it just makes the output look ugly. Also, add a missing newline to make the output look nicer. Finally, revert the "CONFIG_PRINT_WIKI ?= yes" change which accidentally slipped into r1029. Corresponding to flashrom svn r1030. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Fix URLs for GIGABYTE motherboardsPeter Lemenkov2010-06-042-19/+19
| | | | | | | Corresponding to flashrom svn r1029. Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Measure OS timer precision to refine calibrationCarl-Daniel Hailfinger2010-06-031-4/+54
| | | | | | | | | | | | | | | | | | | Do not trust the OS at all and measure timer precision before calibrating the delay loop and use that measurement to get reasonable precision for our own delay code. Print a measurement for a delay of 4x the OS timer resolution. Be precise about how bad the deviation was if we had to recalculate. Tested on Windows XP, 32 bit, built using MinGW by Uwe. Tested on FreeDOS v1.0 Final, 32bit, built using DJGPP 4.3.2 by Idwer. Corresponding to flashrom svn r1028. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Idwer Vollering <vidwer+lists.flashrom@gmail.com>
* Fix bug in wiki printing and whitespaceUwe Hermann2010-06-032-10/+10
| | | | | | | | | | The required "-m" options were not in the wiki output due to a mistake that I think I introduced recently. Corresponding to flashrom svn r1027. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix fallout from r1021 which caused compile failures if only the dummy ↵Carl-Daniel Hailfinger2010-06-031-4/+1
| | | | | | | | | programmer was selected Corresponding to flashrom svn r1026. 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 hp xw9400 board enableMichael Karcher2010-06-012-8/+43
| | | | | | | | | | | Also modifies nvidia_mcp_gpio_set to cope with multiple MCP55 chips on the same board, like on the Tyan S2915-E. Corresponding to flashrom svn r1025. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Adis Salcin <crow@linux.org.ba> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Merge print.c and print_wiki.c board/URL tablesPeter Lemenkov2010-06-013-590/+293
| | | | | | | | | | Also, merge the tables in the output, i.e. there's only one table which contains both known-good and known-bad/untested boards. Corresponding to flashrom svn r1024. Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* So far, we have up to 4 different names for the same thing (ignoring ↵Carl-Daniel Hailfinger2010-05-3113-136/+136
| | | | | | | | | | | | | | | | | | | | | | capitalization) CONFIG_FT2232SPI (makefile config option) FT2232_SPI_SUPPORT (#define) ft2232spi (programmer name) ft2232_spi.c (programmer file) Use CONFIG_* with underscores for makefile config options and #defines and kill the useless _SUPPORT idiom. Use lowercase names with underscores for programmer names and programmer files. With this, you can run "grep -i ft2232_spi" and find everything related to the ft2232_spi driver. Same applies to all other programmers. Corresponding to flashrom svn r1023. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add flashrom.exe unconditionally to the list of files removed at make cleanCarl-Daniel Hailfinger2010-05-301-1/+3
| | | | | | | | | | | This allows users to run make clean without specifying the target architecture. Corresponding to flashrom svn r1022. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <vidwer@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Remove unneeded #include statements completelyCarl-Daniel Hailfinger2010-05-3025-51/+40
| | | | | | | | | | | | | | | Unistd.h was only used to get a definition of NULL in all files. Add our own NULL #define and remove unistd.h from flash.h stdio.h has no place in flash.h, it should be included only in files which really need it. Add #include statements in individual .c files where needed. Replace a few printf with msg_* to eliminate the need for stdio.h. Corresponding to flashrom svn r1021. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Mark the following chip as supportedUwe Hermann2010-05-301-1/+1
| | | | | | | | | | | - Winbond W39V040FA (reported by Guenter <lists@gknw.net>) Read (thus also probe), write (thus also erase), and verify tested. http://www.flashrom.org/pipermail/flashrom/2010-May/003078.html Corresponding to flashrom svn r1020. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Update the status for the following chipsUwe Hermann2010-05-301-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Eon EN25F80 (reported by oops66 <oops66@wanadoo.fr>) Probe and read tested. http://www.flashrom.org/pipermail/flashrom/2010-May/003183.html - AMIC A49LF040A (reported by Guenter <lists@gknw.net>) Read (thus also probe), write (thus also erase), and verify tested. http://www.flashrom.org/pipermail/flashrom/2010-May/003078.html Also reported by Robert Grasso <robert.grasso@modulonet.fr>. http://www.flashrom.org/pipermail/flashrom/2010-May/003006.html - SST SST49LF008A (reported by Marco Giacinti <marcogiacinti@hotmail.it>) Erase tested. http://www.flashrom.org/pipermail/flashrom/2010-May/003010.html - SST SST29EE020A (reported by Anders Jenbo <anders@jenbo.dk>) Write (and thus erase) tested. http://www.flashrom.org/pipermail/flashrom/2010-April/002961.html - SST SST49LF040 (reported by David Westberg <david@uarda.dlinkddns.com>) Probe and read tested. http://www.flashrom.org/pipermail/flashrom/2010-April/002862.html - Winbond W39V080FA (reported by Maciej Żenczykowski <zenczykowski@gmail.com>) All operations tested. http://www.flashrom.org/pipermail/flashrom/2010-April/002863.html - Winbond W29C020C (reported by Urja Rannikko <urjaman@gmail.com>) Erase tested. http://www.flashrom.org/pipermail/flashrom/2010-April/002847.html - PMC Pm39LV010 (reported by Tim Small <tim@seoss.co.uk>) Write (and thus also erase) tested. http://www.flashrom.org/pipermail/flashrom/2010-March/002711.html Corresponding to flashrom svn r1019. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Unlocking for W39V040FAMichael Karcher2010-05-301-1/+3
| | | | | | | Corresponding to flashrom svn r1018. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add support for two-byte RES probesCarl-Daniel Hailfinger2010-05-284-14/+43
| | | | | | | | | | | | Some chips implement the RES (0xab) opcode, but they use a non-standard two byte response instead of the usual one byte response. A two-byte response has the accuracy of REMS and RDID, so don't check for REMS/RDID availability before running a two-byte RES. Corresponding to flashrom svn r1017. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* ichspi: try harder to conform to address restrictionsCarl-Daniel Hailfinger2010-05-284-7/+71
| | | | | | | | | | | | | | ICH SPI can enforce address restrictions for all accesses which take an address (well, it could if the chipset implementation was not broken). Since exploiting the broken implementation is harder than conforming to the address restrictions wherever possible, conform to the address restrictions instead. This patch eliminates a lot of transaction errors people were seeing on chip probe. Corresponding to flashrom svn r1016. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* It seems that this board is actually a 'Pro' versionPeter Lemenkov2010-05-261-1/+1
| | | | | | | | | | | | | At least it's addressed as 'Pro' in the list of boards, which requires board_enable. See also: http://www.flashrom.org/pipermail/flashrom/2009-July/000003.html Corresponding to flashrom svn r1015. Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Sort boards in board-enable table alphabeticallyPeter Lemenkov2010-05-261-7/+7
| | | | | | | Corresponding to flashrom svn r1014. Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Handle the following architectures in generic flashrom codeCarl-Daniel Hailfinger2010-05-2619-15/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - x86/x86_64 (little endian) - PowerPC (big endian) - MIPS (big+little endian) No changes to programmer specific code. This means any drivers with MMIO access will _not_ suddenly start working on big endian systems, but with this patch everything is in place to fix them. Compilation should work on all architectures listed above for all drivers except nic3com and nicrealtek which require PCI Port IO which is x86-only for now. To compile without nic3com and nicrealtek, run make distclean make CONFIG_NIC3COM=no CONFIG_NICREALTEK=no Thanks to Misha Manulis for testing early versions of this patch on PowerPC (big endian) with the satasii programmer. Thanks to Segher Boessenkool for design review and for helping out with compiler tricks and pointing out that we need eieio on PowerPC. Thanks to Vladimir Serbinenko for compile testing on MIPS (little endian) and PowerPC (big endian) and for runtime testing on MIPS (little endian). Thanks to David Daney for compile testing on MIPS (big endian). Thanks to Uwe Hermann for compile and runtime testing on x86_64. DO NOT RUN flashrom ON NON-X86 AFTER APPLYING THIS PATCH! This patch only provides the infrastructure, but does not convert any drivers, so flashrom will compile, but it won't do the right thing on non-x86 platforms. Corresponding to flashrom svn r1013. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Misha Manulis <misha@manulis.com> Acked-by: Vladimir 'phcoder/φ-coder' Serbinenko <phcoder@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
* Mark the following chips as OKUwe Hermann2010-05-251-6/+6
| | | | | | | | | | | | | | | | | | - PMC Pm49FL004 - SST SST49LF020 - SST SST49LF020A - SST SST49LF040B - SST SST49LF080A - Winbond W39V040B I tested all operations on hardware using r997. Only on SST49LF040B write/erase does not seem to work, will investigate later (probe/read works, though). Corresponding to flashrom svn r1012. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Various nicrealtek fixesUwe Hermann2010-05-244-18/+36
| | | | | | | | | | | | | - Add missing entries for 'flashrom -L' output and wiki output. - Add missing entries in the manpage. - nicrealtek.c: Coding style fixes and cosmetics. Corresponding to flashrom svn r1011. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Board enable for IP530Michael Karcher2010-05-241-0/+43
| | | | | | | Corresponding to flashrom svn r1010. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Marc Bertens <mbertens@xs4all.nl>
* Various wiki output improvements as per IRC discussionUwe Hermann2010-05-241-25/+26
| | | | | | | | | | | | | | | | | | | - Use '?3' wiki template (light greenish, not gray) for untested stuff. - Reduce page width a bit to improve readability on smaller screens. - Generalize some functions a bit (pass in how many columns to generate). - Mark untested board-enables as such (were incorrectly marked "OK" so far). - Drop some useless 'valign=top' entries. - Make a few more functions 'static' while we're at it. Corresponding to flashrom svn r1009. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Print found PCI IDs during chipset detectionCarl-Daniel Hailfinger2010-05-221-0/+3
| | | | | | | | | | | | Add debug output of the exact matched chipset PCI ID to keep track of tested PCI IDs for chipsets with one name and multiple IDs. This will help avoid problems similar to the Tyan S2915 OEM undetected flash in the future. Corresponding to flashrom svn r1008. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
* Disable probing for one variant of MCP55 to enable Tyan S2915Carl-Daniel Hailfinger2010-05-221-1/+9
| | | | | | | | | | | | | | | | | | Fix Tyan S2915 OEM board by commenting out MCP55 LPC bridge PCI ID 10de:0361 which is the secondary LPC bridge. The same effect could be achieved by refusing to run enable_flash_mcp55 if the device class is not ISA bridge [0601]. Thanks to Alessandro Polverini, Joel Robertson, Nicolas Aveline, Phil LoCascio and Nils-Helge Garli Hegvik for testing flashrom on hardware and Michael Karcher for analyzing the factory BIOS for clues. In the end, no board enable was needed and it was a pure chipset issue. Corresponding to flashrom svn r1007. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
* Initialize the internal delay function before running programmer initCarl-Daniel Hailfinger2010-05-221-2/+3
| | | | | | | | | The programmer init may need a good host delay function. Corresponding to flashrom svn r1006. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
* Introduce a generic SPI read function: spi_write_chunked()Carl-Daniel Hailfinger2010-05-217-113/+67
| | | | | | | | | | | | | | | Every SPI programmer driver had its own completely different chip write implementation, and all of them were insufficiently commented. Create spi_write_chunked as a copy of spi_read_chunked and convert all SPI programmers to use it. No functional changes except: - Bus Pirate uses 12 Byte writes instead of 8 Byte writes - SB600 uses 5 Byte writes instead of 1 Byte writes Corresponding to flashrom svn r1005. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: David Hendricks <dhendrix@google.com>
* Libpci < 2.2.4 can not store class info in struct pci_devCarl-Daniel Hailfinger2010-05-211-2/+4
| | | | | | | | | Read class info manually and store it in a separate variable. Corresponding to flashrom svn r1004. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add missing nicrealtek.c which was missing from revision 1002 which wasJoerg Fischer2010-05-211-0/+89
| | | | | | | | | Support for Realtek RTL8139 network card flashing. Corresponding to flashrom svn r1003. Signed-off-by: Joerg Fischer <turboj@gmx.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Support for Realtek RTL8139 network card flashingJoerg Fischer2010-05-213-2/+67
| | | | | | | Corresponding to flashrom svn r1002. Signed-off-by: Joerg Fischer <turboj@gmx.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Increase flashrom release number to 0.9.2Carl-Daniel Hailfinger2010-05-191-1/+1
| | | | | | | | | | Corresponding to flashrom svn r1000. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Luc Verhaegen <libv@skynet.be> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Write MSRs in a platform and compiler-independent formAnti Sullin2010-05-171-1/+5
| | | | | | | | | | | Msr_t memory layout may depend on compiler; with optimizations this may lead to writing incorrect data to MSR. Create a temporary buffer with correct layout to avoid this problem. Corresponding to flashrom svn r999. Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
* Fix assorted documentation, frontend and printing bugsCarl-Daniel Hailfinger2010-05-157-106/+197
| | | | | | | | | | Change the command line interface to make file names positional. Add more sanity checks to the command line parser. Corresponding to flashrom svn r998. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
* Convert various prints to use msg_p* and msg_g* respectivelySean Nelson2010-05-0710-317/+308
| | | | | | | | | Convert programmer print messages to msg_p* convert general print messages to msg_g* a few fixes as suggested by Carl-Daniel. Corresponding to flashrom svn r997. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* One of the problems is that --force had multiple meaningsCarl-Daniel Hailfinger2010-04-288-50/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Force chip read by faking probe success. - Force chip access even if the chip is bigger than max decode size for the flash bus. - Force erase even if erase is known bad. - Force write even if write is known bad. - Force writing even if cbtable tells us that this is the wrong image for this board. This patch cleans up --force usage: - Remove any suggestions to use --force for probe/read from flashrom output. - Don't talk about "success" or "Found chip" if the chip is forced. - Add a new internal programmer parameter boardmismatch=force. This overrides any mismatch detection from cbtable/image comparisons. - Add a new internal programmer parameter laptop=force_I_want_a_brick. - Adjust the documentation for --force. - Clean up the man page a bit whereever it talks about --force or laptops. Additional changes in this patch: - Add warnings about laptops to the documentation. - Abort if a laptop is detected. Can be overridden with the programmer parameter mentioned above. - Add "Portable" to the list of DMI strings indicating laptops. - Check if a chip specified with -c is known to flashrom. - Programmer parameter reliability and consistency fixes. - More paranoid self-checks. - Improve documentation. Corresponding to flashrom svn r996. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
* Fix the DOS portRudolf Marek2010-04-253-75/+33
| | | | | | | | | | | | Now the DS selector limit is set to 4GB and all mmio accesses goes through DS, the 1:1 mapping is fixed so the _DS base is taken onto account. Plus is that the hwaccess.c needs no change and memcpy etc can be used on mmaped space. Corresponding to flashrom svn r995. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add support for Winbond W25Q80, W25Q16 and W25Q32Rudolf Marek2010-04-202-0/+105
| | | | | | | | | I tested read/write/probe with W25Q80. Corresponding to flashrom svn r994. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: David Hendricks <dhendrix@google.com>
* Add board enable for ABit NF7-SMichael Karcher2010-04-112-0/+10
| | | | | | | | Corresponding to flashrom svn r993. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Tom Brand <worntreads@sbcglobal.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Reinitialize the delay loop upon recalibrationUrja Rannikko2010-04-091-1/+2
| | | | | | | | | Fix an unescaped % in a format specifier. Corresponding to flashrom svn r992. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Intel 28F004/28F400 supportMichael Karcher2010-04-034-37/+133
| | | | | | | | | | | | | | | | | Remove blockwise write for i82802ab chips. It will be reintroduced in post-0.9.2 in a generic way. This is needed to fix FWH-like chips with non-uniform sectors. These are: Intel 28F001 Sharp LHF00L04 ST M50FW002 ST M50LPW116 Corresponding to flashrom svn r991. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Refine and fix the delay loop calculationCarl-Daniel Hailfinger2010-03-311-13/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current delay loop calculation is still from revision 1 of flashrom, and since then it had a logic bug which caused all delays to be twice as long as intended. Fix the delay duration. Protect against delay loop overflows. Detect a non-working delay loop. Change the delay loop itself to ensure clever compiler optimizers won't eliminate it (as happens with clang/llvm in the current code). Some people suggested machine-specific asm, but the empty asm statement with the loop counter as register/memory input has the benefit of being perfectly cross-platform and working in gcc and clang. If time goes backwards (catastrophical NTP time difference, manual time change), timing measurements were shot because the new-old time subtraction yielded negative numbers which weren't handled correctly because the variable is unsigned. Work around that issue (a fix is mathematically impossible). If time goes forward too fast, pick the biggest possible timing measurement with a guaranteed overflow avoidance for all timing calculations. Check four times if the calculated timing is at most 10% too fast. This addresses OS scheduler interactions, e.g. being scheduled out during measurement which inflates measurements. If the timing looks like garbage, recalculate the timer values up to four times before giving up. Avoid division by zero in rare cases where timing measurements for a 250 ms delay returned 0 us elapsed. Corresponding to flashrom svn r990. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Maciej Pijanka <maciej.pijanka@gmail.com>
* Add ITE IT8720 SPI supportVadim Girlin2010-03-301-2/+6
| | | | | | | | | | | Original patch by Vadim Girlin. Message printing updated by Carl-Daniel Hailfinger. Corresponding to flashrom svn r989. Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com> 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 PMC Pm39LV020 and Pm39LV040Anders Juel Jensen2010-03-271-1/+59
| | | | | | | Corresponding to flashrom svn r988. Signed-off-by: Anders Juel Jensen <andersjjensen@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add runtime and build environment info to the flashrom version messageCarl-Daniel Hailfinger2010-03-272-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses code from Idwer Vollering and Maciej Pijanka. I've added Makefile support and compiler version printing and restructured the code heavily. The code prints runtime system information and buildtime libpci information (I couldn't find any runtime libpci version function). Due to our ability to cross-compile flashrom, buildtime system information from "uname -mrs" doesn't help diagnosing any problems. That's why only libpci and gcc are buildtime info, and the rest is runtime info. Examples: openSUSE 10.3, i686, gcc 4.2.1, with PCI support: flashrom v0.9.1-r971 on Linux 2.6.22.19-0.2-default (i686), built with libpci 2.2.6, GCC 4.2.1 (SUSE Linux) openSUSE 10.3, i686, llvm-clang-2.6.99svn97231, with PCI support: flashrom v0.9.1-r971 on Linux 2.6.22.19-0.2-default (i686), built with libpci 2.2.6, LLVM 1/clang 1 openSUSE 11.1, x86_64, gcc 4.3.2, with PCI support: flashrom v0.9.1-r972 on Linux 2.6.27.29-0.1-default (x86_64), built with libpci 3.0.1, GCC 4.3.2 [gcc-4_3-branch revision 141291] openSUSE 10.3, i686, gcc 4.2.1, without PCI support: flashrom v0.9.1-r971 on Linux 2.6.22.19-0.2-default (i686), built with GCC 4.2.1 (SUSE Linux) Windows/cygwin, i686, gcc 4.3.4, without PCI support: flashrom v0.9.1-r973 on CYGWIN_NT-5.1 1.7.1(0.218/5/3) (i686), built with GCC 4.3.4 20090804 (release) 1 FreeBSD 8.0, i386, gcc 4.2.1, with PCI support: flashrom v0.9.1-r973 on FreeBSD 8.0-RELEASE-p2 (i386), built with libpci 3.1.7, GCC 4.2.1 20070719 [FreeBSD] Corresponding to flashrom svn r987. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Idwer Vollering <vidwer@gmail.com> Acked-by: Maciej Pijanka <maciej.pijanka@gmail.com>
* The delay loop is probably one of the oldest pieces of codeCarl-Daniel Hailfinger2010-03-271-13/+29
| | | | | | | | | | Clean up code duplication and measure timing of 10/100/1000/10000 us delays. Corresponding to flashrom svn r986. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Maciej Pijanka <maciej.pijanka@gmail.com>
* Polish the flashrom code comments and outputs a bitUwe Hermann2010-03-2510-43/+43
| | | | | | | | | | | - Fix a number of typos (found via ispell). - Use correct vendor names (as per their websites) consistently. Corresponding to flashrom svn r985. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
OpenPOWER on IntegriCloud