mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
Omitting the wait for SPI ready when there is no data to be read, e.g
readcnt==0 saves 10 seconds with the unconditional 10us delay, reducing programming time for SST25VF016B to 40-45 secs. Corresponding to flashrom svn r183 and coreboot v2 svn r3068. Signed-off-by: Ronald Hoogenboom <hoogenboom30@zonnet.nl> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
201bde33d0
commit
d4554c5d73
3
spi.c
3
spi.c
@ -227,6 +227,8 @@ static int it8716f_spi_command(uint16_t port, unsigned int writecnt, unsigned in
|
|||||||
* We can't use writecnt directly, but have to use a strange encoding.
|
* We can't use writecnt directly, but have to use a strange encoding.
|
||||||
*/
|
*/
|
||||||
outb(((0x4 + (fast_spi ? 1 : 0)) << 4) | ((readcnt & 0x3) << 2) | (writeenc), port);
|
outb(((0x4 + (fast_spi ? 1 : 0)) << 4) | ((readcnt & 0x3) << 2) | (writeenc), port);
|
||||||
|
|
||||||
|
if (readcnt > 0) {
|
||||||
do {
|
do {
|
||||||
busy = inb(port) & 0x80;
|
busy = inb(port) & 0x80;
|
||||||
} while (busy);
|
} while (busy);
|
||||||
@ -234,6 +236,7 @@ static int it8716f_spi_command(uint16_t port, unsigned int writecnt, unsigned in
|
|||||||
for (i = 0; i < readcnt; i++) {
|
for (i = 0; i < readcnt; i++) {
|
||||||
readarr[i] = inb(port + 5 + i);
|
readarr[i] = inb(port + 5 + i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user