summaryrefslogtreecommitdiffstats
path: root/stm50flw0x0x.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a type "chipaddr" to abstract the offsets within flash regionsCarl-Daniel Hailfinger2009-05-161-13/+13
| | | | | | | | | | | | | | | | | | | 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>
* Rename the STM50FLW register variable flash_addr used for block write ↵Carl-Daniel Hailfinger2009-05-111-5/+5
| | | | | | | | | | | | protect handling All other chips call it wrprotect which is less confusing. As a side benefit, flash_addr is now a name usable for other stuff. Corresponding to flashrom svn r496. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
* FreeBSD definitions of (read|write)[bwl] collide with our ownCarl-Daniel Hailfinger2009-03-061-32/+32
| | | | | | | | | | | | 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-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Beautify flash chip ID verbose printout a little, always use %02xPeter Stuge2009-01-251-1/+1
| | | | | | | 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>
* Coding-style fixes for flashrom, partly indent-aidedUwe Hermann2008-10-181-34/+32
| | | | | | | 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>
* Separate ST M50FLW support from generic JEDEC codeClaus Gindhart2008-04-281-0/+293
The generic jedec.c does not work for the ST M50FLW flash devices, because they need an unlock command first. For this reason, ST M50FLW support is moved to a new HW support module, because any change in jedec.c would bear the risk to cause problems with the already supported devices. It's already tested with ST M50FLW080A; the other chips of this family i dont have available, so i couldnt test it. Corresponding to flashrom svn r219 and coreboot v2 svn r3274. Signed-off-by: Claus Gindhart <claus.gindhart@kontron.com> Acked-by: Stefan Reinauer <stepan@coresystems.de>
OpenPOWER on IntegriCloud