Shiyu Sun has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/47874 )
Change subject: lspcon_i2c_spi.c: Fix style
......................................................................
lspcon_i2c_spi.c: Fix style
Avoid define the variable i at the for loop statement.
BUG=None
TEST=None
Signed-off-by: Shiyu Sun <sshiyu(a)chromium.org>
Change-Id: I4068ae7bdf6e053606cb063f7781dbb2d77792ff
---
M lspcon_i2c_spi.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/74/47874/1
diff --git a/lspcon_i2c_spi.c b/lspcon_i2c_spi.c
index 7b9f1c0..f468031 100644
--- a/lspcon_i2c_spi.c
+++ b/lspcon_i2c_spi.c
@@ -377,6 +377,7 @@
unsigned int start, unsigned int len)
{
int ret = 0;
+ unsigned int i;
if (start & 0xff)
return default_spi_write_256(flash, buf, start, len);
@@ -389,7 +390,7 @@
ret |= lspcon_i2c_spi_enable_hw_write(fd);
ret |= lspcon_i2c_clt2_spi_reset(fd);
- for (unsigned int i = 0; i < len; i += PAGE_SIZE) {
+ for (i = 0; i < len; i += PAGE_SIZE) {
ret |= lspcon_i2c_spi_map_page(fd, start + i);
ret |= lspcon_i2c_spi_write_page(fd, buf + i, min(len - i, PAGE_SIZE));
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/47874
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I4068ae7bdf6e053606cb063f7781dbb2d77792ff
Gerrit-Change-Number: 47874
Gerrit-PatchSet: 1
Gerrit-Owner: Shiyu Sun <sshiyu(a)google.com>
Gerrit-MessageType: newchange
Edward O'Callaghan has uploaded a new patch set (#16) to the change originally created by David Hendricks. ( https://review.coreboot.org/c/flashrom/+/23021 )
Change subject: layout: Add -i <region>[:<file>] support
......................................................................
layout: Add -i <region>[:<file>] support
Add an optional sub-parameter to the -i parameter to allow building the
image to be written from multiple files. This will also allow regions to
be read from flash and written to separate image files.
This is a rebase of a patch that was ported from chromiumos. A lot of
things have changed, but the idea is the same.
Original patch by Louis Yung-Chieh Lo <yjlou(a)chromium.org>:
Summary: Support -i partition:file feature for both read and write.
Commit: 9c7525f
Review URL: http://codereview.chromium.org/6611015
Ported version by Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
and Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>:
Summary: [PATCH 2/6] layout: Add -i <region>[:<file>] support.
Review URL: https://mail.coreboot.org/pipermail/flashrom/2013-October/011729.html
Change-Id: Ic5465659605d8431d931053967b40290195cfd99
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Signed-off-by: Stefan Tauner <stefan.tauner(a)student.tuwien.ac.at>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Co-Authored-by: Edward O'Callaghan <quasisec(a)google.com>
---
M cli_classic.c
M dummyflasher.c
M flash.h
M flashrom.8.tmpl
M flashrom.c
M layout.c
M layout.h
7 files changed, 233 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/21/23021/16
--
To view, visit https://review.coreboot.org/c/flashrom/+/23021
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic5465659605d8431d931053967b40290195cfd99
Gerrit-Change-Number: 23021
Gerrit-PatchSet: 16
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006(a)gmx.net>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nicola Corna <nicola(a)corna.info>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/47859 )
Change subject: dummyflasher.c: Allow filling with either 0x00 or 0xff
......................................................................
dummyflasher.c: Allow filling with either 0x00 or 0xff
This upstreams a ChromiumOS feature that allows the user
of the dummyflasher spi master to either fill with 0x00
or 0xff in the fake flash content by way of a spi master
param.
BUG=b:140394053
BRANCH=none
TEST=none
Change-Id: I37c6dee932e449201d8bbfb03ca6d139da3cb6a2
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M dummyflasher.c
1 file changed, 22 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/59/47859/1
diff --git a/dummyflasher.c b/dummyflasher.c
index 82aa3c8..d9c4085 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -52,6 +52,7 @@
enum emu_chip emu_chip;
char *emu_persistent_image;
unsigned int emu_chip_size;
+ int erase_to_zero;
int emu_modified; /* is the image modified since reading it? */
uint8_t emu_status;
/* If "freq" parameter is passed in from command line, commands will delay
@@ -454,6 +455,21 @@
free(tmp);
return 1;
}
+
+ /* Should emulated flash erase to zero (yes/no)? */
+ tmp = extract_programmer_param("erase_to_zero");
+ if (tmp) {
+ if (!strcmp(tmp, "yes")) {
+ msg_pdbg("Emulated chip will erase to 0x00\n");
+ data->erase_to_zero = 1;
+ } else if (!strcmp(tmp, "no")) {
+ msg_pdbg("Emulated chip will erase to 0xff\n");
+ } else {
+ msg_perr("erase_to_zero can be \"yes\" or \"no\"\n");
+ return 1;
+ }
+ }
+
free(tmp);
flashchip_contents = malloc(data->emu_chip_size);
if (!flashchip_contents) {
@@ -478,8 +494,9 @@
}
#endif
- msg_pdbg("Filling fake flash chip with 0xff, size %i\n", data->emu_chip_size);
- memset(flashchip_contents, 0xff, data->emu_chip_size);
+ msg_pdbg("Filling fake flash chip with 0x%02x, size %i\n",
+ data->erase_to_zero ? 0x00 : 0xff, data->emu_chip_size);
+ memset(flashchip_contents, data->erase_to_zero ? 0x00 : 0xff, data->emu_chip_size);
/* Will be freed by shutdown function if necessary. */
data->emu_persistent_image = extract_programmer_param("image");
@@ -1052,6 +1069,9 @@
msg_cdbg("%s: set flash->total_size to %dK bytes.\n", __func__,
flash->chip->total_size);
+ if (emu_data->erase_to_zero)
+ flash->chip->feature_bits |= FEATURE_ERASED_ZERO;
+
/* Update the first count of each of the block_erasers. */
for (i = 0; i < NUM_ERASEFUNCTIONS; i++) {
struct block_eraser *eraser = &flash->chip->block_erasers[i];
--
To view, visit https://review.coreboot.org/c/flashrom/+/47859
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I37c6dee932e449201d8bbfb03ca6d139da3cb6a2
Gerrit-Change-Number: 47859
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange