summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use helper functions to access flash chipsCarl-Daniel Hailfinger2009-03-0517-342/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now we perform direct pointer manipulation without any abstraction to read from and write to memory mapped flash chips. That makes it impossible to drive any flasher which does not mmap the whole chip. Using helper functions readb() and writeb() allows a driver for external flash programmers like Paraflasher to replace readb and writeb with calls to its own chip access routines. This patch has the additional advantage of removing lots of unnecessary casts to volatile uint8_t * and now-superfluous parentheses which caused poor readability. I used the semantic patcher Coccinelle to create this patch. The semantic patch follows: @@ expression a; typedef uint8_t; volatile uint8_t *b; @@ - *(b) = (a); + writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + readb(b) @@ type T; T b; @@ ( readb | writeb ) (..., - (T) - (b) + b ) In contrast to a sed script, the semantic patch performs type checking before converting anything. Tested-by: Joe Julian Corresponding to flashrom svn r418 and coreboot v2 svn r3971. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: FENG Yu Ning <fengyuning1984@gmail.com>
* Add SST25VF040.REMS with TEST_OK_ PROBE READZheng Bao2009-02-251-0/+14
| | | | | | | Corresponding to flashrom svn r417 and coreboot v2 svn r3958. Signed-off-by: Zheng Bao <zheng.bao@amd.com> Acked-by: Peter Stuge <peter@stuge.se>
* SST29EE020A TEST_OK_ PROBE READ ERASE WRITEPeter Stuge2009-02-221-1/+1
| | | | | | | | | Report by Holger Mickler. Thanks! Corresponding to flashrom svn r416 and coreboot v2 svn r3956. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Fix broken flash chip base address logicPeter Stuge2009-02-091-1/+1
| | | | | | | | | | | | | Elan SC520 requries us to deal with flash chip base addresses at locations other than top of 4GB. The logic for that was incorrectly triggered also when a board had more than one flash chip. This patch will honor flashbase only when probing for the first flash chip on the board, and look at top of 4GB for later chips. Corresponding to flashrom svn r415 and coreboot v2 svn r3932. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Myles Watson <mylesgw@gmail.com>
* MSI MS-7046 board enablePeter Stuge2009-02-021-0/+22
| | | | | | | Corresponding to flashrom svn r414 and coreboot v2 svn r3927. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: David Tiemann <davidtiemann@gmail.com>
* Following patch fixes VIA SPI (VT8237S)Rudolf Marek2009-02-011-0/+1
| | | | | | | | | It needs to have opcodes initialized same way as ICH7. Corresponding to flashrom svn r413 and coreboot v2 svn r3926. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Peter Stuge <peter@stuge.se>
* Factor out read and erase functions from flashrom main()Carl-Daniel Hailfinger2009-01-281-38/+57
| | | | | | | Corresponding to flashrom svn r412 and coreboot v2 svn r3923. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* Add VT8237A PCI IDPeter Stuge2009-01-261-0/+1
| | | | | | | Corresponding to flashrom svn r411 and coreboot v2 svn r3919. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Fix one dead increment and one dead assignment as found by clangPeter Stuge2009-01-262-2/+1
| | | | | | | | | Thanks Patrick! Corresponding to flashrom svn r410 and coreboot v2 svn r3918. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Driver for ST M29F002T/NT/BPeter Stuge2009-01-264-6/+116
| | | | | | | | | | | T/NT TEST_OK_ PROBE READ ERASE WRITE Test report from Julia. Thanks! Corresponding to flashrom svn r409 and coreboot v2 svn r3917. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Julia Longtin <juri@solarnetone.org>
* Fix copypaste error in r3913Peter Stuge2009-01-261-1/+1
| | | | | | | Corresponding to flashrom svn r408 and coreboot v2 svn r3916. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* SST25VF040B using 0x90 identification and AAI writePeter Stuge2009-01-263-0/+41
| | | | | | | | | | | | | SST AAI is Auto Address Increment writing, a streamed write to the flash chip where the first write command sets a starting address and following commands simply append data. Unfortunately not supported by Winbond SPI masters. From July 2008. Corresponding to flashrom svn r407 and coreboot v2 svn r3913. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Decode SST25VF040B status register, also from July 2008Peter Stuge2009-01-261-1/+26
| | | | | | | Corresponding to flashrom svn r406 and coreboot v2 svn r3912. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Intel Desktop Board D201GLYPeter Stuge2009-01-261-0/+14
| | | | | | | Corresponding to flashrom svn r405 and coreboot v2 svn r3911. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Winbond SuperIO SPI driverPeter Stuge2009-01-264-3/+218
| | | | | | | | | | Developed and tested to work on Intel D201GLY in July 2008. Tested by a helpful person on IRC whose name I've since forgotten. Sorry! Corresponding to flashrom svn r404 and coreboot v2 svn r3910. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Ward Vandewege <ward@gnu.org>
* Export Winbond SuperIO register access functions in board_enable.cPeter Stuge2009-01-262-5/+10
| | | | | | | Corresponding to flashrom svn r403 and coreboot v2 svn r3909. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Document exit() codes introduced in r3907Peter Stuge2009-01-262-0/+9
| | | | | | | Corresponding to flashrom svn r402 and coreboot v2 svn r3908. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Ward Vandewege <ward@gnu.org>
* exit(2) on /dev/mem open() failure and exit(3) on mmap() failurePeter Stuge2009-01-261-2/+2
| | | | | | | Corresponding to flashrom svn r401 and coreboot v2 svn r3907. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Ward Vandewege <ward@gnu.org>
* Add license header to physmap.c so everyone is happyPeter Stuge2009-01-261-0/+18
| | | | | | | | | :) Corresponding to flashrom svn r400 and coreboot v2 svn r3906. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Darwin / Mac OS XStefan Reinauer2009-01-264-5/+45
| | | | | | | | | | | Through DirectIO from coresystems GmbH we now support Darwin/Mac OS X. DirectIO is available at http://www.coresystems.de/en/directio Corresponding to flashrom svn r399 and coreboot v2 svn r3905. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Small cleanup in MakefilePeter Stuge2009-01-261-4/+5
| | | | | | | Corresponding to flashrom svn r398 and coreboot v2 svn r3904. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Abstract mmap() in physmap.c and only open /dev/mem on the first physmap() callStefan Reinauer2009-01-266-88/+71
| | | | | | | | Corresponding to flashrom svn r397 and coreboot v2 svn r3903. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Change flashrom.c:map_flash_registers() from int to voidPeter Stuge2009-01-262-4/+2
| | | | | | | | | The function exit()s on failure, and no callers check the return value. Corresponding to flashrom svn r396 and coreboot v2 svn r3901. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Forgot some things in r3899Peter Stuge2009-01-261-3/+3
| | | | | | | Corresponding to flashrom svn r395 and coreboot v2 svn r3900. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Little readability improvement in cbtable.c:coreboot_init()Peter Stuge2009-01-261-15/+13
| | | | | | | Corresponding to flashrom svn r394 and coreboot v2 svn r3899. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Change FreeBSD #ifdef into #if defined()Stefan Reinauer2009-01-261-1/+1
| | | | | | | Corresponding to flashrom svn r393 and coreboot v2 svn r3898. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se>
* Make Makefile a bit more portablePeter Stuge2009-01-251-1/+1
| | | | | | | | | Shell echo doesn't always know -n. Corresponding to flashrom svn r392 and coreboot v2 svn r3897. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Add dry Am29F080B Am29LV081B SST39VF080 definitions per data sheetsPeter Stuge2009-01-251-0/+39
| | | | | | | Corresponding to flashrom svn r391 and coreboot v2 svn r3896. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Beautify flash chip ID verbose printout a little, always use %02xPeter Stuge2009-01-2513-13/+13
| | | | | | | Corresponding to flashrom svn r390 and coreboot v2 svn r3895. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Fix stupid off-by-one error in erase verificationPeter Stuge2009-01-251-1/+1
| | | | | | | | | As reported by Jody McIntyre. Thanks! Corresponding to flashrom svn r389 and coreboot v2 svn r3894. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* ST M50FW080 TEST_OK_ PROBE READ ERASE WRITEPeter Stuge2009-01-241-1/+1
| | | | | | | | | Report by Jody McIntyre. Thanks! Corresponding to flashrom svn r388 and coreboot v2 svn r3893. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* SST25VF080B TEST_OK_PROBEPeter Stuge2009-01-241-1/+1
| | | | | | | | | Report by Scaldov M.V. Thanks! Corresponding to flashrom svn r387 and coreboot v2 svn r3892. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Check all mmap() calls and print helpful Linux error messagePeter Stuge2009-01-234-7/+19
| | | | | | | Corresponding to flashrom svn r386 and coreboot v2 svn r3890. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Provide some hints for the user in case /dev/mem mmap failsPeter Stuge2009-01-221-0/+7
| | | | | | | | | Resolves #121 Corresponding to flashrom svn r385 and coreboot v2 svn r3889. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Fix ICH9 locking register address and add important debug outputFENG yu ning2009-01-181-12/+26
| | | | | | | | Corresponding to flashrom svn r384 and coreboot v2 svn r3869. Signed-off-by: FENG yu ning <fengyuning1984@gmail.com> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: FENG yu ning <fengyuning1984@gmail.com>
* Add ICH opcode debuggingPeter Stuge2009-01-151-0/+1
| | | | | | | Corresponding to flashrom svn r383 and coreboot v2 svn r3862. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Use designated initializers for the board enable tableStephan Guilloux2009-01-151-51/+362
| | | | | | | | | | | | | | | | | | | Similarly to flashchips array, this patch intends to make the table board_pciid_enables more readable. Corresponding to flashrom svn r382 and coreboot v2 svn r3861. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> > What real problem does this solve? 1. Next time someone adds a new struct member, we avoid mistakes of ordering of initializers 2. we avoid mistakes in the first place. The .x = y stuff was added for a (good) reason, I think this is an improvement. Acked-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Always print address when verification fails, not only with -VPeter Stuge2009-01-131-4/+5
| | | | | | | Corresponding to flashrom svn r381 and coreboot v2 svn r3860. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Board enable for GIGABYTE GA-MA78G-DS3HPeter Stuge2009-01-121-0/+2
| | | | | | | | | | | This board has 2x MX25L8005 flash chips behind an IT8718F LPC->SPI bridge. The board uses GIGABYTE's patented BIOS failover technology, and at this point we do not know how to control which of the two chips flashrom actually hits. Corresponding to flashrom svn r380 and coreboot v2 svn r3859. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Yul Rottmann <yulrottmann@bitel.net>
* IT8718F works just like IT8716FPeter Stuge2009-01-121-1/+1
| | | | | | | Corresponding to flashrom svn r379 and coreboot v2 svn r3858. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Yul Rottmann <yulrottmann@bitel.net>
* Check return value of fscanf()/fwrite()/fread()Peter Stuge2009-01-122-9/+15
| | | | | | | | | Fix build error on distros with warn_unused_result attributes in glibc. Corresponding to flashrom svn r378 and coreboot v2 svn r3857. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Yul Rottmann <yulrottmann@bitel.net>
* Update usage in READMEIdwer Vollering2009-01-111-1/+4
| | | | | | | | | Mimicked from flashrom.c Corresponding to flashrom svn r377 and coreboot v2 svn r3855. Signed-off-by: Idwer Vollering <vidwer@gmail.com> Acked-by: Peter Stuge <peter@stuge.se>
* Add erase and write functions to the following chip definitionsCarl-Daniel Hailfinger2009-01-081-27/+27
| | | | | | | | | | | | | AT25DF021 AT25DF041A AT25DF081 AT25DF161 AT25DF321 AT25DF321A AT25DF641 AT25F512B AT25FS010 AT25FS040 AT26DF081A AT26DF161 AT26DF161A AT26DF321 AT26F004 Straight from the data sheets, untested because I lack the hardware. Corresponding to flashrom svn r376 and coreboot v2 svn r3853. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* The flashrom man page has incomplete author/copyright sections and an ↵Carl-Daniel Hailfinger2009-01-081-9/+37
| | | | | | | | | | | | | | | | incorrect license section - Remove the copyright listings and refer the reader to the source files. - Update the author list to those which have copyright messages in the source files. - Correct the license from GPL v2+ to (GPL v2, with some files under later versions as well) Corresponding to flashrom svn r375 and coreboot v2 svn r3852. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* This patch improves machine parseability and human readability of flashchips.cStephan Guilloux2009-01-081-925/+2087
| | | | | | | | | | | The explicit initialization makes sure any future struct flashchip reordering is not needed. (Except for the case where we need arrays of some of the struct members.) Corresponding to flashrom svn r374 and coreboot v2 svn r3851. Signed-off-by: Stephan Guilloux <mailto:stephan.guilloux@free.fr> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add SST49LF020 supportSven Schnelle2009-01-072-0/+7
| | | | | | | Corresponding to flashrom svn r373 and coreboot v2 svn r3850. Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add AMD-768 chipset supportSven Schnelle2009-01-071-0/+1
| | | | | | | Corresponding to flashrom svn r372 and coreboot v2 svn r3849. Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add i631x LPC supportSven Schnelle2009-01-071-0/+1
| | | | | | | Corresponding to flashrom svn r371 and coreboot v2 svn r3848. Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* If you pass a bogus layout file to the -l option flashrom will segfaultUwe Hermann2008-12-221-0/+5
| | | | | | | | | | Fix that by throwing an error instead. Corresponding to flashrom svn r370 and coreboot v2 svn r3834. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* Add another board-enable line for the Kontron 986LCD-M/mITXUwe Hermann2008-12-221-0/+3
| | | | | | | | | | | | There seem to be at least two versions of the board out there, and the subsystem IDs changed between the versions. Patch successfully tested on hardware. Corresponding to flashrom svn r369 and coreboot v2 svn r3833. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Peter Stuge <peter@stuge.se>
OpenPOWER on IntegriCloud