summaryrefslogtreecommitdiffstats
path: root/sst_fwhub.c
Commit message (Collapse)AuthorAgeFilesLines
* Flashrom only checks for very few chips if the erase workedCarl-Daniel Hailfinger2009-06-151-11/+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>
* 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-4/+4
| | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Handle (un)locking of SST FWH chipsCarl-Daniel Hailfinger2009-05-111-3/+61
| | | | | | | | | | | | | | | | Add lock bit handling (printing, setting and checking) to SST FWH chips and abort any writes to locked sectors. Verbose mode gives you all the info. Normal mode only tells you of unlocking failed, but gives enough details to debug. Add a comment about flash register placement to flashrom.c. Thanks to Uwe for testing multiple iterations of this patch. Corresponding to flashrom svn r492. 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-1/+1
| | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Check whether SST FWH chip was successfully erased on flashchip -E, tooStefan Reinauer2008-03-161-9/+11
| | | | | | | Corresponding to flashrom svn r212 and coreboot v2 svn r3153. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Some cosmetic cleanups in the flashrom code and outputUwe Hermann2007-10-171-2/+2
| | | | | | | Corresponding to flashrom svn r151 and coreboot v2 svn r2873. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Add '(C)' where it's missing (for consistency reasons)Uwe Hermann2007-09-091-1/+1
| | | | | | | Corresponding to flashrom svn r136 and coreboot v2 svn r2768. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Change all flashrom license headers to use our standard formatUwe Hermann2007-08-291-14/+14
| | | | | | | | | No changes in content of the files. Corresponding to flashrom svn r131 and coreboot v2 svn r2751. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Cosmetic fixesUwe Hermann2007-08-231-3/+5
| | | | | | | Corresponding to flashrom svn r130 and coreboot v2 svn r2748. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Drop a bunch of useless header files, merge them into flash.hUwe Hermann2007-08-231-3/+0
| | | | | | | Corresponding to flashrom svn r128 and coreboot v2 svn r2746. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Drop leftover includesStefan Reinauer2007-05-241-5/+0
| | | | | | | Corresponding to flashrom svn r115 and coreboot v2 svn r2693. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Factor out register mapping codeStefan Reinauer2007-05-241-11/+1
| | | | | | | Corresponding to flashrom svn r113 and coreboot v2 svn r2691. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Unify mmap error messagesStefan Reinauer2007-05-231-1/+1
| | | | | | | Corresponding to flashrom svn r112 and coreboot v2 svn r2690. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Big cosmetic offensive on flashromStefan Reinauer2007-05-231-8/+8
| | | | | | | | | | | | * Give decent names to virt_addr and virt_addr_2 * add some comments * move virtual addresses to the end of the struct, so they dont mess up the initializer. Corresponding to flashrom svn r111 and coreboot v2 svn r2689. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Trivial (cosmetic) cleanupStefan Reinauer2007-04-061-1/+1
| | | | | | | | | | | | | * Only open /dev/mem once and do it early. * Drop extern for function prototypes. * Minimize ts5300 impact in probe_flash() This cleanup will making ICH7 SPI support quite some easier. Corresponding to flashrom svn r100 and coreboot v2 svn r2585. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Coding style fixesUwe Hermann2007-04-011-4/+4
| | | | | | | Corresponding to flashrom svn r97 and coreboot v2 svn r2577. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* This patch is a rework of Adam Kaufman's Solaris patchAdam Kaufman2007-02-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | * flash.h: - add a license header - add system definitions * flash_enable.c: - put io priviledge access in one single place - add includes required for Solaris. * lbtable.c, flash_rom.c, 82802ab.c: - use MEM_DEV so it works on Solaris * sst49lfxxxc.c, sharplhf00l04.c, sst_fwhub.c, 82802ab.c - drop unneeded include to sys/io.h * Makefile - adapt to Solaris specifics. Corresponding to flashrom svn r88 and coreboot v2 svn r2550. Signed-off-by: Adam Kaufman <adam.kaufman@pinnacle.com> Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Adam Kaufman <adam.kaufman@pinnacle.com>
* Instead of checking the first byte only, the whole part is checked nowStefan Reinauer2006-11-071-5/+8
| | | | | | | | | | This Corresponding to flashrom svn r71 and coreboot v2 svn r2494. will detect any improper erase, closes #31 Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Flashrom update from Stefan, resolve issue 21Ollie Lho2005-11-261-7/+8
| | | | Corresponding to flashrom svn r34 and coreboot v2 svn r2111.
* Add -E option for chip erase, remove duplicated codeOllie Lho2004-12-081-50/+5
| | | | Corresponding to flashrom svn r30 and coreboot v2 svn r1815.
* Add retry to write_byte_program_jedec(), 99% success rateOllie Lho2004-12-081-20/+5
| | | | Corresponding to flashrom svn r29 and coreboot v2 svn r1814.
* Enable LPC decoding for 1 MB more addresss, for supporting SST49LF00xA/BOllie Lho2004-12-071-0/+1
| | | | Corresponding to flashrom svn r28 and coreboot v2 svn r1813.
* SST49LF00[2,3,4] should use the same driver as 49LF008Ollie Lho2004-12-071-15/+10
| | | | Corresponding to flashrom svn r27 and coreboot v2 svn r1812.
* Support for sst firmware hubRonald G. Minnich2004-09-301-0/+178
Corresponding to flashrom svn r25 and coreboot v2 svn r1651.
OpenPOWER on IntegriCloud