1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

1895 Commits

Author SHA1 Message Date
Stefan Tauner
03a9c3c1bb Add support for a bunch of 29GL parallel flash chips
29GL chips use a new 3-Byte device ID probing function at addresses
0x01, 0x0E, 0x0F.

Flash chip families supported by this method include...
 - EON EN29GL
 - Gigadevice GD29GL (if they really exist)
 - ISSI (PMC) IS29GL
 - Macronix MX29GL (+MX68GL1G0F)
 - Spansion S29GL (+S70GL02G)
 - Winbond W29GL

This patch adds respective flash chip definitions for chips up to 16 MB from
Eon, ISSI, Macronix and Winbond. Bigger chips as well as those from
Gigadevice and Spansion are left out.

Corresponding to flashrom svn r1835.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-08-03 14:15:14 +00:00
Stefan Tauner
7de939325b Add support for Atmel AT49LH004 and AT49LH00B4
Also, slightly refine the definition of AT49LH002.

Corresponding to flashrom svn r1834.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-08-03 13:05:45 +00:00
Carl-Daniel Hailfinger
ef3ac8ac17 Refactor unlocking of many chips with locking at register space address +2
This includes PMC Pm49*, SST 49LF00*, ST M50* and Winbond W39* families.
The erase and write test status bits of all affected chips have been reset.

Corresponding to flashrom svn r1833.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-08-03 13:05:34 +00:00
Ricardo Ribalda Delgado
2a41f0a2c0 Add new programmer for SPI EEPROMs attached to Intel 82580 NICs
This patch lets you read and write the EEPROM on 82580-based gigabit NIC
cards. So far it has been tested on copper NICs only, but other variants
employing this controller should work too.
It is a nice substitution for the official eeupdate tool.

Speed is quite decent: less than 4 seconds for erases or writes of 32 kB.

Corresponding to flashrom svn r1832.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-28 20:35:21 +00:00
Carl-Daniel Hailfinger
a5bcbceb58 Rename programmer registration functions
Register_programmer suggests that we register a programmer. However,
that function registers a master for a given bus type, and a programmer
may support multiple masters (e.g. SPI, FWH). Rename a few other
functions to be more consistent.

Corresponding to flashrom svn r1831.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-19 22:03:29 +00:00
Martin Roth
82b6ec1df3 Add support for AMD Bolton chipset
SPI controller on the bolton chipset uses the same 3-bit speed
settings as Yangtze, but is otherwise the same as the Hudson chips.
Note that the Bolton RRG doesn't specify a speed setting for the bit
setting of 0b111, so I'm assuming that it's the same setting as
Yangtze.

Corresponding to flashrom svn r1830.

Signed-off-by: Martin Roth <martin.roth@se-eng.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-15 13:50:58 +00:00
Stefan Tauner
0e0a0dc05d Refine messages regarding AMD FCH flash protections
Corresponding to flashrom svn r1829.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-15 13:50:17 +00:00
Dima Veselov
9d8f53d870 Add Board Enable for ASUS Vintage 2 PH1 (P5LD2-MQ)
ASUS Vintage 2 PH1 barebone systems have a mainboard from the P5LD2 series,
namely the P5LD2-MQ (although it is labeled V2-PH1). Pin 16 GPIO needs to
be raised to enable write/erase like on other boards of the series.
NB: it uses a ICH7DH southbridge and hence requires different PCI IDs.

Corresponding to flashrom svn r1828.

Signed-off-by: Dima Veselov <kab00m@lich.phys.spbu.ru>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-14 18:04:15 +00:00
Stefan Tauner
1687854423 Improve messages on failed erases with default verbosity
Without this...
Erasing and writing flash chip... ERASE FAILED at 0x00001000! Expected=0xff, Read=0xb4, failed byte count from 0x00000000-0x0000ffff: 0xef09
ERASE FAILED!
Reading current flash chip contents... done.
<loooooong break while the next eraser and writing is tried>
Erase/write done.
Verifying flash... VERIFIED.

