summaryrefslogtreecommitdiff
path: root/util/flashrom/spi.c
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2009-01-26 03:08:45 +0000
committerPeter Stuge <peter@stuge.se>2009-01-26 03:08:45 +0000
commit36b3932f994bce7cb38d1b3bec9e25f6a346294b (patch)
tree592853b6f97b7906f4d1c1ad0c2bf8438bef29c6 /util/flashrom/spi.c
parent8991302f5450fd1a02eb107a6a0fc491cc437c8c (diff)
flashrom: Winbond SuperIO SPI driver.
Developed and tested to work on Intel D201GLY in July 2008. Tested by a helpful person on IRC whose name I've since forgotten. Sorry! Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Ward Vandewege <ward@gnu.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3910 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/spi.c')
-rw-r--r--util/flashrom/spi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/flashrom/spi.c b/util/flashrom/spi.c
index 8a7b79fdcf..affc41f1cd 100644
--- a/util/flashrom/spi.c
+++ b/util/flashrom/spi.c
@@ -44,6 +44,8 @@ int spi_command(unsigned int writecnt, unsigned int readcnt,
return ich_spi_command(writecnt, readcnt, writearr, readarr);
case BUS_TYPE_SB600_SPI:
return sb600_spi_command(writecnt, readcnt, writearr, readarr);
+ case BUS_TYPE_WBSIO_SPI:
+ return wbsio_spi_command(writecnt, readcnt, writearr, readarr);
default:
printf_debug
("%s called, but no SPI chipset/strapping detected\n",
@@ -160,6 +162,7 @@ int probe_spi_rdid4(struct flashchip *flash)
case BUS_TYPE_ICH9_SPI:
case BUS_TYPE_VIA_SPI:
case BUS_TYPE_SB600_SPI:
+ case BUS_TYPE_WBSIO_SPI:
return probe_spi_rdid_generic(flash, 4);
default:
printf_debug("4b ID not supported on this SPI controller\n");
@@ -229,7 +232,7 @@ int probe_spi_res(struct flashchip *flash)
uint8_t spi_read_status_register()
{
const unsigned char cmd[JEDEC_RDSR_OUTSIZE] = { JEDEC_RDSR };
- unsigned char readarr[JEDEC_RDSR_INSIZE];
+ unsigned char readarr[2]; /* JEDEC_RDSR_INSIZE=1 but wbsio needs 2 */
/* Read Status Register */
if (flashbus == BUS_TYPE_SB600_SPI) {
@@ -555,6 +558,8 @@ int spi_chip_read(struct flashchip *flash, uint8_t *buf)
case BUS_TYPE_ICH9_SPI:
case BUS_TYPE_VIA_SPI:
return ich_spi_read(flash, buf);
+ case BUS_TYPE_WBSIO_SPI:
+ return wbsio_spi_read(flash, buf);
default:
printf_debug
("%s called, but no SPI chipset/strapping detected\n",
@@ -575,6 +580,8 @@ int spi_chip_write(struct flashchip *flash, uint8_t *buf)
case BUS_TYPE_ICH9_SPI:
case BUS_TYPE_VIA_SPI:
return ich_spi_write(flash, buf);
+ case BUS_TYPE_WBSIO_SPI:
+ return wbsio_spi_write(flash, buf);
default:
printf_debug
("%s called, but no SPI chipset/strapping detected\n",