Attention is currently required from: Alan Green.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49631 )
Change subject: programmer: remove unused noop_shutdown function
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/49631
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I1b67223aed8be54b60771aa1b2d498836ed28060
Gerrit-Change-Number: 49631
Gerrit-PatchSet: 1
Gerrit-Owner: Alan Green <avg(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Alan Green <avg(a)google.com>
Gerrit-Comment-Date: Mon, 18 Jan 2021 06:38:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Alan Green has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/49632 )
Change subject: ft2232_spi.c: release I/Os on shutdown
......................................................................
ft2232_spi.c: release I/Os on shutdown
Resets FTDI I/O pins to high-Z (input) when shutting down. This allows
other devices to use the SPI bus without having to disconnect the
programmer.
This change will introduce a backward incompatibility in the case where
a user is relying on the state of FTDI outputs post-programming (eg. to
disallow another device from driving CS low).
However, there are likely more cases where releasing the SPI bus is
likely the correct thing to do.
Signed-off-by: Alan Green <avg(a)google.com>
Change-Id: I9fae55e532595752983f55fac2298f81699dbe5b
---
M ft2232_spi.c
1 file changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/32/49632/1
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 65ff449..6cf7a3c 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -106,6 +106,7 @@
static uint8_t pindir = 0x0b;
static struct ftdi_context ftdic_context;
+
static const char *get_ft2232_devicename(int ft2232_vid, int ft2232_type)
{
int i;
@@ -159,6 +160,32 @@
return 0;
}
+static int ft2232_shutdown(void *data)
+{
+ int ret = 0;
+ int f;
+ struct ftdi_context *ftdic = &ftdic_context;
+ unsigned char buf[3];
+
+ msg_pdbg("Releasing I/Os\n");
+ buf[0] = SET_BITS_LOW;
+ buf[1] = 0; /* Output byte ignored */
+ buf[2] = 0; /* Pin direction: all inputs */
+ if (send_buf(ftdic, buf, 3)) {
+ ret = -8;
+ goto ftdi_err;
+ }
+
+ftdi_err:
+ if ((f = ftdi_usb_close(ftdic)) < 0) {
+ msg_perr("Unable to close FTDI device: %d (%s)\n", f,
+ ftdi_get_error_string(ftdic));
+ return f;
+ }
+
+ return ret;
+}
+
static int ft2232_spi_send_command(const struct flashctx *flash,
unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr,
@@ -453,6 +480,7 @@
goto ftdi_err;
}
+ register_shutdown(ft2232_shutdown, ftdic);
register_spi_master(&spi_master_ft2232);
return 0;
--
To view, visit https://review.coreboot.org/c/flashrom/+/49632
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9fae55e532595752983f55fac2298f81699dbe5b
Gerrit-Change-Number: 49632
Gerrit-PatchSet: 1
Gerrit-Owner: Alan Green <avg(a)google.com>
Gerrit-MessageType: newchange
Alan Green has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/49631 )
Change subject: programmer: remove unused noop_shutdown function
......................................................................
programmer: remove unused noop_shutdown function
Function appears to be vestigal.
Signed-off-by: Alan Green <avg(a)google.com>
Change-Id: I1b67223aed8be54b60771aa1b2d498836ed28060
---
M programmer.c
1 file changed, 0 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/31/49631/1
diff --git a/programmer.c b/programmer.c
index 5c841ef..bee60e3 100644
--- a/programmer.c
+++ b/programmer.c
@@ -17,12 +17,6 @@
#include "flash.h"
#include "programmer.h"
-/* No-op shutdown() for programmers which don't need special handling */
-int noop_shutdown(void)
-{
- return 0;
-}
-
/* Fallback map() for programmers which don't need special handling */
void *fallback_map(const char *descr, uintptr_t phys_addr, size_t len)
{
--
To view, visit https://review.coreboot.org/c/flashrom/+/49631
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I1b67223aed8be54b60771aa1b2d498836ed28060
Gerrit-Change-Number: 49631
Gerrit-PatchSet: 1
Gerrit-Owner: Alan Green <avg(a)google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Stefan Reinauer, Edward O'Callaghan, Angel Pons.
Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49255 )
Change subject: bitbang-spi.c: support clock polarity and phase
......................................................................
Patch Set 26:
(3 comments)
File bitbang_spi.c:
https://review.coreboot.org/c/flashrom/+/49255/comment/6b95b21f_b363f031
PS12, Line 208:
: if (parse_spi_mode(&cpol, &cpha))
: return ERROR_FLASHROM_BUG;
> No you should initialise to 0 explicitly, not rely on the specific toolchain that happens to be inst […]
Ok. Initialization code has been added.
File bitbang_spi.c:
https://review.coreboot.org/c/flashrom/+/49255/comment/9d60aed7_17c60aef
PS14, Line 41:
: static int cpol; /* Clock Polarity */
: static int cpha; /* Clock Phase */
> not done.
Done
https://review.coreboot.org/c/flashrom/+/49255/comment/0ae6938c_46f88abb
PS14, Line 210: ERROR_FLASHROM_BUG
> not done, please don't resolve if not actually resolved. […]
Thank you very much
--
To view, visit https://review.coreboot.org/c/flashrom/+/49255
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I04c1dfe132d756119229b27c3cd611d1be1abc8d
Gerrit-Change-Number: 49255
Gerrit-PatchSet: 26
Gerrit-Owner: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: 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-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-CC: Shawn C <citypw(a)hardenedlinux.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Mon, 18 Jan 2021 03:12:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Xiang Wang <merle(a)hardenedlinux.org>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Xiang Wang, Stefan Reinauer, Angel Pons.
Hello build bot (Jenkins), Stefan Reinauer, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/49255
to look at the new patch set (#26).
Change subject: bitbang-spi.c: support clock polarity and phase
......................................................................
bitbang-spi.c: support clock polarity and phase
SPI has four modes, which are determined by Clock polarity and Clock
phase. See https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Clock_polarity_an…
for details. The previous code only supports one mode and may not be
able to handle some special spi flash. This patch uses spi's mode0 by
default to be consistent with the previous code.
TEST=build and run flashrom with sysfsgpio on raspberrypi to read W25Q128.V
Change-Id: I04c1dfe132d756119229b27c3cd611d1be1abc8d
Signed-off-by: Xiang Wang <merle(a)hardenedlinux.org>
---
M bitbang_spi.c
1 file changed, 69 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/55/49255/26
--
To view, visit https://review.coreboot.org/c/flashrom/+/49255
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I04c1dfe132d756119229b27c3cd611d1be1abc8d
Gerrit-Change-Number: 49255
Gerrit-PatchSet: 26
Gerrit-Owner: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: 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-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-CC: Shawn C <citypw(a)hardenedlinux.org>
Gerrit-Attention: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Xiang Wang, Stefan Reinauer.
Sam McNally has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49594 )
Change subject: flashrom.c: fix programmer_table
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/49594
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id0755d550d1e5736f0fb3983028c2733822ebbcb
Gerrit-Change-Number: 49594
Gerrit-PatchSet: 1
Gerrit-Owner: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Shawn C <citypw(a)hardenedlinux.org>
Gerrit-Attention: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Mon, 18 Jan 2021 00:09:46 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/49618 )
Change subject: util/getrevision.sh: Fallback when git tags is missing
......................................................................
util/getrevision.sh: Fallback when git tags is missing
If the tags are missing the version may not be evaluated correctly.
BUG=b:177691209
BRANCH=none
TEST=none
Change-Id: Ib9f85b2be8b6f5e1332ba98a8a71fcad12331818
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M util/getrevision.sh
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/18/49618/1
diff --git a/util/getrevision.sh b/util/getrevision.sh
index 168dd63..f7d6bf3 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -129,7 +129,7 @@
revision() {
local r
if git_is_file_tracked "$1" ; then
- r=$(git describe $(git_last_commit "$1"))
+ r=$(git describe --always $(git_last_commit "$1"))
if git_has_local_changes "$1" ; then
r="$r-dirty"
fi
--
To view, visit https://review.coreboot.org/c/flashrom/+/49618
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib9f85b2be8b6f5e1332ba98a8a71fcad12331818
Gerrit-Change-Number: 49618
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Xiang Wang, Stefan Reinauer, Angel Pons.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49255 )
Change subject: bitbang-spi.c: support clock polarity and phase
......................................................................
Patch Set 25:
(3 comments)
File bitbang_spi.c:
https://review.coreboot.org/c/flashrom/+/49255/comment/2ae60be5_32b86965
PS12, Line 208:
: if (parse_spi_mode(&cpol, &cpha))
: return ERROR_FLASHROM_BUG;
> Global static variables are initialized to 0 by default
No you should initialise to 0 explicitly, not rely on the specific toolchain that happens to be installed.
File bitbang_spi.c:
https://review.coreboot.org/c/flashrom/+/49255/comment/38c17da0_85c08208
PS14, Line 41:
: static int cpol; /* Clock Polarity */
: static int cpha; /* Clock Phase */
> Done
not done.
https://review.coreboot.org/c/flashrom/+/49255/comment/1a52d274_cbe7f28c
PS14, Line 210: ERROR_FLASHROM_BUG
> Done
not done, please don't resolve if not actually resolved.
You want `SPI_PROGRAMMER_ERROR` here, ERROR_FLASHROM_BUG has a very specific meaning for when things miscompile etc. It's not for here.
Flashrom has rather poor to non-existent error code sanity, lets not make it any worse here.
--
To view, visit https://review.coreboot.org/c/flashrom/+/49255
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I04c1dfe132d756119229b27c3cd611d1be1abc8d
Gerrit-Change-Number: 49255
Gerrit-PatchSet: 25
Gerrit-Owner: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: 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-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-CC: Shawn C <citypw(a)hardenedlinux.org>
Gerrit-Attention: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Sun, 17 Jan 2021 15:34:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Xiang Wang <merle(a)hardenedlinux.org>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Xiang Wang, Stefan Reinauer.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49599 )
Change subject: flashrom.c: automatic generated programmer_enum.h
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
As an aside, I would be interested to hear your views on how https://review.coreboot.org/c/flashrom/+/47356 could be realised into something sensible.
--
To view, visit https://review.coreboot.org/c/flashrom/+/49599
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3f4370ccae2b64da3c4178243b192700d3d205d2
Gerrit-Change-Number: 49599
Gerrit-PatchSet: 2
Gerrit-Owner: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Reviewer: 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-CC: Shawn C <citypw(a)hardenedlinux.org>
Gerrit-Attention: Xiang Wang <merle(a)hardenedlinux.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Sun, 17 Jan 2021 13:18:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment