summaryrefslogtreecommitdiff
path: root/sst28sf040.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-12-14 22:25:15 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-12-14 22:25:15 +0000
commitbaf84624cd340c9b8dfaa45c56060ab788f4945e (patch)
tree7d9ffba077715cf9e75c9f4a36d0d7f11a3181f6 /sst28sf040.c
parent98ddd394a74b53a26dab082be5981122b5e80927 (diff)
downloadflashrom-baf84624cd340c9b8dfaa45c56060ab788f4945e.tar.gz
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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1473 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'sst28sf040.c')
-rw-r--r--sst28sf040.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sst28sf040.c b/sst28sf040.c
index 2038d53..ca40164 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -30,7 +30,7 @@
#define RESET 0xFF
#define READ_ID 0x90
-int protect_28sf040(struct flashchip *flash)
+int protect_28sf040(struct flashctx *flash)
{
chipaddr bios = flash->virtual_memory;
@@ -45,7 +45,7 @@ int protect_28sf040(struct flashchip *flash)
return 0;
}
-int unprotect_28sf040(struct flashchip *flash)
+int unprotect_28sf040(struct flashctx *flash)
{
chipaddr bios = flash->virtual_memory;
@@ -60,7 +60,7 @@ int unprotect_28sf040(struct flashchip *flash)
return 0;
}
-int erase_sector_28sf040(struct flashchip *flash, unsigned int address, unsigned int sector_size)
+int erase_sector_28sf040(struct flashctx *flash, unsigned int address, unsigned int sector_size)
{
chipaddr bios = flash->virtual_memory;
@@ -76,7 +76,7 @@ int erase_sector_28sf040(struct flashchip *flash, unsigned int address, unsigned
}
/* chunksize is 1 */
-int write_28sf040(struct flashchip *flash, uint8_t *src, unsigned int start, unsigned int len)
+int write_28sf040(struct flashctx *flash, uint8_t *src, unsigned int start, unsigned int len)
{
int i;
chipaddr bios = flash->virtual_memory;
@@ -100,7 +100,7 @@ int write_28sf040(struct flashchip *flash, uint8_t *src, unsigned int start, uns
return 0;
}
-static int erase_28sf040(struct flashchip *flash)
+static int erase_28sf040(struct flashctx *flash)
{
chipaddr bios = flash->virtual_memory;
@@ -114,7 +114,7 @@ static int erase_28sf040(struct flashchip *flash)
return 0;
}
-int erase_chip_28sf040(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
+int erase_chip_28sf040(struct flashctx *flash, unsigned int addr, unsigned int blocklen)
{
if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
msg_cerr("%s called with incorrect arguments\n",