Jeremy Kerr has uploaded this change for review.

View Change

buspirate: Add psus option

This change adds a 'psus=<on|off>' option, to control the external Vcc
state of the bus pirate, allowing hardware where the SPI flash chip is
powered by the 3V3/5V lines directly.

Change-Id: I8a7d4b40c0f7f04f6976f6757f05b61f2c9958f9
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
M buspirate_spi.c
1 file changed, 16 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/87/54887/1
diff --git a/buspirate_spi.c b/buspirate_spi.c
index 96e9673..2024458 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -316,6 +316,7 @@
int serialspeed_index = -1;
int ret = 0;
int pullup = 0;
+ int psu = 0;

dev = extract_programmer_param("dev");
if (dev && !strlen(dev)) {
@@ -365,6 +366,17 @@
}
free(tmp);

+ tmp = extract_programmer_param("psus");
+ if (tmp) {
+ if (strcasecmp("on", tmp) == 0)
+ psu = 1;
+ else if (strcasecmp("off", tmp) == 0)
+ ; // ignore
+ else
+ msg_perr("Invalid psus state, not enabling.\n");
+ }
+ free(tmp);
+
/* Default buffer size is 19: 16 bytes data, 3 bytes control. */
#define DEFAULT_BUFSIZE (16 + 3)
bp_commbuf = malloc(DEFAULT_BUFSIZE);
@@ -613,6 +625,10 @@
bp_commbuf[0] |= (1 << 2);
msg_pdbg("Enabling pull-up resistors.\n");
}
+ if (psu == 1) {
+ bp_commbuf[0] |= (1 << 3);
+ msg_pdbg("Enabling PSUs.\n");
+ }
ret = buspirate_sendrecv(bp_commbuf, 1, 1);
if (ret)
return 1;

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8a7d4b40c0f7f04f6976f6757f05b61f2c9958f9
Gerrit-Change-Number: 54887
Gerrit-PatchSet: 1
Gerrit-Owner: Jeremy Kerr <jk@ozlabs.org>
Gerrit-MessageType: newchange