Use struct flashctx instead of struct flashchip for flash chip access

Struct flashchip is used only for the flashchips array and for
operations which do not access hardware, e.g. printing a list of
supported flash chips.

struct flashctx (flash context) contains all data available in
struct flashchip, but it also contains runtime information like
mapping addresses. struct flashctx is expected to grow additional
members over time, a prime candidate being programmer info.
struct flashctx contains all of struct flashchip with identical
member layout, but struct flashctx has additional members at the end.

The separation between struct flashchip/flashctx shrinks the memory
requirement of the big flashchips array and allows future extension
of flashctx without having to worry about bloat.

Corresponding to flashrom svn r1473.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
diff --git a/82802ab.c b/82802ab.c
index 8f671c9..228d071 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -40,7 +40,7 @@
 	msg_cdbg("%s", status & 0x2 ? "WP|TBL#|WP#,ABORT:" : "UNLOCK:");
 }
 
-int probe_82802ab(struct flashchip *flash)
+int probe_82802ab(struct flashctx *flash)
 {
 	chipaddr bios = flash->virtual_memory;
 	uint8_t id1, id2, flashcontent1, flashcontent2;
@@ -89,7 +89,7 @@
 	return 1;
 }
 
-uint8_t wait_82802ab(struct flashchip *flash)
+uint8_t wait_82802ab(struct flashctx *flash)
 {
 	uint8_t status;
 	chipaddr bios = flash->virtual_memory;
@@ -107,7 +107,7 @@
 	return status;
 }
 
-int unlock_82802ab(struct flashchip *flash)
+int unlock_82802ab(struct flashctx *flash)
 {
 	int i;
 	//chipaddr wrprotect = flash->virtual_registers + page + 2;
@@ -118,7 +118,7 @@
 	return 0;
 }
 
-int erase_block_82802ab(struct flashchip *flash, unsigned int page,
+int erase_block_82802ab(struct flashctx *flash, unsigned int page,
 			unsigned int pagesize)
 {
 	chipaddr bios = flash->virtual_memory;
@@ -141,7 +141,7 @@
 }
 
 /* chunksize is 1 */
-int write_82802ab(struct flashchip *flash, uint8_t *src, unsigned int start, unsigned int len)
+int write_82802ab(struct flashctx *flash, uint8_t *src, unsigned int start, unsigned int len)
 {
 	int i;
 	chipaddr dst = flash->virtual_memory + start;
@@ -157,7 +157,7 @@
 	return 0;
 }
 
-int unlock_28f004s5(struct flashchip *flash)
+int unlock_28f004s5(struct flashctx *flash)
 {
 	chipaddr bios = flash->virtual_memory;
 	uint8_t mcfg, bcfg, need_unlock = 0, can_unlock = 0;
@@ -209,7 +209,7 @@
 	return 0;
 }
 
-int unlock_lh28f008bjt(struct flashchip *flash)
+int unlock_lh28f008bjt(struct flashctx *flash)
 {
 	chipaddr bios = flash->virtual_memory;
 	uint8_t mcfg, bcfg;