summaryrefslogtreecommitdiffstats
path: root/sb600spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-31 17:57:34 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-31 17:57:34 +0000
commit1dfe0ff1745118406f2ca0d03340dd346cc39770 (patch)
tree8b0f6db0abbbd38355b6ddf8feadb7b06a4e9bab /sb600spi.c
parentebd7b8393906876d4b450d8b83a9b748d43c64b4 (diff)
downloadflashrom-1dfe0ff1745118406f2ca0d03340dd346cc39770.tar.gz
flashrom-1dfe0ff1745118406f2ca0d03340dd346cc39770.tar.bz2
flashrom-1dfe0ff1745118406f2ca0d03340dd346cc39770.zip
Add bus type annotation to struct flashchips
Right now, the annotation only differentiates between SPI and non-SPI. Anyone who knows more about a specific flash chip should feel free to update it. The existing flashbus variable was abused to denote the SPI controller type. Use an aptly named variable for that purpose. Once this patch is merged, the chipset/programmer init functions can set supported flash chip types and flashrom can automatically select only matching probe/read/erase/write functions. A side benefit of that will be the elimination of the Winbond W29EE011 vs. AMIC A49LF040A conflict. Corresponding to flashrom svn r556. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'sb600spi.c')
-rw-r--r--sb600spi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sb600spi.c b/sb600spi.c
index 03e1ab8d8..609ad1588 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -25,7 +25,7 @@
#include "flash.h"
#include "spi.h"
-typedef struct _spi_controller {
+struct sb600_spi_controller {
unsigned int spi_cntrl0; /* 00h */
unsigned int restrictedcmd1; /* 04h */
unsigned int restrictedcmd2; /* 08h */
@@ -34,9 +34,9 @@ typedef struct _spi_controller {
unsigned int spi_cmdvalue1; /* 14h */
unsigned int spi_cmdvalue2; /* 18h */
unsigned int spi_fakeid; /* 1Ch */
-} sb600_spi_controller;
+};
-sb600_spi_controller *spi_bar = NULL;
+struct sb600_spi_controller *spi_bar = NULL;
uint8_t *sb600_spibar;
int sb600_spi_read(struct flashchip *flash, uint8_t *buf)
@@ -114,7 +114,7 @@ int sb600_spi_command(unsigned int writecnt, unsigned int readcnt,
writecnt--;
- spi_bar = (sb600_spi_controller *) sb600_spibar;
+ spi_bar = (struct sb600_spi_controller *) sb600_spibar;
printf_debug("%s, cmd=%x, writecnt=%x, readcnt=%x\n",
__func__, cmd, writecnt, readcnt);