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

337 Commits

Author SHA1 Message Date
Carl-Daniel Hailfinger
cbf563cbde Support reads of arbitrary range
That means you can tell flashrom to read exactly bytes 12345-56789
(start 12345, length 44445) and it will not fetch a single byte more.

Uwe tested this on one LPC, one SPI, and one parallel flash board.

Corresponding to flashrom svn r596.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-16 08:55:44 +00:00
Carl-Daniel Hailfinger
30f7cb2f3c Flashrom only checks for very few chips if the erase worked
And even when it checks if the erase worked, the result of that check is
often ignored.

Convert all erase functions and actually check return codes
almost everywhere.
Check inside all erase_* routines if erase worked, not outside.
erase_sector_jedec and erase_block_jedec have changed prototypes to
enable erase checking.

Uwe successfully tested LPC on an CK804 box and SPI on some SB600 box.

Corresponding to flashrom svn r595.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-15 17:23:36 +00:00
Carl-Daniel Hailfinger
0845464499 Split flashchips.h from flash.h
Flash.h not only contains function prototypes and general settings, it
also has a huge chunk of chip and vendor IDs in the middle.

Split them out into a separate flashchips.h and adjust #include wherever
needed.

Corresponding to flashrom svn r594.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
2009-06-15 14:14:48 +00:00
Carl-Daniel Hailfinger
a0a6ae9593 Add or refine support for a number of EON flash chips
Fix the vendor ID of EN25B05, EN25B10, EN25B20, EN25B40, EN25B80,
EN25B16, EN25B32, EN25B64 EN25F40, EN25F80, EN25F16.

Add support for EN25P05, EN25P10, EN25P20, EN25P40, EN25P80, EN25P16,
EN25P32, EN25P64 EN25D16 EN25F05, EN25F10, EN25F20, EN25F32

Corresponding to flashrom svn r592.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-15 12:10:57 +00:00
Uwe Hermann
f983d9ffea Add support for the PMC Pm29F002T/B chips
I sucessfully tested all operations on a Pm29F002T chip. The Pm29F002B is
untested but I assume it should also work.

Corresponding to flashrom svn r590.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-06-14 21:53:26 +00:00
Carl-Daniel Hailfinger
38a059d6ef Every SPI host controller implemented its own way to read flash chips
This was partly due to a design problem in the abstraction layer.

There should be exactly two different functions for reading SPI chips:
- memory mapped reads
- SPI command reads.

Each of them should be contained in a separate function, optionally
taking parameters where needed.

This patch solves the problems mentioned above, shortens the code and
makes the code logic a lot more obvious.

Since open-coding the min() function leads to errors, include it in this
patch as well.

Corresponding to flashrom svn r589.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
2009-06-13 12:04:03 +00:00
Mateusz Murawski
e33890dcad Add #defines for some flash chips
Add timing info to some flash chips.

Corresponding to flashrom svn r584.

Signed-off-by: Mateusz Murawski <matowy@tlen.pl>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-06-12 11:45:10 +00:00
Paul Fox
eb3acef863 Add spi_nbyte_program as generic function to the SPI layer
Corresponding to flashrom svn r583.

Signed-off-by: Paul Fox <pgf@laptop.org>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-06-12 08:10:33 +00:00
Carl-Daniel Hailfinger
80243c908a Add all Eon EN25* SPI chips
Some IDs were already in flash.h. EN25B05 EN25B10 EN25B20 EN25B40
EN25B80 EN25B16 EN25B32 EN25B64 EN25F40 EN25F80 EN25F16

EN25P* are supported as well, but they seem to be identical to EN25B.

Corresponding to flashrom svn r580.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
2009-06-05 20:53:07 +00:00
Carl-Daniel Hailfinger
0bd2a2bdc1 Sometimes we want to read/write more than 4 bytes of chip content at once
Add chip_{read,write}n to the external flasher infrastructure which
read/write n bytes at once.

Fix a few places where the code used memcpy/memcmp although that is
strictly impossible with external flashers.
Place a FIXME in the layout.c code because usage is not totally clear
and needs to be fixed to support external flashers.

As a nice side benefit, we get a noticeable speedup for builtin flash
reading which is now a memcpy() of the full flash area instead of a
series of single-byte reads.

Corresponding to flashrom svn r579.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-05 18:32:07 +00:00
Carl-Daniel Hailfinger
ca8bfc6c22 Add programmer-specific delay functions
Add external programmer delay functions so external programmers can
handle the delay on their own if needed.

Corresponding to flashrom svn r578.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Urja Rannikko <urjaman@gmail.com>
2009-06-05 17:48:08 +00:00
Maciej Pijanka
c6e1111bed Add probe_timing information (int uS value)
This eliminates the conflicting delay requirements for old and new chips
with the same probing sequence.

Corresponding to flashrom svn r569.

Signed-off-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-06-03 14:46:22 +00:00
Uwe Hermann
e9d04d40ce Mark 3COM "3C905B: Cyclone 10/100/BNC" as fully tested
Also do some random cleanups while I'm at it.

Corresponding to flashrom svn r567.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-02 19:54:22 +00:00
Maciej Pijanka
bc2bbd2851 Add support for the 10b7:9058 3COM NIC (3C905B: Cyclone 10/100/BNC)
Also, add Atmel AT29C512 support.

Both are tested on hardware by Maciej Pijanka.

Corresponding to flashrom svn r566.

Signed-off-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-02 16:45:59 +00:00
Mateusz Murawski
5bae4386ee Unify AMD manufacture_id and model_id
Corresponding to flashrom svn r564.

Signed-off-by: Mateusz Murawski <matowy@tlen.pl>
Acked-by: FENG Yu Ning <fengyuning1984@gmail.com>
2009-06-02 00:38:14 +00:00
Carl-Daniel Hailfinger
3504b539bf Add bus type support to the dummy external programmer
The syntax is explained in the man page.
Example: flashrom -p dummy=lpc,fwh

Tested, works perfectly. ;-)

As a nice benefit, it allows easy testing of the "probe only compatible
flashes" patch.

Corresponding to flashrom svn r559.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-06-01 00:02:11 +00:00
Carl-Daniel Hailfinger
b8afecd0f5 Add IT87xx SPI as external flasher option
This is a fast way to test if a IT87xx board_enable() would work.

Corresponding to flashrom svn r557.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested-by: Harald Gutmann <harald.gutmann@gmx.net>
Acked-by: Harald Gutmann <harald.gutmann@gmx.net>
2009-05-31 18:00:57 +00:00
Carl-Daniel Hailfinger
1dfe0ff174 Add bus type annotation to struct flashchips
Right now, the annotation only differentiates between SPI and non-SPI.
Anyone who knows more about a specific flash chip should feel free to
update it.

The existing flashbus variable was abused to denote the SPI controller
type. Use an aptly named variable for that purpose.

Once this patch is merged, the chipset/programmer init functions can set
supported flash chip types and flashrom can automatically select only
matching probe/read/erase/write functions. A side benefit of that will
be the elimination of the Winbond W29EE011 vs. AMIC A49LF040A conflict.

Corresponding to flashrom svn r556.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-31 17:57:34 +00:00
Urja Rannikko
ebd7b83939 Add support for probe and read of Intel 28F001BX-T and BX-B
Erase & write support wont be this easy - the chips need 12V Vpp
(needs a hardware hack or a supporting mb) and they have a very weird
layout and are old.

Corresponding to flashrom svn r555.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-29 12:55:31 +00:00
Uwe Hermann
d1129ac701 Random flashrom updates
- Add explicit installation instructions in the README.

 - Code cleanups, coding style fixes, drop dead code.

 - Drop duplicate board listings from -L output (some boards were explicitly
   recorded in boards_ok[] _and_ implicitly via the board-enables table.

 - Add MS-xxxx numbers to MSI boards where we can find that info.

 - Fix typo, "K8T Neo2" should have been "K8T Neo2-F" actually, at least
   according to the comment of w83627thf_gpio4_4_raise_2e() which says
   "Suited for: MSI K8T Neo2-F".

Corresponding to flashrom svn r554.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-28 15:07:42 +00:00
Carl-Daniel Hailfinger
09b4fb73f2 Add TI TMS29F002RT and TMS29F002RB probe and read support
Corresponding to flashrom svn r550.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
2009-05-26 21:26:23 +00:00
Carl-Daniel Hailfinger
24c1a16030 Refactor SuperIO accesses
We had duplicated code under different names and even open-coded some
functions in some places.

wbsio_read/regval -> sio_read wbsio_write/regwrite -> sio_write
wbsio_mask -> sio_mask

board_biostar_p4m80_m4 now uses existing IT87 functions.

Corresponding to flashrom svn r547.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Luc Verhaegen <libv@skynet.be>
2009-05-25 23:26:50 +00:00
Uwe Hermann
c6915939d9 Factor out fallback_map/unmap, most external programmers don't need and special handling here
Corresponding to flashrom svn r531.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-17 23:12:17 +00:00
Uwe Hermann
eaefb48ee5 Various smaller flashrom improvements
- Document new 'satasii' programmer in -L output and manpage.

 - Drop PCI_IO_BASE_ADDRESS, pci.h has such #defines already.

 - Beautify flashrom output and make it more consistent.
 
 - Same for the 'make' output (reordered some $CC parameters).
   Build-tested on i386, shouldn't break any builds, I think.

 - Some variable renaming and other cosmetic fixes.

Corresponding to flashrom svn r529.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-17 22:57:34 +00:00
Rudolf Marek
68720c7bed This patch adds support for BIOS flashing on the all SiliconImage SATA controllers
It was easy because

1) flashrom has now nice API 2) documentation is public on the web site

Corresponding to flashrom svn r527.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-17 19:39:27 +00:00
Carl-Daniel Hailfinger
78185dcb3c Use accessor functions for MMIO
Some MMIO accesses used volatile, others didn't (and risked
non-execution of side effects) and even with volatile, some accesses
looked dubious.

Since the MMIO accessor functions and the onboard flash accessor
functions are functionally identical (but have different signatures),
make the flash accessors wrappers for the MMIO accessors.

For some of the conversions, I used Coccinelle. Semantic patch follows:

@@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b
+ a) @@ expression a; volatile uint8_t *b; @@ - *(b) |= (a); + *(b) =
*(b) | (a); @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); +
mmio_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + mmio_readb(b) @@
type T; T b; @@ ( mmio_readb | mmio_writeb ) (..., - (T) - (b) + b )

Corresponding to flashrom svn r524.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Uwe tested read, write, erase with this patch on a random board to make
sure nothing breaks.

Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-17 15:49:24 +00:00
Uwe Hermann
05fab75d73 List all boards which are
- Supported out of the box (no flash enables required)

 - Verifiably not yet working (unknown flash enable)

Also, move some structs to flash.h in preparation for later wiki
output support.

Corresponding to flashrom svn r523.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-16 23:42:17 +00:00
Uwe Hermann
09e04f74c3 Eliminate all 'inline's from the flashrom code
They serve pretty much no purpose, compilers can optimize pretty much
all of what we might mark as inline anyway, _and_ inlines are not
enforced in any way by the compiler either. They're totally unneeded.
Kill them.

Corresponding to flashrom svn r522.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-16 22:36:00 +00:00
Uwe Hermann
2cac6860c3 Drop unused/duplicated #includes and some dead code
Build-tested on 32bit x86.

Corresponding to flashrom svn r521.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-16 22:05:42 +00:00
Uwe Hermann
8403ccb49f Add proper workaround for 3COM 3C90xB cards, which need special fixups (the 3C90xC ones don't)
This is tested on hardware.

Also, add initial support for the Atmel AT29C010A chip (which I inserted
in a 3COM 3C90xB card for testing). It can be detected, read works,
erase works, but write will need some additional code (will post in
another patch later).

Corresponding to flashrom svn r520.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-16 21:39:19 +00:00
Carl-Daniel Hailfinger
5820f42ef2 Introduce a type "chipaddr" to abstract the offsets within flash regions
Use chipaddr instead of volatile uint8_t * because when we access chips
in external flashers, they are not accessed via pointers at all.

Benefits: This allows us to differentiate between volatile machine
memory accesses and flash chip accesses. It also enforces usage
of chip_{read,write}[bwl] to access flash chips, so nobody will
unintentionally use pointers to access chips anymore. Some unneeded
casts are removed as well. Grepping for chip operations and machine
memory operations doesn't yield any false positives anymore.

Compile tested on 32 bit and 64 bit Linux.

Corresponding to flashrom svn r519.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-16 21:22:56 +00:00
Carl-Daniel Hailfinger
9ee107721f Add generic 16 bit and 32 bit chip read/write emulation to the external flasher infrastructure
The emulation works by splitting 32 bit accesses into 16 bit accesses
and 16 bit accesses into to 8 bit accesses. That way, external flashers
can mix and match the amount of emulation they need.

Corresponding to flashrom svn r517.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-16 01:23:55 +00:00
Uwe Hermann
515ab3de05 Refactor parts of the 3COM NIC code
Move the reusable PCI specific parts into pcidev.c, they'll be usable
for other NIC code (Realtek, VIA, ...) and also for SATA/IDE controller
cards as external programmers (for every PCI device which can program
EEPROMs basically).

Also add print_supported_pcidevs() to show the supported PCI devices
(currently only NICs, soon more) in the 'flashrom -L' output.

Corresponding to flashrom svn r515.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-15 17:02:34 +00:00
Carl-Daniel Hailfinger
3b7e75a23e Fix compilation of nic3com on 64bit
Corresponding to flashrom svn r512.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-14 21:41:10 +00:00
Uwe Hermann
a086932cf9 Unify usage of iopl-like code by introducing get_io_perms()
Factor out portable iopl()-style code into a global function which all
programmers can use, add missing close() call.

Corresponding to flashrom svn r511.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-14 20:41:57 +00:00
Christian Ruppert
0cdb0313f1 nic3com: allow selection of a particular PCI device to use as programmer
Add support for users to specify a certain NIC via PCI bus:slot.func
notation, in case there are multiple NICs in one system.

Usage: flashrom -p nic3com=bb:ss.f

Corresponding to flashrom svn r510.

Signed-off-by: Christian Ruppert <spooky85@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-14 18:57:26 +00:00
Carl-Daniel Hailfinger
bfe2e0cf67 Add a dummy SPI controller driver, similar to the dummy LPC/FWH/Parallel flasher driver
Does not support reading or writing the fake chip yet.

flashrom --programmer dummy
also enables the dummy SPI controller driver.

Testing the dummy SPI driver revealed a RDID debug printing bug in the
SPI core. Fix that as well.

Corresponding to flashrom svn r507.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-14 12:59:36 +00:00
Carl-Daniel Hailfinger
3e9dbea1ce There are various reasons why a SPI command can fail
Among others, I have seen the following problems: - The SPI opcode is
not supported by the controller. ICH-style controllers exhibit this if
SPI config is locked down. - The address in in a prohibited area. This
can happen on ICH for any access (BBAR) and for writes in chipset write
protected areas. - There is no SPI controller.

Introduce separate error codes for unsupported opcode and prohibited
address.

Add the ability to adjust REMS and RES addresses to the minium supported
read address with the help of spi_get_valid_read_addr(). That function
needs to call SPI controller specific functions like reading BBAR on
ICH.

Corresponding to flashrom svn r500.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-13 11:40:08 +00:00
Uwe Hermann
b4dcb7188f Add support for 3COM NICs as "external programmer" and Atmel AT49BV512
This allows flashrom to identify, read, write, erase and verify flash chips
on (some) 3COM network cards. The patch uses the external programmer
infrastructure, the network card is basically treated as an external
flash programmer.

Usage:

$ ./flashrom -p nic3com
flashrom v0.9.0-r498
Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400
Calibrating delay loop... OK.
Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000.
No operations were specified.

$ ./flashrom -p nic3com -E
flashrom v0.9.0-r498
Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400
Calibrating delay loop... OK.
Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000.
Erasing flash chip... SUCCESS.

$ ./flashrom -p nic3com -wv backup.bin
flashrom v0.9.0-r498
Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400
Calibrating delay loop... OK.
Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000.
Flash image seems to be a legacy BIOS. Disabling checks.
Programming page: 1023 at address: 0x0000ffc0
Verifying flash... VERIFIED.

$ ./flashrom -p nic3com -r backup.bin
flashrom v0.9.0-r498
Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400
Calibrating delay loop... OK.
Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000.
Reading flash... done.

I have tested this on actual hardware (see PCI IDs above) and all
operations worked fine.

Support for other 3COM cards will follow (I added some more which should
be supportable by this code, but they're untested so far), as well as
support for NICs from other vendors.

The patch also adds support for the Atmel AT49BV512 which is soldered
onto the 3COM NIC I used for testing.

Corresponding to flashrom svn r499.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Mateusz Murawski <matowy@tlen.pl>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-05-13 11:36:06 +00:00
Carl-Daniel Hailfinger
1455b2baea Abstract mapping/unmapping of flash regions
Flash mapping/unmapping was performed without an abstraction layer,
so even the dummy flasher caused memory mappings to be set up. Add
map/unmap functions to the external flasher abstraction.

Fix a possible scribble-over-low-memory corner case which fortunately
never triggered so far.

With this patch, --programmer dummy works fine as non-root.

Corresponding to flashrom svn r493.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-11 14:13:25 +00:00
Carl-Daniel Hailfinger
8d49701bcb Convert all flashchips.c entries with SPI programing to the 256-byte version by default
Change the flashchips entry for SST SST25VF080B to 1-byte writing.

Tested-by: Ali Nadalizadeh.

Corresponding to flashrom svn r486.

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>
2009-05-09 02:34:18 +00:00
Carl-Daniel Hailfinger
96930c3952 Chips like the SST SST25VF080B can only handle single byte writes outside AAI mode
Change SPI architecture to handle 1-byte chunk chip writing differently
from 256-byte chunk chip writing.

Annotate SPI chip write functions with _256 or _1 suffix denoting the
number of bytes they write at maximum.

The 1-byte chunk writing is cut-n-pasted to different SPI drivers right
now. A later patch can move them to the generic spi_chip_write_1.

Corresponding to flashrom svn r485.

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>
2009-05-09 02:30:21 +00:00
Carl-Daniel Hailfinger
c312920864 Add a dummy external flasher which just prints each operation
Usage:
flashrom --programmer dummy

This is a great way to test flashrom without root access.

Corresponding to flashrom svn r483.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-09 00:54:55 +00:00
Carl-Daniel Hailfinger
702218d030 Add external flasher support
- Read/write accesses through function pointers
- Command line parameter for internal/external flasher
- Board and chipset setup moved to internal init function
- Shutdown stuff moved to internal shutdown function

As a side benefit, this will allow us to undo chipset write enable
during shutdown.

Tested by Uwe on real hardware.

Corresponding to flashrom svn r476.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-08 17:43:22 +00:00
Carl-Daniel Hailfinger
03b4e71cb9 Don't assume flash is accessible via MMIO for chips with no read function
Flashrom assumes that the flash chip contents are available via mmap if
no read function is defined.

This special case is handled in lots of places all over the code.

Remove the special case and use the read_memmapped function. Not only
does this allow us to fix a read bug in flashrom I recently uncovered on
ICH SPI, it also allows us to add support for Paraflasher to flashrom.

Corresponding to flashrom svn r473.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-05-08 12:49:03 +00:00
Carl-Daniel Hailfinger
cbdd4f0fc9 Document uncertainty regarding ASD chips
ASD chips may exist, but all available docs suggest they are just
rebranded Winbond chips with Winbond IDs. The ASD vendor/chip IDs in
flash.h are very likely just misinterpreted LHA headers.

Corresponding to flashrom svn r470.

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>
2009-05-06 21:54:22 +00:00
Carl-Daniel Hailfinger
9abf529387 Allow compilation on Solaris
Fix compilation on Solaris and tell people how to compile flashrom on
Solaris, Darwin/Mac OS X and DragonFly BSD.

Thanks to Joerg Schilling and Patrick Georgi for the Solaris part.

Corresponding to flashrom svn r452.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>
2009-05-01 16:34:32 +00:00
Carl-Daniel Hailfinger
4363439cdb Some functions take no arguments
Make that explicit in the associated prototypes. This avoids a warning
on some compilers and is a correctness issue.

Corresponding to flashrom svn r449.

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>
2009-05-01 12:22:17 +00:00
Patrick Georgi
60622e2262 Handle DragonFly BSD definitions in flash.h
There are still some tweaks necessary to get flashrom to build on
DragonFly, but this helps a lot.

Corresponding to flashrom svn r445.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2009-04-28 12:56:04 +00:00
Uwe Hermann
ad216bf3a0 MAX may already be defined
Also, fix smaller cosmetics

Corresponding to flashrom svn r442 and coreboot v2 svn r4205.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
2009-04-24 16:17:41 +00:00