Even if there is not a long temporal pause, it is very confusing for
the user to first see a failed erase, followed by a read, a done
message and eventually the verification message.
This patch inserts "Looking for another erase function." where there is
just a silent pause above.

Corresponding to flashrom svn r1827.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-13 23:53:40 +00:00
Stefan Tauner
eff156ef6c Fix Intel FWH IDSEL message printing
This should get rid of extra and/or missing line breaks in verbose(+)
output on Intel chipsets.

Corresponding to flashrom svn r1826.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-13 17:06:11 +00:00
Daniele Forsi
6a18a93bd5 Add support for Macronix MX29F022(N)B and MX29F022(N)T
The MX29F022(N)T definition was successfully tested by Daniele.

Corresponding to flashrom svn r1825.

Signed-off-by: Daniele Forsi <dforsi@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-13 14:53:45 +00:00
Stefan Tauner
9972d15e12 Fix garbage handling in DMI strings
Previously we tried to replace garbage characters with <space> directly in
the read-only memory-mapped SMBIOS area(!). This could never have
worked for any DMI strings with garbage and results in a segfault on
machines with such strings.

Thanks to Brian Rak (Supermicro X10SLE-F) and John Pohlman (HP XW9400)
for reporting this issue.

With this patch the strings are duplicated within dmi_string() already,
just before we sanitize them. Also, the limit variable used everywhere
points to the first invalid byte address. Refine respective checks
accordingly.

Corresponding to flashrom svn r1824.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-07-13 12:52:15 +00:00
Martin Roth
440057a82e Add support for Macronix MX25U12835F
Corresponding to flashrom svn r1823.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-07-13 00:05:07 +00:00
Carl-Daniel Hailfinger
1b0e9fc8ea EEPROM support: handle implicit erase
Add support for EEPROMs with 1 byte granularity and implicit erase on
write. flashrom will not try to erase before write on these chips.
Explicitly requested erase with -E is done by writing 0xff.

Corresponding to flashrom svn r1822.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-16 22:36:17 +00:00
Stefan Tauner
600576b43d Add selfcheck_board_enables()
Check for NULL termination of the array, that each board has the two
main PCI ID sets defined, that coreboot vendor and model fields are either
both set or unset, and that at least either an enable function or a max
decode size is available.

Corresponding to flashrom svn r1821.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-12 22:57:36 +00:00
Stefan Tauner
7ba3d6ce16 Remove MCP6/7/8 SPI log requests
We got enough (and no one is looking at them for the time being anyway).
Also, return an error code in the case no bus type could be detected.

Corresponding to flashrom svn r1820.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-12 21:07:03 +00:00
Stefan Tauner
6ad6e01e9b Introduce helpers.c
Move some suitable functions there, add it to the Makefile, but leave the
declarations in flash.h for now.

Corresponding to flashrom svn r1819.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-12 00:04:32 +00:00
Stefan Tauner
a60d408a78 Add support for Sanyo LE25FW106
Also, add spi_disable_blockprotect_bp1_srwd().

Originally written and tested by The Raven <originalraven@hotmail.com>.

Corresponding to flashrom svn r1818.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-04 16:17:03 +00:00
Stefan Tauner
2a10e70cd3 print_wiki.c: there is only one way to represent time
ISO 8601.

Corresponding to flashrom svn r1817.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-02 00:46:02 +00:00
Stefan Tauner
05aa0f4014 print_wiki.c: refine header and include a legend explaining the test state representation
Corresponding to flashrom svn r1816.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-02 00:45:57 +00:00
Stefan Tauner
428ba2b807 Utilize new tested states for chipsets as well
Mark all ME-enabled Intel chipsets as DEP, alter print.c accordingly
(print_wiki.c was already prepared). And realign the chipset enable
table when we are at it already.

