vboot: Handle GBB_FLAG_DISABLE_LID_SHUTDOWN

Handle GBB_FLAG_DISABLE_LID_SHUTDOWN to disable lid-triggered system
shutdown.

BUG=chromium:434462
BRANCH=Auron
TEST=Manual on Auron, with corresponding depthcharge change. Set GBB
flag 0x1000 and disable powerd launch on boot. Close lid and issue
'reboot' command over ssh. Verify system reboots successfully into OS.

Change-Id: Id2731508296a5ba9229f969f8224565d64f3d4a3
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/234995
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Shawn Nematbakhsh
2014-12-12 09:40:42 -08:00
committed by chrome-internal-fetch
parent d53b6684a2
commit 5d652cdffa
2 changed files with 35 additions and 7 deletions

View File

@@ -925,9 +925,9 @@ VbError_t VbExProtectFlash(enum VbProtectFlash_t region);
/**
* Check if the firmware needs to shut down the system.
*
* Returns 1 if a shutdown is being requested (for example, the user has
* pressed the power button or closed the lid), or 0 if a shutdown is not being
* requested.
* Returns a non-zero VB_SHUTDOWN_REQUEST mask indicating the reason(s) for
* shutdown if a shutdown is being requested (see VB_SHUTDOWN_REQUEST_*), or 0
* if a shutdown is not being requested.
*
* NOTE: When we're displaying a screen, pressing the power button should shut
* down the computer. We need a way to break out of our control loop so this
@@ -935,6 +935,17 @@ VbError_t VbExProtectFlash(enum VbProtectFlash_t region);
*/
uint32_t VbExIsShutdownRequested(void);
/*
* Shutdown requested for a reason which is not defined among other
* VB_SHUTDOWN_REQUEST_* values. This must be defined as 1 for backward
* compatibility with old versions of the API.
*/
#define VB_SHUTDOWN_REQUEST_OTHER 0x00000001
/* Shutdown requested due to a lid switch being closed. */
#define VB_SHUTDOWN_REQUEST_LID_CLOSED 0x00000002
/* Shutdown requested due to a power button being pressed. */
#define VB_SHUTDOWN_REQUEST_POWER_BUTTON 0x00000004
/**
* Expose the BIOS' built-in decompression routine to the vboot wrapper. The
* caller must know how large the uncompressed data will be and must manage