Add flag to GBB to allow loading PCI Option ROMs

As shipped, H2C only loads the option ROM for the built-in video, and that
only when it needs display the BIOS warning screens.

By setting a flag in the GBB, you can allow all option ROMs to be loaded:

Note that we'll never enable this ourselves (and there's a factory test to
ensure that*) because it executes non-verified code. But if a customer wants
to void their warranty and set this flag in the read-only flash so they can
install and use other PCI devices, they should be able to do so.

BUG=chrome-os-partner:6148
TEST=none

The only way to test this is to use a BIOS that was compiled with serial
debugging enabled, so there's nothing for QA to do. If you have such a BIOS,
you can see the difference like so:

  flashrom -r oldbios.bin
  gbb_utility -s --flags=2 oldbios.bin newbios.bin
  flashrom -w newbios.bin
  <reboot>

When bit 1 of the GBB flags is 0, you'll see these lines in the serial
output:

  LoadOpRomImage-->GetSystemConfigurationTable Status = Success
  LoadOpRomImage-->GetH2cBootMode Status = Success

When bit 1 of the GBB flags is 1, you'll see these lines in the serial
output:

  LoadOpRomImage-->GetSystemConfigurationTable Status = Success
  LoadOpRomImage-->GetH2cBootMode Status = Success
  LoadOpRomImage-->PCI OpRom on 1.0.0 is allowed!!!

This happens in any boot mode (normal, developer, recovery).

--
*The factory test for GBB zero flags is gft_clear_gbb_flags.sh, in
 src/platform/factory_test_tools

Change-Id: I31a10cc9d562b4b83669ca8a114b60e87ae28b0a
Reviewed-on: https://gerrit.chromium.org/gerrit/11505
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2011-11-10 13:31:39 -08:00
parent fa9d7782e8
commit c8e4ff7c15
4 changed files with 24 additions and 2 deletions

View File

@@ -16,6 +16,7 @@
VbError_t VbInit(VbCommonParams* cparams, VbInitParams* iparams) {
VbSharedDataHeader* shared = (VbSharedDataHeader*)cparams->shared_data_blob;
GoogleBinaryBlockHeader* gbb = (GoogleBinaryBlockHeader*)cparams->gbb_data;
VbNvContext vnc;
VbError_t retval = VBERROR_SUCCESS;
uint32_t recovery = VBNV_RECOVERY_NOT_REQUESTED;
@@ -106,7 +107,11 @@ VbError_t VbInit(VbCommonParams* cparams, VbInitParams* iparams) {
VB_INIT_OUT_ENABLE_USB_STORAGE);
}
/* Copy current recovery reason to shared data */
/* Allow BIOS to load arbitrary option ROMs? */
if (gbb->flags & GBB_FLAG_LOAD_OPTION_ROMS)
iparams->out_flags |= VB_INIT_OUT_ENABLE_OPROM;
/* copy current recovery reason to shared data */
shared->recovery_reason = (uint8_t)recovery;
/* If this is a S3 resume, resume the TPM */