diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2020-04-10 08:54:05 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-28 08:11:14 +0000 |
commit | 3aab301473ec0b95f109a245efeadc20c3b7d57d (patch) | |
tree | 326de14736d5f65a5eda2c6bc71771ced121e272 /firmware/2lib/include/2return_codes.h | |
parent | b2dca286baa74b71da70fb59e8a3f94df57269fe (diff) | |
download | vboot-3aab301473ec0b95f109a245efeadc20c3b7d57d.tar.gz |
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
VBERROR_KEEP_LOOPING
--> VB2_REQUEST_UI_CONTINUE
Since these are not really "errors", they're renamed to VB2_REQUEST_*
instead, with larger values to separate from real errors.
The old vboot1-style errors will be removed once the errors are renamed
in coreboot and depthcharge.
BRANCH=none
BUG=b:124141368, chromium:988410
TEST=make runtests
Change-Id: Ide1328f9c0f2803534fb3f1f1ecd16ad8ea36a4e
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2143030
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2return_codes.h')
-rw-r--r-- | firmware/2lib/include/2return_codes.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h index 3a303be1..6b5c0279 100644 --- a/firmware/2lib/include/2return_codes.h +++ b/firmware/2lib/include/2return_codes.h @@ -24,7 +24,30 @@ enum vb2_return_code { /* Success - no error */ VB2_SUCCESS = 0, - /* + /********************************************************************** + * Return values that are not considered errors + */ + VB2_REQUEST = 0x1000, + + /* Calling firmware requested shutdown via VbExIsShutdownRequested() */ + VB2_REQUEST_SHUTDOWN = 0x1001, + + /* Calling firmware needs to perform a reboot */ + VB2_REQUEST_REBOOT = 0x1002, + + /* Need EC to reboot to read-only code to switch RW slot */ + VB2_REQUEST_REBOOT_EC_SWITCH_RW = 0x1003, + + /* Need EC to reboot to read-only code */ + VB2_REQUEST_REBOOT_EC_TO_RO = 0x1004, + + /* Continue in the UI loop. This is used in UI internal functions. */ + VB2_REQUEST_UI_CONTINUE = 0x1005, + + /* End of VB2_REQUEST_* */ + VB2_REQUEST_END = 0x5000, + + /********************************************************************** * All vboot2 error codes start at a large offset from zero, to reduce * the risk of overlap with other error codes (TPM, etc.). */ @@ -41,22 +64,22 @@ enum vb2_return_code { * TODO: deprecate these once they have all moved over to vboot2 style */ /* Calling firmware needs to perform a reboot. */ - VBERROR_REBOOT_REQUIRED = 0x10007, + VBERROR_REBOOT_REQUIRED = VB2_REQUEST_REBOOT, /* Calling firmware requested shutdown via VbExIsShutdownRequested() */ - VBERROR_SHUTDOWN_REQUESTED = 0x1000D, + VBERROR_SHUTDOWN_REQUESTED = VB2_REQUEST_SHUTDOWN, /* VbExBeep() can't make sound in the background */ VBERROR_NO_BACKGROUND_SOUND = 0x10019, /* Need EC to reboot to read-only code to switch RW slot */ - VBERROR_EC_REBOOT_TO_SWITCH_RW = 0x1001A, + VBERROR_EC_REBOOT_TO_SWITCH_RW = VB2_REQUEST_REBOOT_EC_SWITCH_RW, /* Need EC to reboot to read-only code */ - VBERROR_EC_REBOOT_TO_RO_REQUIRED = 0x10022, + VBERROR_EC_REBOOT_TO_RO_REQUIRED = VB2_REQUEST_REBOOT_EC_TO_RO, /* Peripheral busy. Cannot upgrade firmware at present. */ VBERROR_PERIPHERAL_BUSY = 0x10030, /* Error writing VPD */ VBERROR_VPD_WRITE = 0x10032, /* Detachable UI internal functions may return the following codes */ /* No error; return to UI loop */ - VBERROR_KEEP_LOOPING = 0x30000, + VBERROR_KEEP_LOOPING = VB2_REQUEST_UI_CONTINUE, /********************************************************************** * SHA errors |