1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

Make sure we delay writing the next byte long enough in SPI byte programming

Minor formatting changes.

Corresponding to flashrom svn r184 and coreboot v2 svn r3069.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Harald Gutmann <harald.gutmann@gmx.net>
This commit is contained in:
Carl-Daniel Hailfinger 2008-01-22 14:37:31 +00:00
parent d4554c5d73
commit d3568adfe1

9
spi.c
View File

@ -519,12 +519,8 @@ int it8716f_over512k_spi_chip_write(struct flashchip *flash, uint8_t *buf)
for (i = 0; i < total_size; i++) { for (i = 0; i < total_size; i++) {
generic_spi_write_enable(); generic_spi_write_enable();
spi_byte_program(i, buf[i]); spi_byte_program(i, buf[i]);
/* FIXME: We really should read the status register and delay while (generic_spi_read_status_register() & JEDEC_RDSR_BIT_WIP)
* accordingly.
*/
//while (generic_spi_read_status_register() & JEDEC_RDSR_BIT_WIP)
myusec_delay(10); myusec_delay(10);
//if (i%1024==0) fputc('b',stderr);
} }
/* resume normal ops... */ /* resume normal ops... */
outb(0x20, it8716f_flashport); outb(0x20, it8716f_flashport);
@ -556,7 +552,8 @@ int generic_spi_chip_read(struct flashchip *flash, uint8_t *buf)
if (total_size > 512 * 1024) { if (total_size > 512 * 1024) {
for (i = 0; i < total_size; i += 3) { for (i = 0; i < total_size; i += 3) {
int toread = 3; int toread = 3;
if (total_size-i < toread) toread=total_size-i; if (total_size - i < toread)
toread = total_size - i;
spi_3byte_read(i, buf + i, toread); spi_3byte_read(i, buf + i, toread);
} }
} else { } else {