vboot: Plumb the two disk sizes and 'gpt on device' param through

To support an external GPT, disks have two new attributes:
- A binary flag indicating whether the GPT is in the same address
  space as the payloads or a separate one.
- The number of sectors of the streaming portion of storage, as
  opposed to the portion containing the GPT.
These have been added elsewhere to GptData (in cgptlib) and BlockDev
(in depthcharge). This patch adds the plumbing between those, including
in the DiskInfo interface between the firmware and vboot.

BUG=chromium:425677
BRANCH=none
TEST=Interactively wrote the GPT with cgpt and observed the following
boot with depthcharge to read the GPT from SPI and then read from
the proper locations in NAND flash.
make runalltests passes.

Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org>
Change-Id: I5a77e417aea8ee9442d18c200d1b073aa5375ecf
Reviewed-on: https://chromium-review.googlesource.com/228943
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Dan Ehrenberg
2014-11-04 16:06:20 -08:00
committed by chrome-internal-fetch
parent e8dfacf141
commit 5040a945df
8 changed files with 53 additions and 15 deletions

View File

@@ -88,7 +88,7 @@ uint32_t VbTryLoadKernel(VbCommonParams *cparams, LoadKernelParams *p,
*/
if (512 != disk_info[i].bytes_per_lba ||
32 > disk_info[i].lba_count ||
get_info_flags != disk_info[i].flags) {
get_info_flags != (disk_info[i].flags & ~VB_DISK_FLAG_EXTERNAL_GPT)) {
VBDEBUG((" skipping: bytes_per_lba=%" PRIu64
" lba_count=%" PRIu64 " flags=0x%x\n",
disk_info[i].bytes_per_lba,
@@ -98,7 +98,9 @@ uint32_t VbTryLoadKernel(VbCommonParams *cparams, LoadKernelParams *p,
}
p->disk_handle = disk_info[i].handle;
p->bytes_per_lba = disk_info[i].bytes_per_lba;
p->ending_lba = disk_info[i].lba_count - 1;
p->ending_lba = disk_info[i].streaming_lba_count - 1;
p->gpt_lba_count = disk_info[i].lba_count;
p->external_gpt = disk_info[i].flags & VB_DISK_FLAG_EXTERNAL_GPT;
retval = LoadKernel(p, cparams);
VBDEBUG(("VbTryLoadKernel() LoadKernel() = %d\n", retval));