mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Add bits to request and acknowledge Option ROM loading.
For fastest boot, we don't want to load the VGA Option ROM every time, but only when we need it. Coreboot does that loading, but it can't always know when it's needed (with keyboard-based dev-mode, coreboot can't tell if we're in dev-mode or not). By the time we get to U-Boot, it's too late, so we need two extra bits - one for vboot to tell coreboot to load the Option ROM and another for coreboot to let vboot know it's been done. BUG=chrome-os-partner:8789 TEST=manual The only visible change is that crossystem will now have an "oprom_needed" flag that can be set or cleared. Nothing actually pays attention to it yet, though. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: I521a6afdfb8ea17a8148b32eeb858844c981de9c Reviewed-on: https://gerrit.chromium.org/gerrit/26272 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
@@ -169,6 +169,8 @@ typedef struct VbCommonParams {
|
|||||||
* virtual switch (kept in the TPM) instead. When this flag is set,
|
* virtual switch (kept in the TPM) instead. When this flag is set,
|
||||||
* VB_INIT_FLAG_DEV_SWITCH_ON is ignored. */
|
* VB_INIT_FLAG_DEV_SWITCH_ON is ignored. */
|
||||||
#define VB_INIT_FLAG_VIRTUAL_DEV_SWITCH 0x00000040
|
#define VB_INIT_FLAG_VIRTUAL_DEV_SWITCH 0x00000040
|
||||||
|
/* Set when the VGA Option ROM has been loaded already. */
|
||||||
|
#define VB_INIT_FLAG_OPROM_LOADED 0x00000080
|
||||||
|
|
||||||
/* Output flags for VbInitParams.out_flags. Used to indicate
|
/* Output flags for VbInitParams.out_flags. Used to indicate
|
||||||
* potential boot paths and configuration to the calling firmware
|
* potential boot paths and configuration to the calling firmware
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ typedef enum VbNvParam {
|
|||||||
/* Set by userspace to request that RO firmware disable dev-mode on the next
|
/* Set by userspace to request that RO firmware disable dev-mode on the next
|
||||||
* boot. This is likely only possible if the dev-switch is virtual. */
|
* boot. This is likely only possible if the dev-switch is virtual. */
|
||||||
VBNV_DISABLE_DEV_REQUEST,
|
VBNV_DISABLE_DEV_REQUEST,
|
||||||
|
/* Set and cleared by vboot to request that the video Option ROM be loaded at
|
||||||
|
* boot time, so that BIOS screens can be displayed. 0=no, 1=yes. */
|
||||||
|
VBNV_OPROM_NEEDED,
|
||||||
} VbNvParam;
|
} VbNvParam;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -233,6 +233,8 @@ typedef struct VbKernelPreambleHeader {
|
|||||||
#define VBSD_BOOT_RO_NORMAL_SUPPORT 0x00000200
|
#define VBSD_BOOT_RO_NORMAL_SUPPORT 0x00000200
|
||||||
/* VbInit was told that the system has a virtual dev-switch */
|
/* VbInit was told that the system has a virtual dev-switch */
|
||||||
#define VBSD_HONOR_VIRT_DEV_SWITCH 0x00000400
|
#define VBSD_HONOR_VIRT_DEV_SWITCH 0x00000400
|
||||||
|
/* VbInit was told that the VGA Option ROM was loaded at boot */
|
||||||
|
#define VBSD_BOOT_OPROM_LOADED 0x00000800
|
||||||
|
|
||||||
/* Result codes for VbSharedDataHeader.check_fw_a_result (and b_result) */
|
/* Result codes for VbSharedDataHeader.check_fw_a_result (and b_result) */
|
||||||
#define VBSD_LF_CHECK_NOT_DONE 0
|
#define VBSD_LF_CHECK_NOT_DONE 0
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ VbError_t VbInit(VbCommonParams* cparams, VbInitParams* iparams) {
|
|||||||
shared->flags |= VBSD_BOOT_S3_RESUME;
|
shared->flags |= VBSD_BOOT_S3_RESUME;
|
||||||
if (iparams->flags & VB_INIT_FLAG_RO_NORMAL_SUPPORT)
|
if (iparams->flags & VB_INIT_FLAG_RO_NORMAL_SUPPORT)
|
||||||
shared->flags |= VBSD_BOOT_RO_NORMAL_SUPPORT;
|
shared->flags |= VBSD_BOOT_RO_NORMAL_SUPPORT;
|
||||||
|
if (iparams->flags & VB_INIT_FLAG_OPROM_LOADED)
|
||||||
|
shared->flags |= VBSD_BOOT_OPROM_LOADED;
|
||||||
|
|
||||||
is_s3_resume = (iparams->flags & VB_INIT_FLAG_S3_RESUME ? 1 : 0);
|
is_s3_resume = (iparams->flags & VB_INIT_FLAG_S3_RESUME ? 1 : 0);
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#define BOOT_OFFSET 1
|
#define BOOT_OFFSET 1
|
||||||
#define BOOT_DEBUG_RESET_MODE 0x80
|
#define BOOT_DEBUG_RESET_MODE 0x80
|
||||||
#define BOOT_DISABLE_DEV_REQUEST 0x40
|
#define BOOT_DISABLE_DEV_REQUEST 0x40
|
||||||
|
#define BOOT_OPROM_NEEDED 0x20
|
||||||
#define BOOT_TRY_B_COUNT_MASK 0x0F
|
#define BOOT_TRY_B_COUNT_MASK 0x0F
|
||||||
|
|
||||||
#define RECOVERY_OFFSET 2
|
#define RECOVERY_OFFSET 2
|
||||||
@@ -119,6 +120,10 @@ int VbNvGet(VbNvContext* context, VbNvParam param, uint32_t* dest) {
|
|||||||
*dest = (raw[BOOT_OFFSET] & BOOT_DISABLE_DEV_REQUEST ? 1 : 0);
|
*dest = (raw[BOOT_OFFSET] & BOOT_DISABLE_DEV_REQUEST ? 1 : 0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case VBNV_OPROM_NEEDED:
|
||||||
|
*dest = (raw[BOOT_OFFSET] & BOOT_OPROM_NEEDED ? 1 : 0);
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -207,6 +212,13 @@ int VbNvSet(VbNvContext* context, VbNvParam param, uint32_t value) {
|
|||||||
raw[BOOT_OFFSET] &= ~BOOT_DISABLE_DEV_REQUEST;
|
raw[BOOT_OFFSET] &= ~BOOT_DISABLE_DEV_REQUEST;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case VBNV_OPROM_NEEDED:
|
||||||
|
if (value)
|
||||||
|
raw[BOOT_OFFSET] |= BOOT_OPROM_NEEDED;
|
||||||
|
else
|
||||||
|
raw[BOOT_OFFSET] &= ~BOOT_OPROM_NEEDED;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,6 +381,8 @@ int VbGetSystemPropertyInt(const char* name) {
|
|||||||
value = VbGetNvStorage(VBNV_DEV_BOOT_USB);
|
value = VbGetNvStorage(VBNV_DEV_BOOT_USB);
|
||||||
} else if (!strcasecmp(name,"dev_boot_signed_only")) {
|
} else if (!strcasecmp(name,"dev_boot_signed_only")) {
|
||||||
value = VbGetNvStorage(VBNV_DEV_BOOT_SIGNED_ONLY);
|
value = VbGetNvStorage(VBNV_DEV_BOOT_SIGNED_ONLY);
|
||||||
|
} else if (!strcasecmp(name,"oprom_needed")) {
|
||||||
|
value = VbGetNvStorage(VBNV_OPROM_NEEDED);
|
||||||
}
|
}
|
||||||
/* Other parameters */
|
/* Other parameters */
|
||||||
else if (!strcasecmp(name,"cros_debug")) {
|
else if (!strcasecmp(name,"cros_debug")) {
|
||||||
@@ -460,6 +462,8 @@ int VbSetSystemPropertyInt(const char* name, int value) {
|
|||||||
return VbSetNvStorage(VBNV_DEV_BOOT_USB, value);
|
return VbSetNvStorage(VBNV_DEV_BOOT_USB, value);
|
||||||
} else if (!strcasecmp(name,"dev_boot_signed_only")) {
|
} else if (!strcasecmp(name,"dev_boot_signed_only")) {
|
||||||
return VbSetNvStorage(VBNV_DEV_BOOT_SIGNED_ONLY, value);
|
return VbSetNvStorage(VBNV_DEV_BOOT_SIGNED_ONLY, value);
|
||||||
|
} else if (!strcasecmp(name,"oprom_needed")) {
|
||||||
|
return VbSetNvStorage(VBNV_OPROM_NEEDED, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ const Param sys_param_list[] = {
|
|||||||
{"mainfw_act", IS_STRING, "Active main firmware"},
|
{"mainfw_act", IS_STRING, "Active main firmware"},
|
||||||
{"mainfw_type", IS_STRING, "Active main firmware type"},
|
{"mainfw_type", IS_STRING, "Active main firmware type"},
|
||||||
{"nvram_cleared", CAN_WRITE, "Have NV settings been lost? Write 0 to clear"},
|
{"nvram_cleared", CAN_WRITE, "Have NV settings been lost? Write 0 to clear"},
|
||||||
|
{"oprom_needed", CAN_WRITE, "Should we load the VGA Option ROM at boot?"},
|
||||||
{"platform_family", IS_STRING, "Platform family type"},
|
{"platform_family", IS_STRING, "Platform family type"},
|
||||||
{"recovery_reason", 0, "Recovery mode reason for current boot"},
|
{"recovery_reason", 0, "Recovery mode reason for current boot"},
|
||||||
{"recovery_request", CAN_WRITE, "Recovery mode request (writable)"},
|
{"recovery_request", CAN_WRITE, "Recovery mode request (writable)"},
|
||||||
@@ -69,8 +70,6 @@ const Param sys_param_list[] = {
|
|||||||
{"tpm_fwver", 0, "Firmware version stored in TPM", "0x%08x"},
|
{"tpm_fwver", 0, "Firmware version stored in TPM", "0x%08x"},
|
||||||
{"tpm_kernver", 0, "Kernel version stored in TPM", "0x%08x"},
|
{"tpm_kernver", 0, "Kernel version stored in TPM", "0x%08x"},
|
||||||
{"tried_fwb", 0, "Tried firmware B before A this boot"},
|
{"tried_fwb", 0, "Tried firmware B before A this boot"},
|
||||||
{"vbtest_errfunc", CAN_WRITE, "Verified boot test error function (writable)"},
|
|
||||||
{"vbtest_errno", CAN_WRITE, "Verified boot test error number (writable)"},
|
|
||||||
{"vdat_flags", 0, "Flags from VbSharedData", "0x%08x"},
|
{"vdat_flags", 0, "Flags from VbSharedData", "0x%08x"},
|
||||||
{"vdat_lfdebug", IS_STRING|NO_PRINT_ALL,
|
{"vdat_lfdebug", IS_STRING|NO_PRINT_ALL,
|
||||||
"LoadFirmware() debug data (not in print-all)"},
|
"LoadFirmware() debug data (not in print-all)"},
|
||||||
|
|||||||
Reference in New Issue
Block a user