Convert SPI byte program to use the multicommand infrastructure
Tested-by: Jakob Bornecrantz <wallbraker@gmail.com>
Corresponding to flashrom svn r651.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested it on Epia-m700 worked okay.
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
diff --git a/it87spi.c b/it87spi.c
index eae4978..d5f7a51 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -232,6 +232,7 @@
result = spi_write_enable();
if (result)
return result;
+ /* FIXME: The command below seems to be redundant or wrong. */
OUTB(0x06, it8716f_flashport + 1);
OUTB(((2 + (fast_spi ? 1 : 0)) << 4), it8716f_flashport);
for (i = 0; i < 256; i++) {
@@ -262,10 +263,7 @@
spi_disable_blockprotect();
for (i = 0; i < total_size; i++) {
- result = spi_write_enable();
- if (result)
- return result;
- spi_byte_program(i, buf[i]);
+ result = spi_byte_program(i, buf[i]);
while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP)
programmer_delay(10);
}