1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

7 Commits

Author SHA1 Message Date
roccochen@chromium.com
04deed8c8f flashrom_tester: Fix partial_lock_test on libflashrom
partial_lock_test (Lock_top_quad, Lock_bottom_quad, Lock_bottom_half,
and Lock_top_half) tries to:
1. Disable HWWP
2. Lock partial
3. Enable HWWP
4. Try to write the locked partial and expect a failure
...

The 4th step only works on flashrom binary since the binary will set
FLASHROM_FLAG_VERIFY_AFTER_WRITE=1 by default and it will error out
while verifying.

But libflashrom does not set any flag beforehand, so it has
FLASHROM_FLAG_VERIFY_AFTER_WRITE=0 and thus it will think the write
command works normally and raise no error. This causes the issue that
flashrom_tester with libflashrom has been failed until today.

To solve this issue, there are two solutions:
1. Take care of the default flags in libflashrom
2. Always pass --noverify to flashrom binary and verify it afterwards.

To make both methods more consistent, I fix it with approach 1.

BUG=b:304439294
BRANCH=none
TEST=flashrom_tester internal --libflashrom Lock_top_quad

Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Signed-off-by: roccochen@chromium.com <roccochen@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/79304
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-03 07:43:35 +00:00
Brian Norris
e08899fcf4 libflashrom: Add layout "exclude" API
Layouts can be expensive to derive (reading from flash), so we might
want to reuse a layout for different purposes. Today, it's not possible
to undo a flashrom_layout_include_region() operation (to, say, operate
on a different region). Add such an API.

Change-Id: I7ea3e0674f25e34bf2cfc8f464ae7ca1c1a3fbfd
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/76005
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
2023-07-18 01:17:04 +00:00
Evan Benn
e4c51439ac rust: Add license and other metadata to Cargo.toml
Add missing license to the Cargo.toml rust files, and some other
metadata that might be useful.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ibdab16713395509be511e45c5eae946496020429
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/71618
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2023-01-12 23:26:01 +00:00
Evan Benn
8edd60e6c2 bindings: Add FLASHROM_WP_ERR_UNSUPPORTED_STATE
Add support for new write protect error.

BUG=None
BRANCH=None
TEST=cargo test

Change-Id: I2adaad6552a601147e779c85a2a51d2e39b91c28
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69864
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2022-11-28 11:40:35 +00:00
Evan Benn
66b34f8ba3 bindings/rust: Document the rust bindings
Add an explanation of the two rust libraries, and instructions for
building. Note that the bindings are not included in the tarball.

BUG=None
BRANCH=None
TEST=None

Change-Id: I05b1b5821554f8faee7728f899d51b6e8e9bf5be
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66618
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2022-08-19 04:38:18 +00:00
Evan Benn
401d9bfa71 bindings/rust/libflashrom: Create fat rust binding
Create a rust library wrapping libflashrom-sys in a more idiomatic rust
API.

BUG=b:230545739
BRANCH=None
TEST=cargo test

Change-Id: Ie3bcfde40dc475f6a9439ccab8e2446967f7d6dd
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65281
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-19 04:37:43 +00:00
Evan Benn
06d32e1147 bindings/rust/libflashrom-sys: Create thin rust bindgen binding
Use bindgen to create a rust library that calls into libflashrom using
FFI.

BUG=b:230545739
BRANCH=None
TEST=cargo test

Change-Id: I36ba70de2bca8f83d2fdd6fd4c9b7c28a11624ee
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65280
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-19 04:37:21 +00:00