Attention is currently required from: Edward O'Callaghan.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/74164 )
Change subject: board_enable.c: Invert branch for readability
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/74164
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9bd96d4d077270697c329d7e6cac1d32ed513ed3
Gerrit-Change-Number: 74164
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Sun, 02 Apr 2023 16:10:19 +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/+/74165 )
Change subject: tree/: Case write_granularity enum values
......................................................................
tree/: Case write_granularity enum values
Change-Id: Ic8c655225abe477c1b618dc685b743e691c16ebd
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M at45db.c
M flashchips.c
M flashrom.c
M include/flash.h
M nicintel_eeprom.c
5 files changed, 51 insertions(+), 41 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/65/74165/1
diff --git a/at45db.c b/at45db.c
index 7877330..6d66a6e 100644
--- a/at45db.c
+++ b/at45db.c
@@ -200,12 +200,12 @@
}
switch (chip->page_size) {
- case 256: chip->gran = write_gran_256bytes; break;
- case 264: chip->gran = write_gran_264bytes; break;
- case 512: chip->gran = write_gran_512bytes; break;
- case 528: chip->gran = write_gran_528bytes; break;
- case 1024: chip->gran = write_gran_1024bytes; break;
- case 1056: chip->gran = write_gran_1056bytes; break;
+ case 256: chip->gran = WRITE_GRAN_256BYTES; break;
+ case 264: chip->gran = WRITE_GRAN_264BYTES; break;
+ case 512: chip->gran = WRITE_GRAN_512BYTES; break;
+ case 528: chip->gran = WRITE_GRAN_528BYTES; break;
+ case 1024: chip->gran = WRITE_GRAN_1024BYTES; break;
+ case 1056: chip->gran = WRITE_GRAN_1056BYTES; break;
default:
msg_cerr("%s: unknown page size %d.\n", __func__, chip->page_size);
return 0;
diff --git a/flashchips.c b/flashchips.c
index dc6e882..6a5cf49 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -2762,7 +2762,7 @@
.write = SPI_WRITE_AT45DB,
.read = SPI_READ_AT45DB,
.voltage = {2700, 3600},
- .gran = write_gran_1056bytes,
+ .gran = WRITE_GRAN_1056BYTES,
},
{
@@ -3015,7 +3015,7 @@
.write = SPI_WRITE_AT45DB,
.read = SPI_READ_AT45DB_E8, /* 3 address and 4 dummy bytes */
.voltage = {2700, 3600},
- .gran = write_gran_528bytes,
+ .gran = WRITE_GRAN_528BYTES,
},
{
@@ -3638,7 +3638,7 @@
.write = EDI_CHIP_WRITE,
.read = EDI_CHIP_READ,
.voltage = {2700, 3600},
- .gran = write_gran_128bytes,
+ .gran = WRITE_GRAN_128BYTES,
},
{
diff --git a/flashrom.c b/flashrom.c
index b135e58..cee96d6 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -723,42 +723,42 @@
unsigned int i;
switch (gran) {
- case write_gran_1bit:
+ case WRITE_GRAN_1BIT:
for (i = 0; i < len; i++)
if ((have[i] & want[i]) != want[i]) {
result = 1;
break;
}
break;
- case write_gran_1byte:
+ case WRITE_GRAN_1BYTE:
for (i = 0; i < len; i++)
if ((have[i] != want[i]) && (have[i] != erased_value)) {
result = 1;
break;
}
break;
- case write_gran_128bytes:
+ case WRITE_GRAN_128BYTES:
result = need_erase_gran_bytes(have, want, len, 128, erased_value);
break;
- case write_gran_256bytes:
+ case WRITE_GRAN_256BYTES:
result = need_erase_gran_bytes(have, want, len, 256, erased_value);
break;
- case write_gran_264bytes:
+ case WRITE_GRAN_264BYTES:
result = need_erase_gran_bytes(have, want, len, 264, erased_value);
break;
- case write_gran_512bytes:
+ case WRITE_GRAN_512BYTES:
result = need_erase_gran_bytes(have, want, len, 512, erased_value);
break;
- case write_gran_528bytes:
+ case WRITE_GRAN_528BYTES:
result = need_erase_gran_bytes(have, want, len, 528, erased_value);
break;
- case write_gran_1024bytes:
+ case WRITE_GRAN_1024BYTES:
result = need_erase_gran_bytes(have, want, len, 1024, erased_value);
break;
- case write_gran_1056bytes:
+ case WRITE_GRAN_1056BYTES:
result = need_erase_gran_bytes(have, want, len, 1056, erased_value);
break;
- case write_gran_1byte_implicit_erase:
+ case WRITE_GRAN_1BYTE_IMPLICIT_ERASE:
/* Do not erase, handle content changes from anything->0xff by writing 0xff. */
result = 0;
break;
@@ -801,30 +801,30 @@
unsigned int i, limit, stride;
switch (gran) {
- case write_gran_1bit:
- case write_gran_1byte:
- case write_gran_1byte_implicit_erase:
+ case WRITE_GRAN_1BIT:
+ case WRITE_GRAN_1BYTE:
+ case WRITE_GRAN_1BYTE_IMPLICIT_ERASE:
stride = 1;
break;
- case write_gran_128bytes:
+ case WRITE_GRAN_128BYTES:
stride = 128;
break;
- case write_gran_256bytes:
+ case WRITE_GRAN_256BYTES:
stride = 256;
break;
- case write_gran_264bytes:
+ case WRITE_GRAN_264BYTES:
stride = 264;
break;
- case write_gran_512bytes:
+ case WRITE_GRAN_512BYTES:
stride = 512;
break;
- case write_gran_528bytes:
+ case WRITE_GRAN_528BYTES:
stride = 528;
break;
- case write_gran_1024bytes:
+ case WRITE_GRAN_1024BYTES:
stride = 1024;
break;
- case write_gran_1056bytes:
+ case WRITE_GRAN_1056BYTES:
stride = 1056;
break;
default:
diff --git a/include/flash.h b/include/flash.h
index f0357cb..3e9c885 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -83,17 +83,17 @@
*/
enum write_granularity {
/* We assume 256 byte granularity by default. */
- write_gran_256bytes = 0,/* If less than 256 bytes are written, the unwritten bytes are undefined. */
- write_gran_1bit, /* Each bit can be cleared individually. */
- write_gran_1byte, /* A byte can be written once. Further writes to an already written byte cause
+ WRITE_GRAN_256BYTES = 0,/* If less than 256 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_1BIT, /* Each bit can be cleared individually. */
+ WRITE_GRAN_1BYTE, /* A byte can be written once. Further writes to an already written byte cause
* its contents to be either undefined or to stay unchanged. */
- write_gran_128bytes, /* If less than 128 bytes are written, the unwritten bytes are undefined. */
- write_gran_264bytes, /* If less than 264 bytes are written, the unwritten bytes are undefined. */
- write_gran_512bytes, /* If less than 512 bytes are written, the unwritten bytes are undefined. */
- write_gran_528bytes, /* If less than 528 bytes are written, the unwritten bytes are undefined. */
- write_gran_1024bytes, /* If less than 1024 bytes are written, the unwritten bytes are undefined. */
- write_gran_1056bytes, /* If less than 1056 bytes are written, the unwritten bytes are undefined. */
- write_gran_1byte_implicit_erase, /* EEPROMs and other chips with implicit erase and 1-byte writes. */
+ WRITE_GRAN_128BYTES, /* If less than 128 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_264BYTES, /* If less than 264 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_512BYTES, /* If less than 512 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_528BYTES, /* If less than 528 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_1024BYTES, /* If less than 1024 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_1056BYTES, /* If less than 1056 bytes are written, the unwritten bytes are undefined. */
+ WRITE_GRAN_1BYTE_IMPLICIT_ERASE, /* EEPROMs and other chips with implicit erase and 1-byte writes. */
};
/*
diff --git a/nicintel_eeprom.c b/nicintel_eeprom.c
index 80ccd88..2c351da 100644
--- a/nicintel_eeprom.c
+++ b/nicintel_eeprom.c
@@ -116,7 +116,7 @@
flash->chip->total_size = 4;
flash->chip->page_size = flash->chip->total_size * 1024;
flash->chip->tested = TEST_OK_PREWB;
- flash->chip->gran = write_gran_1byte_implicit_erase;
+ flash->chip->gran = WRITE_GRAN_1BYTE_IMPLICIT_ERASE;
flash->chip->block_erasers->eraseblocks[0].size = flash->chip->page_size;
flash->chip->block_erasers->eraseblocks[0].count = 1;
@@ -147,7 +147,7 @@
flash->chip->page_size = EE_PAGE_MASK + 1;
flash->chip->tested = TEST_OK_PREWB;
- flash->chip->gran = write_gran_1byte_implicit_erase;
+ flash->chip->gran = WRITE_GRAN_1BYTE_IMPLICIT_ERASE;
flash->chip->block_erasers->eraseblocks[0].size = (EE_PAGE_MASK + 1);
flash->chip->block_erasers->eraseblocks[0].count = (flash->chip->total_size * 1024) / (EE_PAGE_MASK + 1);
--
To view, visit https://review.coreboot.org/c/flashrom/+/74165
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic8c655225abe477c1b618dc685b743e691c16ebd
Gerrit-Change-Number: 74165
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Thomas Heijligen, Angel Pons.
Hello build bot (Jenkins), Thomas Heijligen, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/74071
to look at the new patch set (#4).
Change subject: data/flashchips.json: Add JSON flashchips db variant
......................................................................
data/flashchips.json: Add JSON flashchips db variant
Generated from flashchips.c at commit 73e47091.
Change-Id: I7fceac8a285c8ecf3f3a09a90cc1ae369e8a9429
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
A data/flashchips.json
1 file changed, 176,109 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/71/74071/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/74071
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7fceac8a285c8ecf3f3a09a90cc1ae369e8a9429
Gerrit-Change-Number: 74071
Gerrit-PatchSet: 4
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/74083
to look at the new patch set (#2).
Change subject: util/flashchips_db_jsoniser: Fix bugs
......................................................................
util/flashchips_db_jsoniser: Fix bugs
Also add write granularity support. One bug spotted by Stefan.
Spotted-by: Stefan Reinauer <reinauer(a)google.com>
Change-Id: Ie514f512b5299290a253a56e950c30127e55ca84
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M util/flashchips_db_jsoniser/main.c
1 file changed, 45 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/83/74083/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/74083
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie514f512b5299290a253a56e950c30127e55ca84
Gerrit-Change-Number: 74083
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Sam McNally, Thomas Heijligen, Angel Pons.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73456 )
Change subject: internal: Move laptop_ok into board_cfg
......................................................................
Patch Set 5:
(1 comment)
File internal.c:
https://review.coreboot.org/c/flashrom/+/73456/comment/f71b4a57_e8d297e0
PS3, Line 108: struct
> const
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/73456
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I459215253845c2af73262943ce91a36464e9eb06
Gerrit-Change-Number: 73456
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Sun, 02 Apr 2023 08:44:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sam McNally <sammc(a)google.com>
Gerrit-MessageType: comment
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/74164 )
Change subject: board_enable.c: Invert branch for readability
......................................................................
board_enable.c: Invert branch for readability
Just use a early return for a base condition of the function
to aid in removing one layer of logic embedding within a branch.
Change-Id: I9bd96d4d077270697c329d7e6cac1d32ed513ed3
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M board_enable.c
1 file changed, 23 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/74164/1
diff --git a/board_enable.c b/board_enable.c
index 795d0f3..121b211 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -2661,7 +2661,6 @@
bool force_boardenable)
{
const struct board_match *board = NULL;
- int ret = 0;
if (vendor && model) {
board = board_match_name(vendor, model, false);
@@ -2691,16 +2690,17 @@
if (board->max_rom_decode_parallel)
max_rom_decode.parallel = board->max_rom_decode_parallel * 1024;
- if (board->enable) {
- msg_pinfo("Enabling full flash access for board \"%s %s\"... ",
- board->vendor_name, board->board_name);
+ if (!board->enable)
+ return 0;
- ret = board->enable(cfg);
- if (ret)
- msg_pinfo("FAILED!\n");
- else
- msg_pinfo("OK.\n");
- }
+ msg_pinfo("Enabling full flash access for board \"%s %s\"... ",
+ board->vendor_name, board->board_name);
+
+ int ret = board->enable(cfg);
+ if (ret)
+ msg_pinfo("FAILED!\n");
+ else
+ msg_pinfo("OK.\n");
return ret;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/74164
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9bd96d4d077270697c329d7e6cac1d32ed513ed3
Gerrit-Change-Number: 74164
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Angel Pons.
Hello Sam McNally, build bot (Jenkins), Thomas Heijligen, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/73456
to look at the new patch set (#5).
Change subject: internal: Move laptop_ok into board_cfg
......................................................................
internal: Move laptop_ok into board_cfg
Due to how internal is structured around chipset_flash_enable()
entry we need to prepare a crafted programmer_cfg that contains
a board_enable substructure with data derived from the board_enable
subsystem. While this is certainly not perfection, it does make
clear the relationships between board_enable into chipset_flash_enable
and subsequently the overall internal programmer initialisation
in a RAII fashion at the type level over closure upon global
state that is impossible to reason about.
Also flip predicate in report_nonwl_laptop_detected() and
return early with the trivial base-case.
TEST=`$ sudo ./flashrom -p internal --flash-name`.
Change-Id: I459215253845c2af73262943ce91a36464e9eb06
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M board_enable.c
M chipset_enable.c
M flashrom.c
M include/programmer.h
M internal.c
5 files changed, 69 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/56/73456/5
--
To view, visit https://review.coreboot.org/c/flashrom/+/73456
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I459215253845c2af73262943ce91a36464e9eb06
Gerrit-Change-Number: 73456
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset