Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/23225 )
Change subject: Whitelist Lenovo Thinkpad X220
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/23225/2/board_enable.c
File board_enable.c:
https://review.coreboot.org/#/c/23225/2/board_enable.c@2437
PS2, Line 2437: 0x21DB
coreboot set 0x21db, but vendor set 0x21da...
--
To view, visit https://review.coreboot.org/23225
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idd667da8209a664469c1a909a549d2b625714a78
Gerrit-Change-Number: 23225
Gerrit-PatchSet: 2
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Wed, 24 Jan 2018 08:19:45 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
David Hendricks has posted comments on this change. ( https://review.coreboot.org/23021 )
Change subject: layout: Add -i <region>[:<file>] support.
......................................................................
Patch Set 13:
(3 comments)
PS13 addresses a couple lingering issues from earlier patch sets.
I also came up with a patch to try and implement the original intended behavior for '-w': https://review.coreboot.org/#/c/flashrom/+/23353/
It's a bit hacky though, though it does allow us to keep the policy decision in the CLI code. There might be a better way.
https://review.coreboot.org/#/c/23021/5/flashrom.c
File flashrom.c:
https://review.coreboot.org/#/c/23021/5/flashrom.c@1484
PS5, Line 1484: const char *region_file = layout->entries[i].file;
:
: if (first_entry_encountered == 0) {
: ms
> Should be kept in do_write_buf_to_file() where the actual file handling […]
Done
https://review.coreboot.org/#/c/23021/5/layout.c
File layout.c:
https://review.coreboot.org/#/c/23021/5/layout.c@217
PS5, Line 217: }
> why? is it necessary? doesn't `file` point into `argv` of main()?
No, I don't think it's necessary. It seems to be a remnant of https://mail.coreboot.org/pipermail/flashrom/2013-October/011729.html, but that may have been based on an even older version of layout.c from CrOS.
https://review.coreboot.org/#/c/23021/5/layout.c@285
PS5, Line 285:
removed this as well since we don't need to allocate memory for layout.entries[i].file.
--
To view, visit https://review.coreboot.org/23021
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5465659605d8431d931053967b40290195cfd99
Gerrit-Change-Number: 23021
Gerrit-PatchSet: 13
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: 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: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 22 Jan 2018 08:20:54 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23353 )
Change subject: WIP: Add romentry flags and function to append a single layout entry
......................................................................
Patch Set 1: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1077/ : SUCCESS
https://qa.coreboot.org/job/flashrom_gerrit/919/ : SUCCESS
--
To view, visit https://review.coreboot.org/23353
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9eb4a7751681c639028d6854d877558daf59e567
Gerrit-Change-Number: 23353
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 22 Jan 2018 08:19:20 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23025 )
Change subject: Modify test_v2.sh to work with upstream
......................................................................
Patch Set 7: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1075/ : SUCCESS
https://qa.coreboot.org/job/flashrom_gerrit/917/ : SUCCESS
--
To view, visit https://review.coreboot.org/23025
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9ace99fdb8d779804fe1887fe49f6409f8aff02e
Gerrit-Change-Number: 23025
Gerrit-PatchSet: 7
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 22 Jan 2018 08:19:01 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23022 )
Change subject: make args for -r/-w/-v non-positional and optional
......................................................................
Patch Set 13: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1073/ : SUCCESS
https://qa.coreboot.org/job/flashrom_gerrit/915/ : SUCCESS
--
To view, visit https://review.coreboot.org/23022
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iefbcb7dc4fefe26f5afd1292dfd5c1687fa62803
Gerrit-Change-Number: 23022
Gerrit-PatchSet: 13
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Louis Yung-Chieh Lo <yjlou(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Mon, 22 Jan 2018 08:19:01 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
David Hendricks has uploaded this change for review. ( https://review.coreboot.org/23353
Change subject: WIP: Add romentry flags and function to append a single layout entry
......................................................................
WIP: Add romentry flags and function to append a single layout entry
This is an experimental patch to make the partial writes work as
originally intended in patch 23022.
Currently, if no layout is specified then a fallback layout with an
entry covering the entire address space of the chip is used to write
to the chip. If a layout is specified then only the entries in the
layout are used. Consequently, "-i region:fill -w filename" is used
then the -w arg will be ignored.
This hopes to fix the latter case by appending the layout specified
by the user with an entry covering the entire chip when an argument
to '-w' is used.
One upside is that We can potentially get rid of the fallback layout
by using this mechanism to append a "complete chip" entry whenever
'-w' is used.
Signed-off-by: David Hendricks <david.hendricks(a)gmail.com>
Change-Id: I9eb4a7751681c639028d6854d877558daf59e567
---
M cli_classic.c
M layout.c
M layout.h
3 files changed, 46 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/53/23353/1
diff --git a/cli_classic.c b/cli_classic.c
index a1f1cad..09da268 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -554,6 +554,20 @@
if (layoutfile) {
layout = get_global_layout();
+
+ if (filename) {
+ struct romentry entry = {
+ .start = 0,
+ .end = fill_flash->chip->total_size * 1024 - 1,
+ .included = true,
+ .name = "complete flash",
+ .file = filename,
+ .flags = ROMENTRY_FLAG_IGNORE_OVERLAP,
+ };
+ if (append_layout(&entry))
+ goto out_shutdown;
+ }
+
} else if (ifd && (flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0) ||
process_include_args(layout))) {
ret = 1;
diff --git a/layout.c b/layout.c
index 4912a33..0b17a1f 100644
--- a/layout.c
+++ b/layout.c
@@ -48,6 +48,30 @@
return &flashctx->fallback_layout.base;
}
+/* FIXME: read_romlayout() should probably be modified to call this */
+int append_layout(const struct romentry *entry)
+{
+ if (layout.num_entries >= MAX_ROMLAYOUT) {
+ msg_gerr("Cannot add any more layout entries.\n");
+ return 1;
+ }
+
+ layout.entries[layout.num_entries].start = entry->start;
+ layout.entries[layout.num_entries].end = entry->end;
+ layout.entries[layout.num_entries].included = entry->included;
+ strncpy(layout.entries[layout.num_entries].name,
+ entry->name, sizeof(layout.entries[layout.num_entries].name));
+ layout.entries[layout.num_entries].file = entry->file;
+ layout.entries[layout.num_entries].flags = entry->flags;
+ msg_gdbg("appended romlayout %08x - %08x named \"%s\"\n",
+ layout.entries[layout.num_entries].start,
+ layout.entries[layout.num_entries].end,
+ layout.entries[layout.num_entries].name);
+ layout.num_entries++;
+
+ return 0;
+}
+
#ifndef __LIBPAYLOAD__
int read_romlayout(const char *name)
{
@@ -243,6 +267,10 @@
if (l->entries[i].end < l->entries[j].start)
continue;
+ if ((l->entries[i].flags & ROMENTRY_FLAG_IGNORE_OVERLAP) ||
+ (l->entries[j].flags & ROMENTRY_FLAG_IGNORE_OVERLAP))
+ continue;
+
msg_gdbg("Regions %s [0x%08x-0x%08x] and "
"%s [0x%08x-0x%08x] overlap\n",
l->entries[i].name, l->entries[i].start,
diff --git a/layout.h b/layout.h
index 9131b06..881b85a 100644
--- a/layout.h
+++ b/layout.h
@@ -38,12 +38,15 @@
#define MAX_ROMLAYOUT 32
+#define ROMENTRY_FLAG_IGNORE_OVERLAP (1 << 0)
+
struct romentry {
chipoff_t start;
chipoff_t end;
bool included;
char name[256];
char *file;
+ unsigned int flags;
};
struct flashrom_layout {
@@ -62,6 +65,7 @@
struct flashrom_flashctx;
const struct flashrom_layout *get_layout(const struct flashrom_flashctx *const flashctx);
+int append_layout(const struct romentry *const entry);
int process_include_args(struct flashrom_layout *);
int included_regions_overlap(const struct flashrom_layout *const flashrom_layout);
int get_num_include_args_with_files(const struct flashrom_layout *const layout);
--
To view, visit https://review.coreboot.org/23353
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9eb4a7751681c639028d6854d877558daf59e567
Gerrit-Change-Number: 23353
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>