Corresponding to flashrom svn r1815.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-02 00:34:58 +00:00
Stefan Tauner
265fcac1b6 Add default arguments for the default programmer (only)
This code exists thanks to food for thought from Urja Rannikko.

Corresponding to flashrom svn r1814.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-02 00:12:23 +00:00
Stefan Tauner
0ccec8f212 Move global io_base_addr into compilation units
Corresponding to flashrom svn r1813.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-01 23:49:03 +00:00
Kyösti Mälkki
72d42f87a9 Add IT8212F as programmer
This PCI PATA controller can use 3V parallel flash up to 128 kB.

My card was identified as:
  PCI 1283:8212, subsystem 1283:0001.

and labelled as:
  Innovision Multimedia LTD.
  EIO ATA133 RAID
  (DM-8401 Ver A)

This particular card did not require setting of any GPIO signals to
enable flash writing. My card has Pm39LV512 in PLCC32 package without
socket.

Rebased by Stefan (automatic cleanup, some PCI changes, changed
enable bit handling). Committed with test state NT because the
rebased version was not tested on real hardware (yet).

Corresponding to flashrom svn r1812.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-01 23:48:31 +00:00
Stefan Tauner
4f094750fa atavia: Fix a few problems overlooked/introduced while rebasing
Corresponding to flashrom svn r1811.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-01 22:36:30 +00:00
Stefan Tauner
c9d8b27825 Add support for Atmel (now Adesto) AT25DL081 and AT25DL161
Corresponding to flashrom svn r1810.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-01 13:22:35 +00:00
Jonathan Kollasch
7f0f3fab45 Add VIA VT6421A LPC programmer driver
Due to the mysterious address handling of this chip the user can specify
a base address with the offset parameter, e.g.:
flashrom -p atavia:offset=0xFFF00000

Thanks to Idwer Vollering for his iterative testing of this code, as well as to
Martijn Bastiaan who did the last tests before merging.

Corresponding to flashrom svn r1809.

Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-06-01 10:26:23 +00:00
Stefan Tauner
f2756fa240 Combine block_erase*_en29lv640b and block_erase*_m29f400bt respectively
This patch combines two identical block and chip erase functions respectively:
 - Merge block_erase_m29f400bt and block_erase_en29lv640b into
   erase_block_shifted_jedec.
 - Merge block_erase_chip_m29f400bt and block_erase_chip_en29lv640b into
   erase_chip_block_shifted_jedec.

Leave their implementations in en29lv640b.c for now.

Corresponding to flashrom svn r1808.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-01 02:21:02 +00:00
Stefan Tauner
1181ee251a print.c: improve device printing
Add headers and columns (i.e. print device entries in a table-like manner).
Also, add and use test_state_to_text() to support the new test states.

Corresponding to flashrom svn r1807.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-06-01 02:13:23 +00:00
Stefan Tauner
becda742dc Fix PMC Pm25LV512 and Pm25LV010 probing
Apparently PMC did not understand the purpose of the JEDEC
continuation code. These chips reply to RES (the only supported ID
command) with the prefix-less vendor ID, a device ID, eventually
followed by the continuation byte for the vendor ID.

This fix uses only the first two bytes instead of appending the
continuation code to the device ID. The problem was reported by The
Raven who also tested the fix on a Pm25LV010 (with an imprint of
"Pm25LV010E").

Corresponding to flashrom svn r1806.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-30 19:34:00 +00:00
Stefan Tauner
0ab1e5d5e3 jedec.c: constify a bit more
Also, include chipdrivers.h to find conflicting types between exported
declarations and actual implementations.

Corresponding to flashrom svn r1805.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-29 11:51:24 +00:00
Stefan Tauner
618d897201 print_wiki: simplify template handling
Add test_state_to_template() and use it everywhere to select the correct
template. This also enables the use of the new states in all tables.

