Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/23678
Change subject: [RFC]Don't make layoutfile and --ifd mutually exclusive
......................................................................
[RFC]Don't make layoutfile and --ifd mutually exclusive
Simply append the --ifd entries to the entries found in the layout
file.
When there are multiple entries with the same name the first one
encountered will be used. If an entry occurs in the layoutfile
and is generated the ifd the one in the layoutfile will take
precedence.
Change-Id: I8602196e56e8903a4a22f8070a97f39628e0cc13
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M cli_classic.c
M layout.c
M libflashrom.c
3 files changed, 23 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/78/23678/1
diff --git a/cli_classic.c b/cli_classic.c
index 441fc91..66d31af 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -223,17 +223,9 @@
"more than once. Aborting.\n");
cli_classic_abort_usage();
}
- if (ifd) {
- fprintf(stderr, "Error: --layout and --ifd both specified. Aborting.\n");
- cli_classic_abort_usage();
- }
layoutfile = strdup(optarg);
break;
case 0x0100:
- if (layoutfile) {
- fprintf(stderr, "Error: --layout and --ifd both specified. Aborting.\n");
- cli_classic_abort_usage();
- }
ifd = 1;
break;
case 'i':
@@ -390,10 +382,6 @@
ret = 1;
goto out;
}
- if (!ifd && process_include_args(get_global_layout())) {
- ret = 1;
- goto out;
- }
/* Does a chip with the requested name exist in the flashchips array? */
if (chip_to_probe) {
for (chip = flashchips; chip && chip->name; chip++)
@@ -543,10 +531,13 @@
goto out_shutdown;
}
- if (layoutfile) {
- layout = get_global_layout();
- } else if (ifd && (flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0) ||
- process_include_args(layout))) {
+ layout = get_global_layout();
+ if (ifd && (flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0))) {
+ ret = 1;
+ goto out_shutdown;
+ }
+
+ if (process_include_args(layout)) {
ret = 1;
goto out_shutdown;
}
diff --git a/layout.c b/layout.c
index 7ce7c57..61e41b5 100644
--- a/layout.c
+++ b/layout.c
@@ -53,7 +53,6 @@
{
FILE *romlayout;
char tempstr[256];
- int i;
romlayout = fopen(name, "r");
@@ -93,18 +92,23 @@
layout.num_entries++;
}
- for (i = 0; i < layout.num_entries; i++) {
- msg_gdbg("romlayout %08x - %08x named %s\n",
- layout.entries[i].start,
- layout.entries[i].end, layout.entries[i].name);
- }
-
(void)fclose(romlayout);
return 0;
}
#endif
+static void print_layout(void)
+{
+ int i;
+
+ for (i = 0; i < layout.num_entries; i++) {
+ msg_gdbg("romlayout %08x - %08x named %s\n",
+ layout.entries[i].start,
+ layout.entries[i].end, layout.entries[i].name);
+ }
+}
+
/* returns the index of the entry (or a negative value if it is not found) */
static int find_include_arg(const char *const name)
{
@@ -167,6 +171,8 @@
int i;
unsigned int found = 0;
+ print_layout();
+
if (num_include_args == 0)
return 0;
diff --git a/libflashrom.c b/libflashrom.c
index 6e0f42c..32ad891 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -334,7 +334,7 @@
return 6;
#else
struct ich_layout dump_layout;
- int ret = 1;
+ int ret = 1, i;
void *const desc = malloc(0x1000);
struct ich_layout *const chip_layout = malloc(sizeof(*chip_layout));
@@ -373,7 +373,8 @@
}
}
- *layout = (struct flashrom_layout *)chip_layout;
+ for (i = 0; i < chip_layout->base.num_entries; i++)
+ (*layout)->entries[(*layout)->num_entries++] = chip_layout->entries[i];
ret = 0;
_finalize_ret:
--
To view, visit https://review.coreboot.org/23678
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: I8602196e56e8903a4a22f8070a97f39628e0cc13
Gerrit-Change-Number: 23678
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23259 )
Change subject: Add support for the ENE Embedded Debug Interface EDI and KB9012 EC
......................................................................
Patch Set 10: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1120/ : SUCCESS
https://qa.coreboot.org/job/flashrom_gerrit/944/ : SUCCESS
--
To view, visit https://review.coreboot.org/23259
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: Ib8b2eb2feeef5c337d725d15ebf994a299897854
Gerrit-Change-Number: 23259
Gerrit-PatchSet: 10
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Kocialkowski <contact(a)paulk.fr>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 09 Feb 2018 22:57:42 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Hello Paul Kocialkowski, Paul Menzel, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/23259
to look at the new patch set (#10).
Change subject: Add support for the ENE Embedded Debug Interface EDI and KB9012 EC
......................................................................
Add support for the ENE Embedded Debug Interface EDI and KB9012 EC
The ENE Embedded Debug Interface (EDI) is a SPI-based interface for
accessing the memory of ENE embedded controllers.
The ENE KB9012 EC is an embedded controller found on various laptops
such as the Lenovo G505s. It features a 8051 microcontroller and
has 128 KiB of internal storage for program data.
EDI can be accessed on the KB9012 through pins 59-62 (CS-CLK-MOSI-MISO)
when flash direct access is not in use. Some firmwares disable EDI at runtime
so it might be necessary to ground pin 42 to reset the 8051 microcontroller
before accessing the KB9012 via EDI.
The example of flashing KB9012 at Lenovo G505S laptop could be found here:
http://dangerousprototypes.com/docs/Flashing_KB9012_with_Bus_Pirate
Change-Id: Ib8b2eb2feeef5c337d725d15ebf994a299897854
Signed-off-by: Mike Banon <mikebdp2(a)gmail.com>
Signed-off-by: Paul Kocialkowski <contact(a)paulk.fr>
---
M Makefile
M chipdrivers.h
A edi.c
A edi.h
A ene.h
M flash.h
M flashchips.c
7 files changed, 611 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/59/23259/10
--
To view, visit https://review.coreboot.org/23259
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: Ib8b2eb2feeef5c337d725d15ebf994a299897854
Gerrit-Change-Number: 23259
Gerrit-PatchSet: 10
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Kocialkowski <contact(a)paulk.fr>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23259 )
Change subject: Add support for the ENE Embedded Debug Interface EDI and KB9012 EC
......................................................................
Patch Set 9: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1119/ : SUCCESS
https://qa.coreboot.org/job/flashrom_gerrit/943/ : SUCCESS
--
To view, visit https://review.coreboot.org/23259
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: Ib8b2eb2feeef5c337d725d15ebf994a299897854
Gerrit-Change-Number: 23259
Gerrit-PatchSet: 9
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Kocialkowski <contact(a)paulk.fr>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 09 Feb 2018 22:45:01 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/23258 )
Change subject: Add support for selecting the erased bit value with a flag
......................................................................
Patch Set 6: Verified+1
Build Successful
https://qa.coreboot.org/job/flashrom-customrules/1118/ : SUCCESS
https://qa.coreboot.org/job/flashrom_gerrit/942/ : SUCCESS
--
To view, visit https://review.coreboot.org/23258
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: Ia7b0de8568e31f9bf263ba0ad6b051e837477b6b
Gerrit-Change-Number: 23258
Gerrit-PatchSet: 6
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Kocialkowski <contact(a)paulk.fr>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 09 Feb 2018 22:44:52 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: Yes
Mike Banon has posted comments on this change. ( https://review.coreboot.org/23260 )
Change subject: edi: Add dummy read to ensure proper detection of ENE chips
......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/#/c/23260/3/edi.c
File edi.c:
https://review.coreboot.org/#/c/23260/3/edi.c@166
PS3, Line 166: static int edi_spi_enable(struct flashctx *flash)
> Agreed.
OK I'm transforming it into one liner, also merging the comments
--
To view, visit https://review.coreboot.org/23260
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: I69ee71674649cd8ba4fc635f889cb39a1cd204b9
Gerrit-Change-Number: 23260
Gerrit-PatchSet: 7
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Kocialkowski <contact(a)paulk.fr>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 09 Feb 2018 22:22:48 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
Hello Paul Kocialkowski, Paul Menzel, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/23260
to look at the new patch set (#7).
Change subject: edi: Add dummy read to ensure proper detection of ENE chips
......................................................................
edi: Add dummy read to ensure proper detection of ENE chips
ENE chips enable EDI by detecting a clock frequency between 1 MHz and 8 MHz.
In many cases, the chip won't be able to both detect the clock signal and
serve the associated request at the same time.
Thus, a dummy read has to be added to ensure that EDI is enabled and
operational starting from the next request.
Change-Id: I69ee71674649cd8ba4fc635f889cb39a1cd204b9
Signed-off-by: Mike Banon <mikebdp2(a)gmail.com>
Signed-off-by: Paul Kocialkowski <contact(a)paulk.fr>
---
M edi.c
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/60/23260/7
--
To view, visit https://review.coreboot.org/23260
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: I69ee71674649cd8ba4fc635f889cb39a1cd204b9
Gerrit-Change-Number: 23260
Gerrit-PatchSet: 7
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Kocialkowski <contact(a)paulk.fr>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Nico Huber 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:
> This has the potential to obsolete the file arguments to do_read/write/
> verify, and save us some code, great! ;)
Hmmm, or rather not. Because you need the file argument for `-i` w/o files.
--
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 09 Feb 2018 14:02:04 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
Nico Huber 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:
(2 comments)
This has the potential to obsolete the file arguments to do_read/write/
verify, and save us some code, great! ;)
https://review.coreboot.org/#/c/23353/1/layout.c
File layout.c:
https://review.coreboot.org/#/c/23353/1/layout.c@63
PS1, Line 63: entry->name, sizeof(layout.entries[layout.num_entries].name));
Missing '\0' termination in case entry->name is too long.
Anyway, can't you just copy the whole struct?
layout.entries[layout.num_entries] = *entry;
https://review.coreboot.org/#/c/23353/1/layout.c@271
PS1, Line 271: (l->entries[j].flags & ROMENTRY_FLAG_IGNORE_OVERLAP))
How about a grouping of the entries instead, e.g.
if (l->entries[i].group != l->entries[j].group)
continue;
In any case, I'd move the check above the range checks.
--
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 09 Feb 2018 13:37:27 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No