summaryrefslogtreecommitdiffstats
path: root/flashchips.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-17 15:49:24 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-17 15:49:24 +0000
commit78185dcb3c58552acb652780c4182a77a74f16f0 (patch)
tree81c15dc84a3217eb3359b300fea38bca68421ed0 /flashchips.c
parent05fab75d73019f430c16ad9a9d3800f8e7e40173 (diff)
downloadast2050-flashrom-78185dcb3c58552acb652780c4182a77a74f16f0.zip
ast2050-flashrom-78185dcb3c58552acb652780c4182a77a74f16f0.tar.gz
Use accessor functions for MMIO
Some MMIO accesses used volatile, others didn't (and risked non-execution of side effects) and even with volatile, some accesses looked dubious. Since the MMIO accessor functions and the onboard flash accessor functions are functionally identical (but have different signatures), make the flash accessors wrappers for the MMIO accessors. For some of the conversions, I used Coccinelle. Semantic patch follows: @@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b + a) @@ expression a; volatile uint8_t *b; @@ - *(b) |= (a); + *(b) = *(b) | (a); @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); + mmio_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + mmio_readb(b) @@ type T; T b; @@ ( mmio_readb | mmio_writeb ) (..., - (T) - (b) + b ) Corresponding to flashrom svn r524. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Uwe tested read, write, erase with this patch on a random board to make sure nothing breaks. Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'flashchips.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud