summaryrefslogtreecommitdiffstats
path: root/spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-23 01:36:08 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-23 01:36:08 +0000
commitf8555e24a456551de9ce3d89fc648db9034ef517 (patch)
treeb2ed02345452c285f0138e2a2777e1dab46ba617 /spi.c
parent414bd320ac1346db9539625975644bfa7b30281e (diff)
downloadast2050-flashrom-f8555e24a456551de9ce3d89fc648db9034ef517.zip
ast2050-flashrom-f8555e24a456551de9ce3d89fc648db9034ef517.tar.gz
This is a workaround for a bug in SB600 and SB700
If we only send an opcode and no additional data/address, the SPI controller will read one byte too few from the chip. Basically, the last byte of the chip response is discarded and will not end up in the FIFO. It is unclear if the CS# line is set high too early as well. That hardware bug is undocumented as of now, but I'm working with AMD to add a detailed description of it to the errata. Add loads of additional debugging to SB600/SB700 init. Add explanatory comments for unintuitive code flow. Thanks go to Uwe for testing quite a few iterations of the patch. Kill the SB600 flash chip status register special case, which was a somewhat misguided workaround for that hardware erratum. Note for future added features in the SB600 SPI driver: It may be possible to read up to 15 bytes of command response with overlapping reads due to the ring buffer design of the FIFO if the command can be repeated without ill effects. Same for skipping up to 7 bytes between command and response. Corresponding to flashrom svn r661. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/spi.c b/spi.c
index 8d82c4e..c177fb0 100644
--- a/spi.c
+++ b/spi.c
@@ -367,10 +367,6 @@ uint8_t spi_read_status_register(void)
int ret;
/* Read Status Register */
- if (spi_controller == SPI_CONTROLLER_SB600) { /* FIXME */
- /* Workaround for SB600 hardware bug. Can be killed later. */
- return sb600_read_status_register();
- }
ret = spi_send_command(sizeof(cmd), sizeof(readarr), cmd, readarr);
if (ret)
fprintf(stderr, "RDSR failed!\n");
OpenPOWER on IntegriCloud