1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

Multiple unrelated changes

- replace the hand written serial input flush routine with the termios one.
- serialport_discard_read isn't necessary anymore - it just wrapped
  sp_flush_incoming with no extra value.
- serialport_read and serialport_write would misbehave if read or write
  didn't process everything in one go.
- sp_flush_incoming should be #define'd out for FAKE_COMMUNICATION like
  serialport_discard_read was

Corresponding to flashrom svn r831.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Sean Nelson <audiohacked@gmail.com>
This commit is contained in:
Patrick Georgi
2010-01-06 19:09:40 +00:00
committed by Patrick Georgi
parent efa151eb10
commit 3b6237dbce
3 changed files with 11 additions and 34 deletions

View File

@ -40,7 +40,7 @@ int buspirate_serialport_setup(char *dev)
#define serialport_shutdown(...) 0
#define serialport_write(...) 0
#define serialport_read(...) 0
#define serialport_discard_read(...) 0
#define sp_flush_incoming(...) 0
#endif
int buspirate_sendrecv(unsigned char *buf, unsigned int writecnt, unsigned int readcnt)
@ -144,9 +144,7 @@ int buspirate_spi_init(void)
if (ret)
return ret;
/* Read any response and discard it. */
ret = serialport_discard_read();
if (ret)
return ret;
sp_flush_incoming();
}
/* Enter raw bitbang mode */
buf[0] = 0x00;