summaryrefslogtreecommitdiffstats
path: root/wbsio_spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-14 19:57:52 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-14 19:57:52 +0000
commitca812d40d461e70a70df6079978e96642775e7b2 (patch)
tree2de588625302d190884e05aca9755f4f075ab2a4 /wbsio_spi.c
parent9a795d83fbb8842a271d5e037dc983a57b0419fd (diff)
downloadast2050-flashrom-ca812d40d461e70a70df6079978e96642775e7b2.zip
ast2050-flashrom-ca812d40d461e70a70df6079978e96642775e7b2.tar.gz
Use the max_rom_decode infrastructure for wbsio_spi
Use this instead of the open-coding variant that only aborts after it is too late. Corresponding to flashrom svn r1081. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'wbsio_spi.c')
-rw-r--r--wbsio_spi.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/wbsio_spi.c b/wbsio_spi.c
index 8db6524..b8f8b38 100644
--- a/wbsio_spi.c
+++ b/wbsio_spi.c
@@ -69,6 +69,9 @@ int wbsio_check_for_spi(void)
buses_supported |= CHIP_BUSTYPE_SPI;
spi_controller = SPI_CONTROLLER_WBSIO;
+ msg_pdbg("%s: Winbond saved on 4 register bits so max chip size is "
+ "1024 KB!\n", __func__);
+ max_rom_decode.spi = 1024 * 1024;
return 0;
}
@@ -179,24 +182,7 @@ int wbsio_spi_send_command(unsigned int writecnt, unsigned int readcnt,
int wbsio_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len)
{
- int size = flash->total_size * 1024;
-
- if (size > 1024 * 1024) {
- msg_perr("%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__);
- return 1;
- }
-
return read_memmapped(flash, buf, start, len);
}
-int wbsio_spi_write_1(struct flashchip *flash, uint8_t *buf, int start, int len)
-{
- if (flash->total_size * 1024 > 1024 * 1024) {
- msg_perr("%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__);
- return 1;
- }
-
- return spi_chip_write_1_new(flash, buf, start, len);
-}
-
#endif
OpenPOWER on IntegriCloud