mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-25 02:35:22 +00:00
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>
74 lines
2.7 KiB
C
74 lines
2.7 KiB
C
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* Data structure of Google Binary Block (GBB)
|
|
*/
|
|
|
|
#ifndef VBOOT_REFERENCE_GBB_HEADER_H_
|
|
#define VBOOT_REFERENCE_GBB_HEADER_H_
|
|
|
|
#include "sysincludes.h"
|
|
|
|
#define GBB_HEADER_SIZE 128
|
|
|
|
#define GBB_SIGNATURE "$GBB"
|
|
#define GBB_SIGNATURE_SIZE 4
|
|
|
|
/* GBB version constants.
|
|
*
|
|
* If the major version is different than the reader can handle, it
|
|
* shouldn't attempt to parse the GBB.
|
|
*
|
|
* If the minor version is different, the reader can still parse it.
|
|
* If the minor version is greater than expected, new fields were
|
|
* added in a way which does not interfere with the old fields. If
|
|
* it's less than expected, some of the fields expected by the reader
|
|
* aren't initialized, and the reader should return default values for
|
|
* those fields. */
|
|
#define GBB_MAJOR_VER 1
|
|
#define GBB_MINOR_VER 1
|
|
|
|
/* Maximum length of a HWID in bytes, counting terminating null. */
|
|
#define GBB_HWID_MAX_SIZE 256
|
|
|
|
/* Flags for .flags field */
|
|
/* Reduce the dev screen delay to 2 sec from 30 sec to speedup factory. */
|
|
#define GBB_FLAG_DEV_SCREEN_SHORT_DELAY 0x00000001
|
|
/* BIOS should load option ROMs from arbitrary PCI devices. We'll never enable
|
|
* this ourselves because it executes non-verified code, but if a customer wants
|
|
* to void their warranty and set this flag in the read-only flash, they should
|
|
* be able to do so.
|
|
*/
|
|
#define GBB_FLAG_LOAD_OPTION_ROMS 0x00000002
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
typedef struct GoogleBinaryBlockHeader {
|
|
/* Fields present in version 1.0 */
|
|
uint8_t signature[GBB_SIGNATURE_SIZE]; /* GBB_SIGNATURE "$GBB" */
|
|
uint16_t major_version; /* See GBB_MAJOR_VER */
|
|
uint16_t minor_version; /* See GBB_MINOR_VER */
|
|
uint32_t header_size; /* size of GBB header in bytes */
|
|
uint32_t flags; /* Flags (see GBB_FLAG_*), should be 0 for 1.0. */
|
|
|
|
uint32_t hwid_offset; /* HWID offset from start of header */
|
|
uint32_t hwid_size; /* HWID size in bytes */
|
|
uint32_t rootkey_offset; /* Root Key offset from start of header */
|
|
uint32_t rootkey_size; /* Root Key size in bytes */
|
|
uint32_t bmpfv_offset; /* BMP FV offset from start of header */
|
|
uint32_t bmpfv_size; /* BMP FV size in bytes */
|
|
uint32_t recovery_key_offset; /* Recovery Key offset from start of header */
|
|
uint32_t recovery_key_size; /* Recovery Key size in bytes */
|
|
|
|
uint8_t pad[80]; /* To match GBB_HEADER_SIZE. Initialize to 0. */
|
|
} __attribute__((packed)) GoogleBinaryBlockHeader;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* VBOOT_REFERENCE_GBB_HEADER_H_ */
|