summaryrefslogtreecommitdiffstats
path: root/programmer.h
diff options
context:
space:
mode:
authorShawn Anastasio <shawnanastasio@yahoo.com>2017-12-31 00:17:15 -0600
committerNico Huber <nico.h@gmx.de>2018-01-26 15:23:10 +0000
commit2b5adfb1b656dd6a6efbf45a7a411c87840c5394 (patch)
treecfc4bf09d45d4ad59b645c0cadaec9507ba5c152 /programmer.h
parent25fde40f8594b1c13ba7a4c3a605b96b200a4e11 (diff)
downloadflashrom-2b5adfb1b656dd6a6efbf45a7a411c87840c5394.tar.gz
flashrom-2b5adfb1b656dd6a6efbf45a7a411c87840c5394.tar.bz2
flashrom-2b5adfb1b656dd6a6efbf45a7a411c87840c5394.zip
buspirate_spi: Add support for variable serial speeds
This patch sets the default baud rate for communication between the host device and the Bus Pirate for hardware versions 3.0 and greater to 2M baud. It also introduces the ability to manually set the baud rate via the added 'serialspeed' programmer parameter. This is done in two parts. Firstly, the requested serial speed is looked up in a table to determine the appropriate clock divisor and the divisor is sent to the bus pirate. Then, the system's baud rate for the selected serial port is set using serial.c's 'serialport_config'. This function's prototype had to be added to programmer.h. In testing, using the 2M baud rate was able to significantly decrease flash times (down from 20+ minutes to less than 2 minutes for an 8MB flash). Change-Id: I3706f17a94fdf056063f2ad4a5f0a219665cdcbf Signed-off-by: Shawn Anastasio <shawnanastasio@yahoo.com> Reviewed-on: https://review.coreboot.org/23057 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'programmer.h')
-rw-r--r--programmer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/programmer.h b/programmer.h
index 8736449ba..139f4fafa 100644
--- a/programmer.h
+++ b/programmer.h
@@ -759,6 +759,7 @@ typedef int fdtype;
void sp_flush_incoming(void);
fdtype sp_openserport(char *dev, int baud);
extern fdtype sp_fd;
+int serialport_config(fdtype fd, int baud);
int serialport_shutdown(void *data);
int serialport_write(const unsigned char *buf, unsigned int writecnt);
int serialport_write_nonblock(const unsigned char *buf, unsigned int writecnt, unsigned int timeout, unsigned int *really_wrote);