summaryrefslogtreecommitdiffstats
path: root/spi.c
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2008-06-30 21:38:30 +0000
committerRudolf Marek <r.marek@assembler.cz>2008-06-30 21:38:30 +0000
commit3fdbccf697e35e3061d7a78bed10061c71b60425 (patch)
tree271d5f182058cf38b21a81525bee9a4b049ed8da /spi.c
parent10693353eef0cddcfb844c318363da787f69e023 (diff)
downloadast2050-flashrom-3fdbccf697e35e3061d7a78bed10061c71b60425.zip
ast2050-flashrom-3fdbccf697e35e3061d7a78bed10061c71b60425.tar.gz
This patch adds support for VIA SPI controller on VT8237S
It is similar with few documented exceptions to ICH7 SPI controller. Corresponding to flashrom svn r282 and coreboot v2 svn r3398. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/spi.c b/spi.c
index 1de02a4..60fa990 100644
--- a/spi.c
+++ b/spi.c
@@ -36,8 +36,8 @@ int spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char
{
if (it8716f_flashport)
return it8716f_spi_command(writecnt, readcnt, writearr, readarr);
- else if (ich7_detected)
- return ich_spi_command(writecnt, readcnt, writearr, readarr);
+ else if ((ich7_detected) || (viaspi_detected))
+ return ich_spi_command(writecnt, readcnt, writearr, readarr);
else if (ich9_detected)
return ich_spi_command(writecnt, readcnt, writearr, readarr);
printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
@@ -360,8 +360,8 @@ int spi_chip_read(struct flashchip *flash, uint8_t *buf)
{
if (it8716f_flashport)
return it8716f_spi_chip_read(flash, buf);
- else if (ich7_detected)
- return ich_spi_read(flash, buf);
+ else if ((ich7_detected) || (viaspi_detected))
+ return ich_spi_read(flash, buf);
else if (ich9_detected)
return ich_spi_read(flash, buf);
printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
@@ -372,8 +372,8 @@ int spi_chip_write(struct flashchip *flash, uint8_t *buf)
{
if (it8716f_flashport)
return it8716f_spi_chip_write(flash, buf);
- else if (ich7_detected)
- return ich_spi_write(flash, buf);
+ else if ((ich7_detected) || (viaspi_detected))
+ return ich_spi_write(flash, buf);
else if (ich9_detected)
return ich_spi_write(flash, buf);
printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
OpenPOWER on IntegriCloud