Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73285 )
Change subject: jedec.c: Provide better lexical scope to itermediates
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73285
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8e01d471bb33a933b80760df2c69a4bf3589ba76
Gerrit-Change-Number: 73285
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:25:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/73284 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: jedec.c: Tidy up whitespace and line wraps
......................................................................
jedec.c: Tidy up whitespace and line wraps
Change-Id: I3f18609709e59cdfc5a853c6e1ae5f53aecacc1a
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73284
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M jedec.c
1 file changed, 20 insertions(+), 7 deletions(-)
Approvals:
build bot (Jenkins): Verified
Stefan Reinauer: Looks good to me, approved
Thomas Heijligen: Looks good to me, approved
diff --git a/jedec.c b/jedec.c
index bb617e0..01c401f 100644
--- a/jedec.c
+++ b/jedec.c
@@ -305,11 +305,11 @@
int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int size)
{
- /* Issue the Sector Erase command */
+ /* Issue the Sector Erase command */
issuecmd(flash, 0x80, 0);
issuecmd(flash, 0x30, page);
- /* wait for Toggle bit ready */
+ /* Wait for Toggle bit ready */
toggle_ready_jedec_slow(flash);
/* FIXME: Check the status register for errors. */
@@ -318,11 +318,11 @@
int erase_block_jedec(struct flashctx *flash, unsigned int block, unsigned int size)
{
- /* Issue the Sector Erase command */
+ /* Issue the Block Erase command */
issuecmd(flash, 0x80, 0);
issuecmd(flash, 0x50, block);
- /* wait for Toggle bit ready */
+ /* Wait for Toggle bit ready */
toggle_ready_jedec_slow(flash);
/* FIXME: Check the status register for errors. */
@@ -333,12 +333,11 @@
int erase_chip_block_jedec(struct flashctx *flash, unsigned int addr, unsigned int blocksize)
{
if ((addr != 0) || (blocksize != flash->chip->total_size * 1024)) {
- msg_cerr("%s called with incorrect arguments\n",
- __func__);
+ msg_cerr("%s called with incorrect arguments\n", __func__);
return -1;
}
- /* Issue the JEDEC Chip Erase command */
+ /* Issue the JEDEC Chip Erase command */
issuecmd(flash, 0x80, 0);
issuecmd(flash, 0x10, 0);
--
To view, visit https://review.coreboot.org/c/flashrom/+/73284
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3f18609709e59cdfc5a853c6e1ae5f53aecacc1a
Gerrit-Change-Number: 73284
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73284 )
Change subject: jedec.c: Tidy up whitespace and line wraps
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73284
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3f18609709e59cdfc5a853c6e1ae5f53aecacc1a
Gerrit-Change-Number: 73284
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:24:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/73283 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: jedec.c: Add a little more const correctness
......................................................................
jedec.c: Add a little more const correctness
Change-Id: Ic9a76ce3734bd83399c95478a7c0bfc081211124
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73283
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M jedec.c
1 file changed, 18 insertions(+), 5 deletions(-)
Approvals:
build bot (Jenkins): Verified
Stefan Reinauer: Looks good to me, approved
Thomas Heijligen: Looks good to me, approved
diff --git a/jedec.c b/jedec.c
index 2cdde61..bb617e0 100644
--- a/jedec.c
+++ b/jedec.c
@@ -123,7 +123,7 @@
int probe_jedec_29gl(struct flashctx *flash)
{
const unsigned int mask = getaddrmask(flash->chip);
- chipaddr bios = flash->virtual_memory;
+ const chipaddr bios = flash->virtual_memory;
const struct flashchip *chip = flash->chip;
/* Reset chip to a clean slate */
@@ -381,9 +381,8 @@
unsigned int i;
int failed = 0;
chipaddr dst = flash->virtual_memory + start;
- chipaddr olddst;
+ const chipaddr olddst = dst;
- olddst = dst;
for (i = 0; i < len; i++) {
if (write_byte_program_jedec_common(flash, src, dst))
failed = 1;
@@ -452,8 +451,8 @@
* write_jedec have page_size set to max_writechunk_size, so
* we're OK for now.
*/
- unsigned int page_size = flash->chip->page_size;
- unsigned int nwrites = (start + len - 1) / page_size;
+ const unsigned int page_size = flash->chip->page_size;
+ const unsigned int nwrites = (start + len - 1) / page_size;
/* Warning: This loop has a very unusual condition and body.
* The loop needs to go through each page with at least one affected
--
To view, visit https://review.coreboot.org/c/flashrom/+/73283
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic9a76ce3734bd83399c95478a7c0bfc081211124
Gerrit-Change-Number: 73283
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73283 )
Change subject: jedec.c: Add a little more const correctness
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73283
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic9a76ce3734bd83399c95478a7c0bfc081211124
Gerrit-Change-Number: 73283
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:23:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/73282 )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: jedec.c: Rename func to jedec_write_page()
......................................................................
jedec.c: Rename func to jedec_write_page()
Change-Id: I1be83d5974e305bddceaa34b64e982b774ade0d2
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73282
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M jedec.c
1 file changed, 16 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Stefan Reinauer: Looks good to me, approved
Thomas Heijligen: Looks good to me, approved
diff --git a/jedec.c b/jedec.c
index f9442ec..2cdde61 100644
--- a/jedec.c
+++ b/jedec.c
@@ -396,7 +396,7 @@
return failed;
}
-static int write_page_write_jedec_common(struct flashctx *flash, const uint8_t *src,
+static int jedec_write_page(struct flashctx *flash, const uint8_t *src,
unsigned int start, unsigned int page_size)
{
int tries = 0, failed;
@@ -471,7 +471,7 @@
/* Length of bytes in the range in this page. */
lenhere = min(start + len, (i + 1) * page_size) - starthere;
- if (write_page_write_jedec_common(flash, buf + starthere - start, starthere, lenhere))
+ if (jedec_write_page(flash, buf + starthere - start, starthere, lenhere))
return 1;
update_progress(flash, FLASHROM_PROGRESS_WRITE, i + 1, nwrites + 1);
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/73282
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I1be83d5974e305bddceaa34b64e982b774ade0d2
Gerrit-Change-Number: 73282
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73282 )
Change subject: jedec.c: Rename func to jedec_write_page()
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73282
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I1be83d5974e305bddceaa34b64e982b774ade0d2
Gerrit-Change-Number: 73282
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:20:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72692 )
Change subject: jedec.c: Drop branching non-zero programmer_delay() operands
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/72692
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic547669bb16e6ace4fe283e07345fc2d7075d63e
Gerrit-Change-Number: 72692
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Mon, 27 Feb 2023 10:19:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment