summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2020-04-17 18:39:01 +0800
committerPatrick Georgi <pgeorgi@google.com>2020-05-01 06:27:56 +0000
commit30322785c446a20bce98e0591eb8fcf0023dcb53 (patch)
tree29966ac470c12773d603cda1d26fed5f205d74c7
parenta4f8e406633810c12b836d2d0fdbcca576840d41 (diff)
downloadcoreboot-30322785c446a20bce98e0591eb8fcf0023dcb53.tar.xz
security/vboot: Convert reboot-related errors to vboot2-style
Error codes are renamed as follows: VBERROR_SHUTDOWN_REQUESTED --> VB2_REQUEST_SHUTDOWN VBERROR_REBOOT_REQUIRED --> VB2_REQUEST_REBOOT VBERROR_EC_REBOOT_TO_SWITCH_RW --> VB2_REQUEST_REBOOT_EC_SWITCH_RW VBERROR_EC_REBOOT_TO_RO_REQUIRED --> VB2_REQUEST_REBOOT_EC_TO_RO BRANCH=none BUG=b:124141368, chromium:988410 TEST=emerge-nami coreboot Cq-Depend: chromium:2143030 Change-Id: Id82cf85f49dfb63a9c3d41aacd3969786bffcac7 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40749 Reviewed-by: Joel Kitching <kitching@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/security/vboot/ec_sync.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/security/vboot/ec_sync.c b/src/security/vboot/ec_sync.c
index 580e6c6b8d..39950a8452 100644
--- a/src/security/vboot/ec_sync.c
+++ b/src/security/vboot/ec_sync.c
@@ -56,7 +56,7 @@ void vboot_sync_ec(void)
case VB2_SUCCESS:
break;
- case VBERROR_EC_REBOOT_TO_RO_REQUIRED:
+ case VB2_REQUEST_REBOOT_EC_TO_RO:
printk(BIOS_INFO, "EC Reboot requested. Doing cold reboot\n");
if (google_chromeec_reboot(0, EC_REBOOT_COLD, 0))
printk(BIOS_EMERG, "Failed to get EC to cold reboot\n");
@@ -65,7 +65,7 @@ void vboot_sync_ec(void)
break;
/* Only for EC-EFS */
- case VBERROR_EC_REBOOT_TO_SWITCH_RW:
+ case VB2_REQUEST_REBOOT_EC_SWITCH_RW:
printk(BIOS_INFO, "Switch EC slot requested. Doing cold reboot\n");
if (google_chromeec_reboot(0, EC_REBOOT_COLD,
EC_REBOOT_FLAG_SWITCH_RW_SLOT))
@@ -74,7 +74,7 @@ void vboot_sync_ec(void)
halt();
break;
- case VBERROR_REBOOT_REQUIRED:
+ case VB2_REQUEST_REBOOT:
printk(BIOS_INFO, "Reboot requested. Doing warm reboot\n");
vboot_reboot();
break;
@@ -203,7 +203,7 @@ static vb2_error_t ec_protect_flash(enum vb2_firmware_selection select, int enab
if (!enable) {
/* If protection is still enabled, need reboot */
if (resp.flags & protected_region)
- return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
+ return VB2_REQUEST_REBOOT_EC_TO_RO;
return VB2_SUCCESS;
}
@@ -222,7 +222,7 @@ static vb2_error_t ec_protect_flash(enum vb2_firmware_selection select, int enab
/* If RW will be protected at boot but not now, need a reboot */
if (resp.flags & EC_FLASH_PROTECT_ALL_AT_BOOT)
- return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
+ return VB2_REQUEST_REBOOT_EC_TO_RO;
/* Otherwise, it's an error */
return VB2_ERROR_UNKNOWN;
@@ -479,7 +479,7 @@ vb2_error_t vb2ex_ec_vboot_done(struct vb2_context *ctx)
if (limit_power) {
printk(BIOS_INFO,
"EC requests limited power usage. Request shutdown.\n");
- return VBERROR_SHUTDOWN_REQUESTED;
+ return VB2_REQUEST_SHUTDOWN;
} else {
printk(BIOS_INFO, "Waited %luus to clear limit power flag.\n",
stopwatch_duration_usecs(&sw));