Attention is currently required from: Anastasia Klimchuk, Matti Finder.
Peter Marheine has posted comments on this change by Matti Finder. ( https://review.coreboot.org/c/flashrom/+/84934?usp=email )
Change subject: rpmc: add rpmc commands feature
......................................................................
Patch Set 2:
(1 comment)
File include/rpmc.h:
https://review.coreboot.org/c/flashrom/+/84934/comment/5b67ddf3_b8ad00be?us… :
PS1, Line 37: uint8_t status;
> Within JESD260 there is a specific 8-bit extended status register defined. […]
I don't mind returning 0x80 on success, but the documentation comments should be clear on how to interpret the return value.
--
To view, visit https://review.coreboot.org/c/flashrom/+/84934?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6ab3d0446e9fd674b20550fdbfaf499b8d4a9b38
Gerrit-Change-Number: 84934
Gerrit-PatchSet: 2
Gerrit-Owner: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Comment-Date: Thu, 31 Oct 2024 22:36:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Matti Finder <matti.finder(a)gmail.com>
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, Peter Marheine.
Matti Finder has posted comments on this change by Matti Finder. ( https://review.coreboot.org/c/flashrom/+/84934?usp=email )
Change subject: rpmc: add rpmc commands feature
......................................................................
Patch Set 2:
(3 comments)
File include/rpmc.h:
https://review.coreboot.org/c/flashrom/+/84934/comment/d7912236_6d9d1418?us… :
PS1, Line 37: uint8_t status;
> It looks like you use status values in the CLI and 0x80 always indicates success, but that's not a v […]
Within JESD260 there is a specific 8-bit extended status register defined.
The status for last command success is 0b10000000, hence the 0x80.
The status 0 is only used as the state immideatly after reboot, so it should never happen after one of our transmissions.
So we could also use it as a return value without losing valuable data.
What would you prefer keeping it close to JESD260 and returning the status register value, and documenting it better (maybe adding a enum for the values). Or cheating a bit and returning 0 on success instead of 0x80. I currently prefer the second option, with some additional defines for the bits.
File meson.build:
https://review.coreboot.org/c/flashrom/+/84934/comment/aa3c01a9_54dc9fd4?us… :
PS1, Line 177: enabled
> `enabled` is only true if the feature is set to `enabled` (not `auto`). […]
Done
File rpmc.c:
https://review.coreboot.org/c/flashrom/+/84934/comment/794bd7c8_11441024?us… :
PS1, Line 287: unsigned char msg[RPMC_UPDATE_HMAC_KEY_MSG_LENGTH];
> I'd prefer to use initializers for arrays like this (throughout this file), to make it less prone to […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/84934?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6ab3d0446e9fd674b20550fdbfaf499b8d4a9b38
Gerrit-Change-Number: 84934
Gerrit-PatchSet: 2
Gerrit-Owner: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Thu, 31 Oct 2024 16:21:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>
Attention is currently required from: Anastasia Klimchuk, Matti Finder.
Hello Anastasia Klimchuk, Peter Marheine, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/84934?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: rpmc: add rpmc commands feature
......................................................................
rpmc: add rpmc commands feature
Added optional support for all the commands specified in JESD260.
Added a new optional dependency to openssls libcrypto.
Added parsing for the rpmc parameter sfdp table.
Added necessary rpmc parameter information to flashchips struct and the
flash hardening feature to enable rpmc commands.
Enables future use of these commands in the cli_client and also
libflashrom.
Change-Id: I6ab3d0446e9fd674b20550fdbfaf499b8d4a9b38
Signed-off-by: Matti Finder <matti.finder(a)gmail.com>
---
M include/flash.h
A include/rpmc.h
M meson.build
M meson_options.txt
A rpmc.c
M sfdp.c
6 files changed, 670 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/34/84934/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/84934?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6ab3d0446e9fd674b20550fdbfaf499b8d4a9b38
Gerrit-Change-Number: 84934
Gerrit-PatchSet: 2
Gerrit-Owner: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Matti Finder <matti.finder(a)gmail.com>
Attention is currently required from: Anastasia Klimchuk.
Sergii Dmytruk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/84439?usp=email )
Change subject: Display progress for what is actually erased/written
......................................................................
Patch Set 17: Code-Review+2
(2 comments)
Patchset:
PS16:
> Just out of curiosity I ran the test case from here https://review.coreboot. […]
Read also reaches 50% for the second command:
```
Found Winbond flash chip "W25Q128.V" (16384 kB, SPI) on dummy.
Reading old flash chip contents...
[READ: 100%]...done.
Updating flash chip contents...
[READ: 50%][ERASE: 50%][WRITE: 100%]...Erase/write done from 0 to ffffff
Verifying flash...
[READ: 100%]...VERIFIED.
```
Erasure is probably the result of selecting more fine-grained erasure functions in `erasure_layout.c`. Not sure about reads.
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/84439/comment/a8f29ee5_d947e26b?us… :
PS13, Line 1270: // FIXME: round up to granularity?
> Okay so I will close this (and the other one). […]
Sure.
--
To view, visit https://review.coreboot.org/c/flashrom/+/84439?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I88ac4d40f1b6ccc1636b1efb690d8d68bdebec08
Gerrit-Change-Number: 84439
Gerrit-PatchSet: 17
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Thu, 31 Oct 2024 14:44:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Attention is currently required from: Anastasia Klimchuk, Matti Finder.
Peter Marheine has posted comments on this change by Matti Finder. ( https://review.coreboot.org/c/flashrom/+/84934?usp=email )
Change subject: rpmc: add rpmc commands feature
......................................................................
Patch Set 1:
(1 comment)
File include/rpmc.h:
https://review.coreboot.org/c/flashrom/+/84934/comment/38966ef0_ec9b0810?us… :
PS1, Line 37: uint8_t status;
It looks like you use status values in the CLI and 0x80 always indicates success, but that's not a value I would expect to indicate success. Can you add a little documentation here and perhaps also explain better what the function return values mean (even if it's just referring to an explanation attached to this field)?
--
To view, visit https://review.coreboot.org/c/flashrom/+/84934?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6ab3d0446e9fd674b20550fdbfaf499b8d4a9b38
Gerrit-Change-Number: 84934
Gerrit-PatchSet: 1
Gerrit-Owner: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Comment-Date: Wed, 30 Oct 2024 22:35:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Anastasia Klimchuk, Matti Finder.
Peter Marheine has posted comments on this change by Matti Finder. ( https://review.coreboot.org/c/flashrom/+/84934?usp=email )
Change subject: rpmc: add rpmc commands feature
......................................................................
Patch Set 1:
(2 comments)
File meson.build:
https://review.coreboot.org/c/flashrom/+/84934/comment/6fb0d9a0_4affdf5c?us… :
PS1, Line 177: enabled
`enabled` is only true if the feature is set to `enabled` (not `auto`). You probably want `get_option('rpmc').allowed()` since that's true if it's either `auto` or `enabled`.
File rpmc.c:
https://review.coreboot.org/c/flashrom/+/84934/comment/7534816b_ddc98ec5?us… :
PS1, Line 287: unsigned char msg[RPMC_UPDATE_HMAC_KEY_MSG_LENGTH];
I'd prefer to use initializers for arrays like this (throughout this file), to make it less prone to length-related errors.
```
unsigned char msg[RPMC_UPDATE_HMAC_KEY_MSG_LENGTH] = {
flash->chip->rpmc_ctx.op1_opcode,
0x01,
counter_address,
...
};
```
--
To view, visit https://review.coreboot.org/c/flashrom/+/84934?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6ab3d0446e9fd674b20550fdbfaf499b8d4a9b38
Gerrit-Change-Number: 84934
Gerrit-PatchSet: 1
Gerrit-Owner: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Comment-Date: Wed, 30 Oct 2024 22:30:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: Anastasia Klimchuk, Peter Marheine.
Matti Finder has posted comments on this change by Matti Finder. ( https://review.coreboot.org/c/flashrom/+/84840?usp=email )
Change subject: cli_client: Add rpmc command support
......................................................................
Patch Set 5:
(8 comments)
This change is ready for review.
Patchset:
PS4:
> Oh one more thing I forgot to mention sorry... […]
1) I think that makes sense I have created a new change at ID 84934 for the first commit and left this one as the documenation and cli_client change.
2) Done.
3) Yes I would like to become a maintainer for the rpmc feature :)
Commit Message:
https://review.coreboot.org/c/flashrom/+/84840/comment/f74ea504_d66478d3?us… :
PS4, Line 21: usefull
> usefull -> useful (typo) […]
Done
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/84840/comment/4753fab4_29821d26?us… :
PS4, Line 147: #if CONFIG_RPMC_ENABLED == 1
: "RPMC COMMANDS\n"
: " --get-rpmc-status read the extended status\n"
: " --write-root-key write the root key register\n"
: " --update-hmac-key update the hmac key register\n"
: " --increment-counter <previous>\n"
: " increment rpmc counter\n"
: " --get-counter get rpmc counter\n"
: "RPMC OPTIONS\n"
: " --counter-address <number> counter address (default: 0)\n"
: " --rpmc-root-key <keyfile> rpmc root key file\n"
: " --key-data <keydata> hex number to use as key data (default: 0)\n"
: #endif // CONFIG_RPMC_ENABLED
> These new commands need to also be documented on the manpage. […]
Done
https://review.coreboot.org/c/flashrom/+/84840/comment/8fc2ba09_c9679c38?us… :
PS4, Line 1323: if (options.rpmc_read_data)
: ret = rpmc_read_data(fill_flash);
> I think having code in a separate file rpmc.c is better, you don't need to move it. Keep rpmc. […]
Ok then
File include/flash.h:
https://review.coreboot.org/c/flashrom/+/84840/comment/7edbebcc_d5824ca9?us… :
PS4, Line 553: implement
> I know it's a small thing, but if you start with uppercase it would look better.
This comment doesn't really make sense in the final commit, since it was more of an todo for me. I have removed it.
https://review.coreboot.org/c/flashrom/+/84840/comment/fcf66055_c25ccc4d?us… :
PS4, Line 575: /*
: * all times in microsecond (us)
: */
> Also small comment, but this can be 1-line comment, and starting with uppercase […]
Done
https://review.coreboot.org/c/flashrom/+/84840/comment/68c5445c_2d8c4f65?us… :
PS4, Line 581: rpmc_ctx
> I understand this goes into a flashchip definition? and you mentioned you tested on one chip? It wou […]
This is sadly not as easily possible, since the chip reports itself with the same id as the W25Q128.V. So adding this feature would require changing the polling function to basically just be the same as the one for sfdp-capable chips.
File meson.build:
https://review.coreboot.org/c/flashrom/+/84840/comment/a486222c_9d85dce1?us… :
PS4, Line 177: if libcrypto.found()
: add_project_arguments('-DCONFIG_RPMC_ENABLED=1', language : 'c')
> This ignores the meson option you added. […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/84840?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I36c823bbee65f256eb6edabe6f058321c9a0cfa1
Gerrit-Change-Number: 84840
Gerrit-PatchSet: 5
Gerrit-Owner: Matti Finder <matti.finder(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Wed, 30 Oct 2024 17:18:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>
Comment-In-Reply-To: Matti Finder <matti.finder(a)gmail.com>