mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-26 22:52:34 +02:00
Fix setting the divisor in ft2232_spi
The patch that should have improved the clock divisor setting in r1537 made it much worse: the divisor used was from an uninitialized buffer. Corresponding to flashrom svn r1542. Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
parent
316fdfbf82
commit
3464d05eb4
@ -325,12 +325,12 @@ int ft2232_spi_init(void)
|
||||
|
||||
msg_pdbg("Set clock divisor\n");
|
||||
buf[0] = 0x86; /* command "set divisor" */
|
||||
buf[1] = (divisor / 2 - 1) & 0xff;
|
||||
buf[2] = ((divisor / 2 - 1) >> 8) & 0xff;
|
||||
if (send_buf(ftdic, buf, 3)) {
|
||||
ret = -6;
|
||||
goto ftdi_err;
|
||||
}
|
||||
buf[1] = (divisor / 2 - 1) & 0xff;
|
||||
buf[2] = ((divisor / 2 - 1) >> 8) & 0xff;
|
||||
|
||||
msg_pdbg("MPSSE clock: %f MHz, divisor: %u, SPI clock: %f MHz\n",
|
||||
mpsse_clk, divisor, (double)(mpsse_clk / divisor));
|
||||
|
Loading…
x
Reference in New Issue
Block a user