Corresponding to flashrom svn r1804.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-28 13:02:13 +00:00
Stefan Reinauer
0df844668f CID1129998/1129999: Unchecked return value from library
Check return values of various fcntl() invocations in
serialport_config(), serialport_read_nonblock() and
serialport_write_nonblock().

Also, remove some superfluous print conversion specifiers and refine
messages.

Corresponding to flashrom svn r1803.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-27 22:10:15 +00:00
Stefan Tauner
12f3d51a8e Rename some spi_prettyprint_status_register_* functions
Spi_prettyprint_status_register_default_bpX ->
spi_prettyprint_status_register_bpX_srwd

Why was the default in there anyway? :)

Corresponding to flashrom svn r1802.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-27 21:27:27 +00:00
Stefan Tauner
85f09f72f1 Add support for ESMT F25L32PA
Corresponding to flashrom svn r1801.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-27 21:27:14 +00:00
Stefan Tauner
df64a42d6d Fix various tiny problems in verify_range()
First of all, fix CID1130010: Resource leak as reported by Stefan Reinauer.
Alternatively to Stefan's approach, just move the malloc() out of the scope.

Additionally, get rid of an unnecessary exit(1) and correctly return -1 in all
error cases as documented.

Corresponding to flashrom svn r1800.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-27 00:06:14 +00:00
Stefan Tauner
96658be407 Fix selfcheck of various arrays
Stefan Reinauer has reported ridiculous NULL checks for arrays in our
self_check function found by Coverity (CID1130005). This patch removes
the useless checks but keeps and fixes the one responsible for the
flashchips array by exporting the array size in a new constant.

Corresponding to flashrom svn r1799.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-05-26 22:05:31 +00:00
Stefan Tauner
6455dff07b Add two new states to enum test_state and use it for flashchips
The new enum test_state looks like this:
enum test_state {
	OK = 0,
	NT = 1,	/* Not tested */
	BAD,	/* Known to not work */
	DEP,	/* Support depends on configuration (e.g. Intel flash descriptor) */
	NA,	/* Not applicable (e.g. write support on ROM chips) */
};

The second new state 'NA' is introduced, among other things, to indicate
the erase and write states of real ROMs correctly. This is also implemented
by this patch and required to exchange the previous bit mask in struct
flashchip with a new struct containing an enum test_state for each operation.
The -L output is changed accordingly to print '-' in the case of an N/A state
and the wiki output uses a new template producing a greyed out cell.
Previous users of enum test_state are not affected by this change (yet).

Corresponding to flashrom svn r1798.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2014-05-26 00:36:24 +00:00
Stefan Tauner
ffb0cf649c Constify dediprog's write functions too
I forgot doing so in r1789 which broke compiling the dediprog module with
-Werror (which is default). Thanks to Mike Hibbett for reporting this.

Corresponding to flashrom svn r1797.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-25 07:47:47 +00:00
Stefan Tauner
33491b8f21 Add support for Sanyo LE25FW406A
No datasheet available. Tested read, write and all erasers separately by
The Raven. He did also provide the patch but refused to sign it off.

Corresponding to flashrom svn r1796.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-18 21:36:04 +00:00
Stefan Tauner
21071b00e3 sbxxx: Add spispeed parameter
Allow to set the SPI clock frequency on AMD chipsets with a programmer
parameter. If the parameter is given (and matches a possible value), the
SPI clock is set temporarily. Both registers are restored on programmer
shutdown.

Example: ./flashrom -p internal:spispeed="33 MHz" -V

Possible values for spispeed are "16.5 MHz", "22 MHz", "33 MHz", "66 MHz",
"100 MHZ" and "800 kHz" depending on the chipset generation.

Corresponding to flashrom svn r1795.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-16 21:39:48 +00:00
Wei Hu
31402ee687 sbxxx: Add support for new AMD SPI controller
This patch adds support for the "SPI 100" SPI engine in Yangtze FCHs
(found in Kabini and Temash).

