Nico Huber merged this change.

View Change

Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved
buspirate_spi: Tristate IOs when using using pullup=on

Avoid putting 3.3V on IO pins when pullup=on to avoid damage to 1.8V
chips.

Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Change-Id: I9ac4c6b7a0079bb1022f2d70030a6eb29996108f
Reviewed-on: https://review.coreboot.org/23864
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M buspirate_spi.c
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/buspirate_spi.c b/buspirate_spi.c
index db8b310..fad309f 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -543,6 +543,10 @@

/* Set SPI config: output type, idle, clock edge, sample */
bp_commbuf[0] = 0x80 | 0xa;
+ if (pullup == 1) {
+ bp_commbuf[0] &= ~(1 << 3);
+ msg_pdbg("Pull-ups enabled, so using HiZ pin output! (Open-Drain mode)\n");
+ }
ret = buspirate_sendrecv(bp_commbuf, 1, 1);
if (ret)
return 1;

To view, visit change 23864. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9ac4c6b7a0079bb1022f2d70030a6eb29996108f
Gerrit-Change-Number: 23864
Gerrit-PatchSet: 3
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Idwer Vollering <vidwer@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner@gmx.at>
Gerrit-Reviewer: Urja Rannikko <urjaman@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>