diff options
author | Dan Ehrenberg <dehrenberg@chromium.org> | 2014-11-04 16:06:20 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-15 01:13:52 +0000 |
commit | 5040a945dfd0dd305d3ca8e923b8bf0bd5c6528e (patch) | |
tree | 5b4003d4b4063151f1b60faa4482c4392159adc1 /firmware/lib/vboot_kernel.c | |
parent | e8dfacf141844ec1c2c78ecc98d85b3698bf946c (diff) | |
download | vboot-5040a945dfd0dd305d3ca8e923b8bf0bd5c6528e.tar.gz |
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>
Diffstat (limited to 'firmware/lib/vboot_kernel.c')
-rw-r--r-- | firmware/lib/vboot_kernel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c index 62e62967..740e1f23 100644 --- a/firmware/lib/vboot_kernel.c +++ b/firmware/lib/vboot_kernel.c @@ -116,9 +116,9 @@ VbError_t LoadKernel(LoadKernelParams *params, VbCommonParams *cparams) /* Read GPT data */ gpt.sector_bytes = (uint32_t)blba; gpt.drive_sectors = params->ending_lba + 1; - /* TODO: Set stored_on_device and gpt_drive_sectors appropriately */ - gpt.stored_on_device = GPT_STORED_ON_DEVICE; - gpt.gpt_drive_sectors = gpt.drive_sectors; + gpt.gpt_drive_sectors = params->gpt_lba_count; + gpt.stored_on_device = params->external_gpt ? GPT_STORED_OFF_DEVICE + : GPT_STORED_ON_DEVICE; if (0 != AllocAndReadGptData(params->disk_handle, &gpt)) { VBDEBUG(("Unable to read GPT data\n")); shcall->check_result = VBSD_LKC_CHECK_GPT_READ_ERROR; |