Tested reading/writing on ASRock IMB-A180 and PC Engines' APU board.

Corresponding to flashrom svn r1794.

Signed-off-by: Wei Hu <wei@aristanetworks.com>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-16 21:39:33 +00:00
Stefan Tauner
d5b2aef69d sbxxx: Cleanup
- Move programmer definition to the top.
 - Rewrite array accesses to use indices instead of using pointer arithmetic.
 - Move length check and opcode extraction to a function.
 - Move IMC parameter handling into existing IMC handling function.
 - Split comparing and resetting the FIFO pointer.

Corresponding to flashrom svn r1793.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-16 21:39:28 +00:00
Stefan Tauner
7141b98649 AT45DB: fix read functions
This fixes segfaults on reads (implicit reads on writes too), ouch.
Thanks to The Raven for reporting the problem and testing my patch, and
to Alexander Irenkov for providing a workable fix for it additionally.

There were actually two problems:
1) The loop conditions were bogus which could lead to read errors
   (e.g. on implicit erase verifications).
2) The offset used within the read buffers provided to spi_nbyte_read()
   and memcpy() were not starting at 0 but the offset of the block
   within the flash chip (which has nothing to do with read buffer in
   most cases).

This patch works similarly to Alexander's but is intended to be
more readable.

Corresponding to flashrom svn r1792.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-16 17:52:04 +00:00
Jurij Munda
a1e5374c89 Add support for Sanyo LE25FU406B
It is very similar to LE25FW418A, except for HD_READ support (that
is not implemented in flashrom anyway yet) and allowed voltage range.

Probing, erasing, reading and writing has been tested.

This chip is found on Seagate Constellation hard drives.

Corresponding to flashrom svn r1791.

Signed-off-by: Jurij Munda <jurij.munda@uni-mb.si>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-14 13:19:50 +00:00
Stefan Tauner
a58f6e9b54 Refine messages related to erase/write recovery
We are more verbose inside erase_and_write_flash() although it does not
matter as much as at the end of the whole process in doit().

New output for the non-fatal (i.e. read-protected + successful recovery read) case:

Reading old flash chip contents... done.
Erasing and writing flash chip... spi_block_erase_d8 failed during command execution at address 0x8000
Reading current flash chip contents... done. spi_chip_erase_c7 failed during command execution
FAILED!
Uh oh. Erase/write failed. Checking if anything has changed.
Reading current flash chip contents... done.
Good, writing to the flash chip apparently didn't do anything.
Please check the connections (especially those to write protection pins) between
the programmer and the flash chip. If you think the error is caused by flashrom
please report this on IRC at chat.freenode.net (channel #flashrom) or
mail flashrom@flashrom.org, thanks!

Corresponding to flashrom svn r1790.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-10 09:25:44 +00:00
Mark Marshall
f20b7beff0 Add 'const' keyword to chip write and other function prototypes
Corresponding to flashrom svn r1789.

Inspired by and mostly based on a patch
Signed-off-by: Mark Marshall <mark.marshall@omicron.at>

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-09 21:16:21 +00:00
Stefan Tauner
20da4aa82c Remove programmer_shutdown() from doit()
Because the programmer initialization that has to be called way
earlier and independently elsewhere, it does not make a lot of sense
to deinit within doit(). Also, free the logfile name at the end of
main() to catch more execution paths and because this moves it to
the other cleanup instructions.

Corresponding to flashrom svn r1788.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-07 22:07:23 +00:00
Idwer Vollering
f3607d191a Add support for SST25LF020A
Tested on hardware by Idwer too.

Corresponding to flashrom svn r1787.

Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-07 15:25:04 +00:00
Nikolay Martynov
598968a687 Support for Spansion S25FL132K and S25FL164K
Tested with actual S25FL164K via Arduino SPI.

Corresponding to flashrom svn r1786.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-04 21:44:13 +00:00