Richard Spiegel has posted comments on this change. ( https://review.coreboot.org/28707 )
Change subject: Remove unneeded whitespace
......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/28707/1/board_enable.c
File board_enable.c:
https://review.coreboot.org/#/c/28707/1/board_enable.c@159
PS1, Line 159: the GPIO port */
> e.g. […]
There's actually only 4 spaces after a tab... it's just how it looks that makes you think there are enough spaces after the tab...
--
To view, visit https://review.coreboot.org/28707
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: I0e72e3e3736a39685b7f166c5e6b06cc241b26be
Gerrit-Change-Number: 28707
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas(a)noos.fr>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 21 Sep 2018 16:02:50 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
Nico Huber has posted comments on this change. ( https://review.coreboot.org/28707 )
Change subject: Remove unneeded whitespace
......................................................................
Patch Set 1:
(1 comment)
Many of the touched lines are after unnecessary line breaks. Flashrom
has a 112 char line limit. If we touch lines for whitespace we should
fix that too.
https://review.coreboot.org/#/c/28707/1/board_enable.c
File board_enable.c:
https://review.coreboot.org/#/c/28707/1/board_enable.c@159
PS1, Line 159: the GPIO port */
e.g. here
--
To view, visit https://review.coreboot.org/28707
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: I0e72e3e3736a39685b7f166c5e6b06cc241b26be
Gerrit-Change-Number: 28707
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas(a)noos.fr>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 21 Sep 2018 15:09:22 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
David Hendricks has posted comments on this change. ( https://review.coreboot.org/28685 )
Change subject: Add CLI option to include a numeric range
......................................................................
Patch Set 1: Code-Review-1
Implementing a feature request from a user at OSFC.
Adding -1 since at the very least it needs a man page entry, but hopefully the rest looks decent. Suggestions for a better option name and/or single-character option are welcome.
--
To view, visit https://review.coreboot.org/28685
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: Ie2691051984bdeac128354c09bbe72aa05ef7401
Gerrit-Change-Number: 28685
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Wed, 19 Sep 2018 15:38:23 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
David Hendricks has posted comments on this change. ( https://review.coreboot.org/23203 )
Change subject: Add support to get layout from fmap (e.g. coreboot rom)
......................................................................
Patch Set 24:
(17 comments)
I had some time to hack on this some more and test using a Chromebook using --fmap-file (linear search), --fmap with the fmap offset at a weird location (try bsearch and fall back to linear search), and --fmap with the fmap at a bsearchable offset.
I'm not sure what to do about the man page... The line break seems weird.
https://review.coreboot.org/#/c/23203/22/cli_classic.c
File cli_classic.c:
https://review.coreboot.org/#/c/23203/22/cli_classic.c@619
PS22, Line 619: out
> out_shutdown
Done
https://review.coreboot.org/#/c/23203/22/cli_classic.c@642
PS22, Line 642: && (flashrom_
> I stared at this for a moment, now I'm sure the `!fmapfile` is […]
OK. I think it helps with readability since it flows nicely with the above `fmap && fmapfile`, but I don't have a strong preference.
https://review.coreboot.org/#/c/23203/22/flashrom.8.tmpl
File flashrom.8.tmpl:
https://review.coreboot.org/#/c/23203/22/flashrom.8.tmpl@52
PS22, Line 52: \-\-fmap\fR|\fB\-\-fmap-file\fR <file>) \
> This line is unnecessarily long now. Please break before the […]
Yeah, it's not the longest line but it is quite long. I don't understand why you want to break before the `-n` though. The spacing doesn't make much sense to me, is there a standard or some general guidelines? I just took a guess.
https://review.coreboot.org/#/c/23203/22/flashrom.8.tmpl@202
PS22, Line 202: hrom suppo
> par*ti*tioning
Done
https://review.coreboot.org/#/c/23203/22/flashrom.8.tmpl@217
PS22, Line 217: hrom suppo
> partitioning
Done
https://review.coreboot.org/#/c/23203/22/flashrom.8.tmpl@219
PS22, Line 219: used to generate the layout.
> leftover
oops, done.
https://review.coreboot.org/#/c/23203/22/fmap.h
File fmap.h:
https://review.coreboot.org/#/c/23203/22/fmap.h@3
PS22, Line 3: -present
> I know it has been discussed already. But this is incredibly […]
Nah, I kinda like it actually. It just says explicitly what we already assume, and prevents issues with people updating copyright notices needlessly to match the present year whenever they touch a file.
In any case our non-lawyer opinions are irrelevant, so no point in arguing.
https://review.coreboot.org/#/c/23203/22/fmap.h@45
PS22, Line 45: #define FMAP_VER_MINOR 1 /* this header's FMAP minor version */
> Didn't check earlier versions, but now this is unused? shouldn't […]
Sure.
FWIW, the only difference IIRC between 1.0 and 1.1 was that 1.1 required alignment to a 64-byte boundary so that bsearch wouldn't be too expensive on the hardware we had available at the time. We fallback to doing brute-force linear search on all bytes anyway so it doesn't matter too much, it was intended more as a guideline for implementation.
https://review.coreboot.org/#/c/23203/22/fmap.h@67
PS22, Line 67: int fmap_read_from_buffer(struct fmap **fmap_out, const uint8_t *buf, size_t len);
> nit, could be static now
Done
https://review.coreboot.org/#/c/23203/22/fmap.c
File fmap.c:
https://review.coreboot.org/#/c/23203/22/fmap.c@1
PS22, Line 1:
> nit, missing initial line break
Done
https://review.coreboot.org/#/c/23203/22/fmap.c@153
PS22, Line 153: int ret = -1;
: uint8_t *b
> Redundant, probably leftover?
Done
https://review.coreboot.org/#/c/23203/22/fmap.c@203
PS22, Line 203: }
> leaking `fmap`
moved above malloc
https://review.coreboot.org/#/c/23203/22/fmap.c@260
PS22, Line 260: if (fmap_found)
: break;
: }
:
: if (!fmap_found)
: goto _free_ret;
:
: fmap_len = fmap_size(fmap);
: struct fmap *tmp = fmap;
: fmap = realloc(fmap, fmap_len);
: if (!fmap) {
: msg_gerr("Failed to realloc.\n");
: free(tmp);
: goto _free_ret;
: }
:
: if (flashctx->chip->read(flashctx, (uint8_t *)fmap + sizeof(*fmap),
: offset + sizeof(*fmap), fmap_len - sizeof(*fmap))) {
: msg_cerr("Cannot read %zu bytes at offset %06zx\n",
: fmap_len - sizeof(*fmap), offset + sizeof(*fmap));
: /* Treat read failure to be fatal since this
: * should be a valid, usable fmap. */
: goto _free_ret;
: }
:
> This path is flawed a little. At least it's missing an unconditional […]
The break seems to have been lost during refactoring :-/ Sigh.
I like the idea of doing more stuff outside of the inner loop. I don't think we should ever hit the realloc() a second time, and it should be fine to treat those error paths as fatal.
I suppose one could make an argument that if we see a valid fmap header but can't read the whole thing then we should continue trying to find another fmap. But I think in practice that is indicative of a hardware failure or error in the way the firmware ROM is laid out and it's useful to treat it as fatal. Maybe we should return a different code to the caller to indicate this and avoid doing the linear search.
https://review.coreboot.org/#/c/23203/22/fmap.c@292
PS22, Line 292: ret = 0;
> This would still be set after a read failure, for instance. So it's […]
agreed
https://review.coreboot.org/#/c/23203/22/fmap.c@321
PS22, Line 321: an fma
> How do you pronounce it? Is it `*a* fmap` or `*an* eff-map`?
I say "an" in my head. Usually 'a' is used before a noun beginning with a consonant, but that sounds awkward to me in this case so I've updated the comment.
https://review.coreboot.org/#/c/23203/22/libflashrom.c
File libflashrom.c:
https://review.coreboot.org/#/c/23203/22/libflashrom.c@433
PS22, Line 433: struct flashctx *const flashctx, off_t offset, size_t len)
> Ugly, but as we were too lazy for proper deserialization again, […]
done
https://review.coreboot.org/#/c/23203/22/libflashrom.c@468
PS22, Line 468: * 3 if fmap parsing isn't implemented for the host,
> Same guard here.
Done
--
To view, visit https://review.coreboot.org/23203
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: I0e7fad38ed79a84d41358e1f175c36d255786c12
Gerrit-Change-Number: 23203
Gerrit-PatchSet: 24
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
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-CC: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Comment-Date: Mon, 17 Sep 2018 14:39:42 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
David Hendricks has uploaded a new patch set (#24) to the change originally created by Arthur Heymans. ( https://review.coreboot.org/23203 )
Change subject: Add support to get layout from fmap (e.g. coreboot rom)
......................................................................
Add support to get layout from fmap (e.g. coreboot rom)
Flashmap, or simply fmap, is a binary data format for describing
region offsets, sizes, and certain attributes and is widely used by
coreboot. This patch adds support for the fmap data format version 1.1
and adds --fmap and --fmap-file arguments.
Using --fmap will make flashrom to search the ROM content for fmap
data. Using --fmap-file will make flashrom search a supplied file
for fmap data.
An example of how to update the COREBOOT region of a ROM:
flashrom -p programmer --fmap -w coreboot.rom -i COREBOOT
flashrom -p programmer --fmap-file coreboot.rom -w coreboot.rom -i COREBOOT
The fmap functions are mostly copied from cbfstool.
Currently it is made mutually exclusive with other layout options until
we are more clever about this input.
Change-Id: I0e7fad38ed79a84d41358e1f175c36d255786c12
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
Signed-off-by: David Hendricks <dhendricks(a)fb.com>
---
M Makefile
M cli_classic.c
M flashrom.8.tmpl
A fmap.c
A fmap.h
M libflashrom.c
M libflashrom.h
7 files changed, 651 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/03/23203/24
--
To view, visit https://review.coreboot.org/23203
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0e7fad38ed79a84d41358e1f175c36d255786c12
Gerrit-Change-Number: 23203
Gerrit-PatchSet: 24
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
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-CC: Werner Zeh <werner.zeh(a)siemens.com>
David Hendricks has uploaded a new patch set (#23) to the change originally created by Arthur Heymans. ( https://review.coreboot.org/23203 )
Change subject: Add support to get layout from fmap (e.g. coreboot rom)
......................................................................
Add support to get layout from fmap (e.g. coreboot rom)
Flashmap, or simply fmap, is a binary data format for describing
region offsets, sizes, and certain attributes and is widely used by
coreboot. This patch adds support for the fmap data format version 1.1
and adds --fmap and --fmap-file arguments.
Using --fmap will make flashrom to search the ROM content for fmap
data. Using --fmap-file will make flashrom search a supplied file
for fmap data.
An example of how to update the COREBOOT region of a ROM:
flashrom -p programmer --fmap -w coreboot.rom -i COREBOOT
flashrom -p programmer --fmap-file coreboot.rom -w coreboot.rom -i COREBOOT
The fmap functions are mostly copied from cbfstool.
Currently it is made mutually exclusive with other layout options until
we are more clever about this input.
Change-Id: I0e7fad38ed79a84d41358e1f175c36d255786c12
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
Signed-off-by: David Hendricks <dhendricks(a)fb.com>
---
M Makefile
M cli_classic.c
M flashrom.8.tmpl
A fmap.c
A fmap.h
M libflashrom.c
M libflashrom.h
7 files changed, 652 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/03/23203/23
--
To view, visit https://review.coreboot.org/23203
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0e7fad38ed79a84d41358e1f175c36d255786c12
Gerrit-Change-Number: 23203
Gerrit-PatchSet: 23
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
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-CC: Werner Zeh <werner.zeh(a)siemens.com>