Sean Anderson has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/43608 )
Change subject: buspirate: Add option for setting the aux pin
......................................................................
buspirate: Add option for setting the aux pin
This adds a parameter to drive the aux pin low (or high if you
explicitly want the previous behavior). Some boards need to have a reset
pin driven low before the firmware can be safely flashed. With the Bus
Pirate, this is most easily done with the auxiliary pin.
Change-Id: Ieeecfdf1afc06dadda9b8f99547cd74854ca6775
Signed-off-by: Sean Anderson <seanga2(a)gmail.com>
---
M buspirate_spi.c
M flashrom.8.tmpl
2 files changed, 33 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/08/43608/1
diff --git a/buspirate_spi.c b/buspirate_spi.c
index fdfc0e4..1ccb107 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -228,6 +228,7 @@
int serialspeed_index = -1;
int ret = 0;
int pullup = 0;
+ int aux = 1;
dev = extract_programmer_param("dev");
if (dev && !strlen(dev)) {
@@ -277,6 +278,17 @@
}
free(tmp);
+ tmp = extract_programmer_param("aux");
+ if (tmp) {
+ if (strcasecmp("high", tmp) == 0)
+ ; /* Default */
+ else if (strcasecmp("low", tmp) == 0)
+ aux = 0;
+ else
+ msg_perr("Invalid AUX state, driving high by default.\n");
+ }
+ free(tmp);
+
/* Default buffer size is 19: 16 bytes data, 3 bytes control. */
#define DEFAULT_BUFSIZE (16 + 3)
bp_commbuf = malloc(DEFAULT_BUFSIZE);
@@ -520,11 +532,18 @@
}
/* Initial setup (SPI peripherals config): Enable power, CS high, AUX */
- bp_commbuf[0] = 0x40 | 0x0b;
+ bp_commbuf[0] = 0x40 | 0x09;
if (pullup == 1) {
bp_commbuf[0] |= (1 << 2);
msg_pdbg("Enabling pull-up resistors.\n");
}
+ if (aux) {
+ bp_commbuf[0] |= (1 << 1);
+ msg_pdbg("Driving AUX high.\n");
+ } else {
+ msg_pdbg("Driving AUX low.\n");
+ }
+
ret = buspirate_sendrecv(bp_commbuf, 1, 1);
if (ret)
return 1;
diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl
index db50d59..caf860c 100644
--- a/flashrom.8.tmpl
+++ b/flashrom.8.tmpl
@@ -902,6 +902,19 @@
.URLB "http://dangerousprototypes.com/docs/Practical_guide_to_Bus_Pirate_pull-up_r…" \
"in a guide by dangerousprototypes" .
Only the external supply voltage (Vpu) is supported as of this writing.
+.sp
+An optional aux parameter specifies the state of the Bus Pirate auxiliary pin.
+This may be used to drive the auxiliary pin high or low before a transfer.
+Syntax is
+.sp
+.B " flashrom -p buspirate_spi:aux=state"
+.sp
+where
+.B state
+can be
+.BR high " or " low .
+The default
+.BR state " is " high .
.SS
.BR "pickit2_spi " programmer
.IP
--
To view, visit https://review.coreboot.org/c/flashrom/+/43608
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ieeecfdf1afc06dadda9b8f99547cd74854ca6775
Gerrit-Change-Number: 43608
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Anderson <seanga2(a)gmail.com>
Gerrit-MessageType: newchange
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72630 )
Change subject: jedec.c: Make programer_delay() usage symetrical
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/72630/comment/a6c69480_7c6f064f
PS3, Line 7: Make programer_delay() usage symetrical
What does that mean?
--
To view, visit https://review.coreboot.org/c/flashrom/+/72630
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia8c22914bc14d39716fb2f82f0b8394edc1cae7f
Gerrit-Change-Number: 72630
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:41:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72632 )
Change subject: jedec.c: Use JEDEC_ define from spi.h over magic
......................................................................
Patch Set 1:
(1 comment)
File jedec.c:
https://review.coreboot.org/c/flashrom/+/72632/comment/1a40f12f_7e7f64d4
PS1, Line 135: JEDEC_REMS
Are we sure that this is more readable than the "magic" (given that two out of the three values remain "magic")
--
To view, visit https://review.coreboot.org/c/flashrom/+/72632
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id0c98ee900e37c26dc06f96a9950713f332240fd
Gerrit-Change-Number: 72632
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:38:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72632 )
Change subject: jedec.c: Use JEDEC_ define from spi.h over magic
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
```
jedec.c: In function 'probe_jedec_29gl':
jedec.c:135:28: error: 'JEDEC_REMS' undeclared (first use in this function)
135 | chip_writeb(flash, JEDEC_REMS, bios + (0x5555 & mask));
| ^~~~~~~~~~
jedec.c:135:28: note: each undeclared identifier is reported only once for each function it appears in
jedec.c: In function 'probe_jedec':
jedec.c:219:28: error: 'JEDEC_REMS' undeclared (first use in this function)
219 | chip_writeb(flash, JEDEC_REMS, bios + ((shifted ? 0x2AAA : 0x5555) & mask));
| ^~~~~~~~~~
```
--
To view, visit https://review.coreboot.org/c/flashrom/+/72632
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id0c98ee900e37c26dc06f96a9950713f332240fd
Gerrit-Change-Number: 72632
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:37:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72631 )
Change subject: jedec.c: Fold up mask param into func
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72631
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iee4b1d5bc850cbeec0de9a1603fe04a3a1855330
Gerrit-Change-Number: 72631
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:36:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72608 )
Change subject: jedec.c: Rewrite control flow procedurally
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72608
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0927ed40e54cc7e114a57dc40e3614f4825a0ca9
Gerrit-Change-Number: 72608
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:35:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72607 )
Change subject: jedec.c: Move printlock stuff into printlock.c
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72607
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iacaa16c81e141aac30feb6871700c4fdc9eec8e9
Gerrit-Change-Number: 72607
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:33:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72607 )
Change subject: jedec.c: Move printlock stuff into printlock.c
......................................................................
Patch Set 1:
(1 comment)
File printlock.c:
https://review.coreboot.org/c/flashrom/+/72607/comment/a0485b4f_3d4d5578
PS1, Line 4: * Copyright (C) 2000 Silicon Integrated System Corporation
: * Copyright (C) 2006 Giampiero Giancipoli <gianci(a)email.it>
: * Copyright (C) 2006 coresystems GmbH <info(a)coresystems.de>
: * Copyright (C) 2007-2012 Carl-Daniel Hailfinger
: * Copyright (C) 2009 Sean Nelson <audiohacked(a)gmail.com>
: * Copyright (C) 2014 Stefan Tauner
Is this list correct for this new file?
--
To view, visit https://review.coreboot.org/c/flashrom/+/72607
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iacaa16c81e141aac30feb6871700c4fdc9eec8e9
Gerrit-Change-Number: 72607
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:33:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72502 )
Change subject: jedec.c: Consolidate op,operand sequencing into func
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72502
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9a1b211b49777f6d7f62a052975c1759e036c8df
Gerrit-Change-Number: 72502
Gerrit-PatchSet: 4
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:32:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72502 )
Change subject: jedec.c: Consolidate op,operand sequencing into func
......................................................................
Patch Set 4:
(1 comment)
File jedec.c:
https://review.coreboot.org/c/flashrom/+/72502/comment/d8f4376e_554c7968
PS4, Line 325: toggle_ready_jedec_slow(flash, bios);
It seems that toggle_jedec_slow could dereference flash->virtual_memory itself here.
--
To view, visit https://review.coreboot.org/c/flashrom/+/72502
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9a1b211b49777f6d7f62a052975c1759e036c8df
Gerrit-Change-Number: 72502
Gerrit-PatchSet: 4
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 31 Jan 2023 22:32:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment