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

flashrom_tester: Drop technical debt

Drop `-p host` ChromeOS miss-feature and use `-p internal` instead.

BUG=b:296978620
BRANCH=none
TEST=run flashrom-tester with newer flashrom

Change-Id: I1ea174c1760fee3e41a2ef0e9779badf0c51298d
Signed-off-by: roccochen@chromium.com <roccochen@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/79303
Reviewed-by: Evan Benn <evanbenn@gmail.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Bob Moragues <moragues@google.com>
This commit is contained in:
roccochen@chromium.com 2023-11-27 15:06:43 +08:00 committed by Edward O'Callaghan
parent 8ac3574fc6
commit 5106287e22
3 changed files with 7 additions and 7 deletions

View File

@ -51,19 +51,19 @@ pub use libflashrom::{
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum FlashChip {
HOST,
INTERNAL,
}
impl FlashChip {
pub fn from(s: &str) -> Result<FlashChip, &str> {
match s {
"host" => Ok(FlashChip::HOST),
"internal" => Ok(FlashChip::INTERNAL),
_ => Err("cannot convert str to enum"),
}
}
pub fn to(fc: FlashChip) -> &'static str {
match fc {
FlashChip::HOST => "host",
FlashChip::INTERNAL => "internal",
}
}
@ -80,7 +80,7 @@ impl FlashChip {
/// disabled.
pub fn can_control_hw_wp(&self) -> bool {
match self {
FlashChip::HOST => true,
FlashChip::INTERNAL => true,
}
}
}

View File

@ -82,7 +82,7 @@ fn main() {
.arg(
Arg::with_name("ccd_target_type")
.required(true)
.possible_values(&["host"]),
.possible_values(&["internal"]),
)
.arg(
Arg::with_name("print-layout")

View File

@ -219,8 +219,8 @@ fn hwwp_locks_swwp_test(env: &mut TestEnv) -> TestResult {
/// is actually able to write to the Flash. This only makes sense for chips
/// running Coreboot, which we assume is just host.
fn elog_sanity_test(env: &mut TestEnv) -> TestResult {
if env.chip_type() != FlashChip::HOST {
info!("Skipping ELOG sanity check for non-host chip");
if env.chip_type() != FlashChip::INTERNAL {
info!("Skipping ELOG sanity check for non-internal chip");
return Ok(());
}
// flash should be back in the golden state