summaryrefslogtreecommitdiffstats
path: root/w39v080fa.c
Commit message (Collapse)AuthorAgeFilesLines
* Unify some probe functions that basically correspond to probe_jedec()Carl-Daniel Hailfinger2009-09-051-22/+3
| | | | | | | | | | | | | | | | | | | | | | Use the correct reset sequence for 82802AB. Detailed explanation: The reset sequence before ID reading was correct, so ID always worked. But the reset sequence after ID reading was a copy-paste leftover from probe_jedec and didn't have any effect. I dug up flash_and_burn from the freebios-v1 tree and found out that 82802ab.c was indeed a copy of jedec.c with lots of experimental unannotated #if 0 and #if 1. About the wait_82802ab change: Before the patch, wait_82802ab entered read status mode, switched to ID mode, then tried an incorrect and unsupported JEDEC command to exit ID mode. Nobody ever saw that this failed because all subsequent function calls had the correct reset sequence at the beginning. With the patch, wait_82802ab enters read status mode, then switches back to read mode with the official reset command. Corresponding to flashrom svn r717. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Standardize on using __func__ instead of __FUNCTION__Uwe Hermann2009-09-021-1/+1
| | | | | | | | | | | | | | | The __func__ variant is standardized in C99 and recommended to be used instead of __FUNCTION__ in the gcc info page. Only _very_ old versions of gcc did not know about __func__, but we've been using both __func__ and __FUNCTION__ for a long while now, and nobody complained about this, so all our users seem to use recent enough compilers. Corresponding to flashrom svn r711. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Flashrom only checks for very few chips if the erase workedCarl-Daniel Hailfinger2009-06-151-10/+11
| | | | | | | | | | | | | | | | | | | 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>
* Add programmer-specific delay functionsCarl-Daniel Hailfinger2009-06-051-4/+4
| | | | | | | | | | | 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>
* Use consistent naming for local chip ID variablesCarl-Daniel Hailfinger2009-05-271-5/+5
| | | | | | | | | | | Every chip besides SPI and w39v080fa uses id1/id2 as local variable names to store ID responses from the flash chip. This eases grepping a lot. As a bonus, it also frees up some names to be used as parameters. Corresponding to flashrom svn r551. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
* Drop unused/duplicated #includes and some dead codeUwe Hermann2009-05-161-1/+0
| | | | | | | | | 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>
* Introduce a type "chipaddr" to abstract the offsets within flash regionsCarl-Daniel Hailfinger2009-05-161-6/+6
| | | | | | | | | | | | | | | | | | | 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>
* Use helper functions chip_{read,write}[bwl] to access flash chipsCarl-Daniel Hailfinger2009-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantic patch I used in r418 to make the original conversion to accessor functions was missing one isomorphism: a[b] <=> *(a+b) The semantic patcher Coccinelle was used to create this patch. Semantic patch follows: @@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b + a) @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); + chip_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + chip_readb(b) @@ type T; T b; @@ ( chip_readb | chip_writeb ) (..., - (T) - (b) + b ) Corresponding to flashrom svn r498. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* FreeBSD definitions of (read|write)[bwl] collide with our ownCarl-Daniel Hailfinger2009-03-061-26/+26
| | | | | | | | | | | | Before we attempt trickery, we can simply rename the accessor functions. Patch created with the help of Coccinelle. Corresponding to flashrom svn r420 and coreboot v2 svn r3984. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Idwer Vollering <idwer_v@hotmail.com> Acked-by: Patrick Georgi <patrick@georgi-clan.de>
* Use helper functions to access flash chipsCarl-Daniel Hailfinger2009-03-051-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Coding-style fixes for flashrom, partly indent-aidedUwe Hermann2008-10-181-10/+11
| | | | | | | Corresponding to flashrom svn r326 and coreboot v2 svn r3669. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Set w39v080fa to fully supportedStefan Reinauer2008-07-021-0/+2
| | | | | | | | | | | I'm am flashing this chip several times a day. Also enable unlocking which is only needed when running coreboot, that slipped in the original commit and through the original review ;-) So it must be trivial enough. Corresponding to flashrom svn r290 and coreboot v2 svn r3406. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* OopsStefan Reinauer2008-03-181-0/+206
Forgot to add the file. Support for the Winbond W39V080FA series of chips. Support for flashing on the Kontron 986LCD-M board. Corresponding to flashrom svn r214 and coreboot v2 svn r3166. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
OpenPOWER on IntegriCloud