summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Clarify error message in enable_flash_sb600() a littlePeter Stuge2009-05-061-1/+1
| | | | | | | Corresponding to flashrom svn r469. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Improve SST25 status register routinesCarl-Daniel Hailfinger2009-05-061-11/+15
| | | | | | | | | | | | - Using a 4-bit index into an array with 8 elements leads to out-of-bounds accesses. Use proper bit masking to fix this. - Factor out common SST25 status register printing. - Use the common SST25 status register printing for SST25VF080B. Corresponding to flashrom svn r468. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* Revert r466 because of inverted logicCarl-Daniel Hailfinger2009-05-061-5/+6
| | | | | | | | | If unprotect succeeded, it will print "SB600 unprotect failed". Corresponding to flashrom svn r467. 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>
* Cleanup redundant condition and clarify message a littlePeter Stuge2009-05-061-6/+5
| | | | | | | Corresponding to flashrom svn r466. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Touch up some error messages in enable_flash_cs5536()Peter Stuge2009-05-061-2/+2
| | | | | | | Corresponding to flashrom svn r465. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Clean up the SB400 chipset enable codeCarl-Daniel Hailfinger2009-05-061-9/+1
| | | | | | | | | | Use pci_dev_find() instead of setting up a filter and iterating over PCI devices. Corresponding to flashrom svn r464. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Rewrite the SB600 chipset enable functionCarl-Daniel Hailfinger2009-05-051-17/+33
| | | | | | | | | | | | | | | | - Check for read/write protected regions first. - Region protection is write-once according to the data sheets. Check if the write succeeded. Don't write if the region is not protected. - Verbose region protection dumping. - Improve readability of BAR mapping code. - Align BAR mapping to a page boundary (4k) instead of a 16k boundary. This patch prepares the code for a SPI detection heuristic. Corresponding to flashrom svn r463. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* Here is a fix for chipset_enable.c when there is not /dev/cpuBertrand Jacquin2009-05-051-1/+1
| | | | | | | | | | Open fails so there is no reason to lseek in. Actually this is a trivial fix for a bad return value from open. Corresponding to flashrom svn r462. Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
* SST25VF080B TEST_OK_ ERASE WRITEPeter Stuge2009-05-051-1/+1
| | | | | | | | | As reported by A. Spamlover. Thanks! Corresponding to flashrom svn r461. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Some cosmetics in README and manpageUwe Hermann2009-05-052-57/+68
| | | | | | | | | | Also, move more stuff to the manpage where it belongs (this also eliminates some duplicated contents). Corresponding to flashrom svn r460. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Force enabling SPI mode for SB600 is a bad idea and leads to hangsZheng Bao2009-05-041-0/+8
| | | | | | | | | | | | Only access LPC ROM if we boot via LPC ROM. Only access SPI ROM if we boot via SPI ROM. The code to force enable SPI is commented out in case someone wants to reenable it for a particular board with LPC and SPI flash. Corresponding to flashrom svn r459. Signed-off-by: Zheng Bao <zheng.bao@amd.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* SST25VF080B TEST_OK_READPeter Stuge2009-05-041-1/+1
| | | | | | | | | Per report from from Henning Fleddermann. Thanks! Corresponding to flashrom svn r458. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Onwards with developmentCarl-Daniel Hailfinger2009-05-041-2/+4
| | | | | | | | | Re-add the svn revision to the version string. Corresponding to flashrom svn r457. 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>
* Flashrom 0.9.0Carl-Daniel Hailfinger2009-05-042-5/+3
| | | | | | | Corresponding to flashrom svn r454. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* Complement the README file with build instructions for the platforms it ↵Idwer Vollering2009-05-031-1/+10
| | | | | | | | | currently compiles on Corresponding to flashrom svn r453. Signed-off-by: Idwer Vollering <vidwer@gmail.com> Acked-by: Peter Stuge <peter@stuge.se>
* Allow compilation on SolarisCarl-Daniel Hailfinger2009-05-013-7/+29
| | | | | | | | | | | | 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>
* Mention that flashrom can also verify flash contentsPeter Stuge2009-05-012-4/+4
| | | | | | | Corresponding to flashrom svn r451. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Fix usage to show that vendor: is optional in the -m parameterPeter Stuge2009-05-011-1/+1
| | | | | | | Corresponding to flashrom svn r450. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Some functions take no argumentsCarl-Daniel Hailfinger2009-05-011-5/+5
| | | | | | | | | | 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>
* Add Li-Ta (Ollie) Lo to the author listCarl-Daniel Hailfinger2009-05-011-0/+2
| | | | | | | | | | | He started flashrom back in 2000. Thanks to Ron for pointing this out. Corresponding to flashrom svn r448. 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>
* Since the command line interface for flashrom will change for 1.0Carl-Daniel Hailfinger2009-05-012-0/+9
| | | | | | | | | | (all-caps or no-caps for short options, exclude range syntax, etc.) we should tell users in the man page and the usage message about this. Corresponding to flashrom svn r447. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Macronix MX25L1605 TEST_OK_ PROBE READ ERASE WRITEPeter Stuge2009-04-291-1/+1
| | | | | | | | | Per report from Aldrik Dunbar. Thanks! Corresponding to flashrom svn r446. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* Handle DragonFly BSD definitions in flash.hPatrick Georgi2009-04-282-3/+3
| | | | | | | | | | | 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>
* Enable scan-build for flashromPatrick Georgi2009-04-261-2/+2
| | | | | | | Corresponding to flashrom svn r444. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
* The flashrom makefile wants to redirect both stdout and stderr to /dev/null ↵Stephan Guilloux2009-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | for one compile test The old variant of using &>/dev/null works on bash and zsh, but not on dash and tcsh. dash and tcsh interpret it as "background command and truncate /dev/null" which is not what we want. >& works on tcsh and bash, but it is not POSIX compliant. Since make uses /bin/sh and /bin/sh has to be POSIX compliant, we can use the POSIX variant of stderr and stdout redirection. >/dev/null 2>&1 is POSIX compliant. This is specified in SuSv3, Shell Command Language, sections 2.7.2 and 2.7.6. Corresponding to flashrom svn r443 and coreboot v2 svn r4211. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ward Vandewege <ward@gnu.org>
* MAX may already be definedUwe Hermann2009-04-242-5/+5
| | | | | | | | | 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>
* Support MX25L3235DStephan Guilloux2009-04-232-1/+15
| | | | | | | Corresponding to flashrom svn r441 and coreboot v2 svn r4200. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Acked-by: Peter Stuge <peter@stuge.se>
* Don't duplicate option description in README, the manpage already has that infoUwe Hermann2009-04-232-26/+5
| | | | | | | | | Also, additional small cosmetic fix. Corresponding to flashrom svn r440 and coreboot v2 svn r4196. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* All "unknown xy SPI chip" entries claim to have status UNTESTED for ↵Carl-Daniel Hailfinger2009-04-221-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | probe/read/erase/write That is incorrect. A bit of confusion comes from how the #defines are named. We call them TEST_BAD_*, but the message printed by flashrom says: "This flash part has status NOT WORKING for operations:" Something that is unimplemented is definitely not working. Neither of the chip entries mentioned above has erase or write functions implemented, so erase and write are not working. Since their size is unknown, we can't read them in. That means read is not working as well. Probing is a different matter. If a chip-specific probe function had matched, we wouldn't have to handle the chip with the "unknown xy SPI chip" fallback. I'm tempted to call that "not working" as well, but I'm open to discussion on this point. Corresponding to flashrom svn r439 and coreboot v2 svn r4177. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add support for Gigabyte GA-MA790FX-DQ6Carl-Daniel Hailfinger2009-04-211-0/+2
| | | | | | | | | | | This board uses IT8718F LPC->SPI translation for the flash chip. Tested by Mateusz Murawski. Corresponding to flashrom svn r438 and coreboot v2 svn r4161. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Mateusz Murawski <matowy@tlen.pl>
* Support Macronix MX2512805D flash chipStephan Guilloux2009-04-212-0/+15
| | | | | | | Corresponding to flashrom svn r437 and coreboot v2 svn r4150. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Acked-by: Peter Stuge <peter@stuge.se>
* Trivial indent fixStephan Guilloux2009-04-211-1/+1
| | | | | | | Corresponding to flashrom svn r436 and coreboot v2 svn r4149. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Acked-by: Peter Stuge <peter@stuge.se>
* After verification in datasheets, all MX25 accept the same opcodes 0x60 and ↵Stephan Guilloux2009-04-201-7/+8
| | | | | | | | | 0xC7 for Chip Erase Corresponding to flashrom svn r435 and coreboot v2 svn r4146. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* board_enables: reconstruct tableLuc Verhaegen2009-04-201-421/+43
| | | | | | | | | | | | | This patch restores the pciid based board matching table. It makes this table readable and hackable again, and the only disadvantage is that the right margin is way beyond the rather dogmatic 80. All 0x0000 pci ids have been string replaced by 0 to more easily spot missing ids, and extra comments have been added to explain how the various entries are used. Corresponding to flashrom svn r434 and coreboot v2 svn r4142. Signed-off-by: Luc Verhaegen <libv@skynet.be> Acked-by: Peter Stuge <peter@stuge.se>
* Trivial README change Flashrom->flashromPeter Stuge2009-04-201-5/+5
| | | | | | | Corresponding to flashrom svn r433 and coreboot v2 svn r4141. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
* MX25L1605 and 1635 accept Chip Erase opcodes 60 and C7Stephan Guilloux2009-04-191-2/+2
| | | | | | | Corresponding to flashrom svn r432 and coreboot v2 svn r4139. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Acked-by: Peter Stuge <peter@stuge.se>
* Add MX25L1635D support, as discussed on #corebootStephan Guilloux2009-04-191-0/+13
| | | | | | | Corresponding to flashrom svn r431 and coreboot v2 svn r4138. Signed-off-by: Stephan Guilloux <stephan.guilloux@free.fr> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add VIA PC3500G boardPeter Stuge2009-04-171-0/+14
| | | | | | | | | It has SPI flash behind ITE8716 on LPC. Corresponding to flashrom svn r430 and coreboot v2 svn r4132. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: illdred <illdred@gmail.com>
* Some coding style and consistency fixesUwe Hermann2009-04-158-46/+60
| | | | | | | Corresponding to flashrom svn r429 and coreboot v2 svn r4117. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix typoUwe Hermann2009-04-131-1/+1
| | | | | | | | | Add missing copyright year. Corresponding to flashrom svn r428 and coreboot v2 svn r4107. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Mention a few more flash chip packages in README/manpageUwe Hermann2009-04-112-6/+8
| | | | | | | Corresponding to flashrom svn r427 and coreboot v2 svn r4092. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix typoUwe Hermann2009-04-101-1/+1
| | | | | | | Corresponding to flashrom svn r426 and coreboot v2 svn r4089. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Various manpage / README fixesUwe Hermann2009-04-102-29/+35
| | | | | | | | | | | | | | - Improve description a bit, especially wrt chip packages and protocols. - Add some missing parameters to manpage option descriptions. - Remove long obsolete DoC support note. Corresponding to flashrom svn r425 and coreboot v2 svn r4088. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix the typo should indeed be a 0x2eMondrian nuessle2009-04-091-2/+1
| | | | | | | | | Tested on an iWILL DK8-HTX board. Corresponding to flashrom svn r424 and coreboot v2 svn r4086. Signed-off-by: Mondrian nuessle <nuessle@uni-hd.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
* Board enable support for HP DL145 G3Mondrian Nuessle2009-03-301-0/+27
| | | | | | | | | | | This is a BCM5785 based machine, WP# and TLB# need to be deasserted using GPIO 2 and 5 from the PM registers of the southbridge. This is very similar to the x3455 implementation. Corresponding to flashrom svn r423 and coreboot v2 svn r4031. Signed-off-by: Mondrian Nuessle <nuessle@uni-hd.de> Acked-by: Peter Stuge <peter@stuge.se>
* Improve readability of Atmel AT45 commentsCarl-Daniel Hailfinger2009-03-191-27/+28
| | | | | | | | | | Move the Atmel AT45 comments about block and page sizes from the end of the struct to the individual struct members to improve readability. Corresponding to flashrom svn r422 and coreboot v2 svn r4020. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
* This patch adds "high coreboot table support" to coreboot version 2Stefan Reinauer2009-03-172-8/+29
| | | | | | | | | | | | | | | | | | | Some bootloaders seem to overwrite memory starting at 0x600, thus destroying the coreboot table integrity, rendering the table useless. By moving the table to the high tables area (if it's activated), this problem is fixed. In order to move the table, a 40 bytes mini coreboot table with a single sub table is placed at 0x500/0x530 that points to the real coreboot table. This is comparable to the ACPI RSDT or the MP floating table. This patch also adds "table forward" support to flashrom and nvramtool. Corresponding to flashrom svn r421 and coreboot v2 svn r4012. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se>
* FreeBSD definitions of (read|write)[bwl] collide with our ownCarl-Daniel Hailfinger2009-03-0617-348/+348
| | | | | | | | | | | | 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>
* Reduce use of volatile variablesCarl-Daniel Hailfinger2009-03-061-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the conversion of flash chip accesses to helper functions, I spotted assignments to volatile variables which were neither placed inside the mmapped ROM area nor were they counters. Due to the use of accessor functions, volatile usage can be reduced significantly because the accessor functions take care of actually performing the reads/writes correctly. The following semantic patch spotted them (linebreak in python string for readability reasons, please remove before usage): @r exists@ expression b; typedef uint8_t; volatile uint8_t a; position p1; @@ a@p1 = readb(b); @script:python@ p1 << r.p1; a << r.a; b << r.b; @@ print "* file: %s line %s has assignment to unnecessarily volatile variable: %s = readb(%s);" % (p1[0].file, p1[0].line, a, b) Result was: HANDLING: sst28sf040.c * file: sst28sf040.c line 44 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 43 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 42 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 41 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 40 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 39 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 38 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 58 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 57 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 56 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 55 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 54 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 53 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); * file: sst28sf040.c line 52 has assignment to unnecessarily volatile variable: tmp = readb(TODO: Binary); The following semantic patch uses the spatch builtin match printing functionality by prepending a "*" to the line with the pattern: @@ expression b; typedef uint8_t; volatile uint8_t a; @@ * a = readb(b); Result is: HANDLING: sst28sf040.c diff = - tmp = readb(bios + 0x1823); - tmp = readb(bios + 0x1820); - tmp = readb(bios + 0x1822); - tmp = readb(bios + 0x0418); - tmp = readb(bios + 0x041B); - tmp = readb(bios + 0x0419); - tmp = readb(bios + 0x040A); } static __inline__ void unprotect_28sf040(volatile uint8_t *bios) @@ -49,13 +42,6 @@ static __inline__ void unprotect_28sf040 /* ask compiler not to optimize this */ volatile uint8_t tmp; - tmp = readb(bios + 0x1823); - tmp = readb(bios + 0x1820); - tmp = readb(bios + 0x1822); - tmp = readb(bios + 0x0418); - tmp = readb(bios + 0x041B); - tmp = readb(bios + 0x0419); - tmp = readb(bios + 0x041A); } static __inline__ int erase_sector_28sf040(volatile uint8_t *bios, It's arguably a bit easier to read if you get used to the leading "-" for matching lines. This patch was enabled by Coccinelle: http://www.emn.fr/x-info/coccinelle/ Corresponding to flashrom svn r419 and coreboot v2 svn r3973. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Joseph Smith <joe@settoplinux.org>
* 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>
OpenPOWER on IntegriCloud