crossystem: arm: reland nvstorage using flashrom
This relands CL:2218891, which was reverted as the "mkbp" case was
forgotten, and lit all sorts of stuff on fire when the CQ skipped
hardware tests and the lab was accidentally soaked in gasoline.
The devices which this affected are re-enabled in the lab, the CQ is
now configured to enable hardware tests, so let's land it again ;)
BUG=chromium:1032351,chromium:1030473,chromium:789276
BRANCH=none
TEST=On scarlet and nyan_kitty, read and write using crossystem
Change-Id: Ife4d17eeca484a2784f7e2b2f7c22fef27b9d083
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2251049
Reviewed-by: Joel Kitching <kitching@chromium.org>
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c
index 3a1876e..d16012a 100644
--- a/host/arch/arm/lib/crossystem_arch.c
+++ b/host/arch/arm/lib/crossystem_arch.c
@@ -433,9 +433,10 @@
media = ReadFdtString(FDT_NVSTORAGE_TYPE_PROP);
if (!strcmp(media, "disk"))
return vb2_read_nv_storage_disk(ctx);
- if (!strcmp(media, "cros-ec") || !strcmp(media, "mkbp") ||
- !strcmp(media, "flash"))
+ if (!strcmp(media, "cros-ec") || !strcmp(media, "mkbp"))
return vb2_read_nv_storage_mosys(ctx);
+ if (!strcmp(media, "flash"))
+ return vb2_read_nv_storage_flashrom(ctx);
return -1;
}
@@ -449,9 +450,10 @@
media = ReadFdtString(FDT_NVSTORAGE_TYPE_PROP);
if (!strcmp(media, "disk"))
return vb2_write_nv_storage_disk(ctx);
- if (!strcmp(media, "cros-ec") || !strcmp(media, "mkbp") ||
- !strcmp(media, "flash"))
+ if (!strcmp(media, "cros-ec") || !strcmp(media, "mkbp"))
return vb2_write_nv_storage_mosys(ctx);
+ if (!strcmp(media, "flash"))
+ return vb2_write_nv_storage_flashrom(ctx);
return -1;
}