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>
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;