summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Wai-Hong Tam <waihong@chromium.org>2011-07-22 18:20:42 +0800
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:07 -0700
commit446d2e3a1687823cff7e6a433aeae2d2ac4a5689 (patch)
tree7545899d823b1cb78fb71cfc17e0c3c4ecfce290 /lib
parentfe7509357ee3974557fc19f7a7a47197327dd876 (diff)
CHROMIUM: Fix crossystem_data members name chanaged.
To reflect the recent name changed in: http://gerrit.chromium.org/gerrit/#change,4554 which causes the build failed. BUG=chromium-os:17876 TEST=build without error Change-Id: Icb89448ba6c164cc1342cf1a5644fc2762938411 Reviewed-on: http://gerrit.chromium.org/gerrit/4570 Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/vboot/bootstub_entry.c47
-rw-r--r--lib/vboot/global_data.c19
-rw-r--r--lib/vboot/main_entry.c2
3 files changed, 28 insertions, 40 deletions
diff --git a/lib/vboot/bootstub_entry.c b/lib/vboot/bootstub_entry.c
index 7e8497e417..6ead58c0b2 100644
--- a/lib/vboot/bootstub_entry.c
+++ b/lib/vboot/bootstub_entry.c
@@ -33,7 +33,7 @@ static void prepare_cparams(vb_global_t *global, VbCommonParams *cparams)
{
cparams->gbb_data = global->gbb_data;
cparams->gbb_size = global->gbb_size;
- cparams->shared_data_blob = global->cdata_blob.vbshared_data;
+ cparams->shared_data_blob = global->cdata_blob.vb_shared_data;
cparams->shared_data_size = VB_SHARED_DATA_REC_SIZE;
}
@@ -41,11 +41,11 @@ static void prepare_iparams(vb_global_t *global, VbInitParams *iparams)
{
crossystem_data_t *cdata = &global->cdata_blob;
iparams->flags = VB_INIT_FLAG_RO_NORMAL_SUPPORT;
- if (cdata->developer_sw)
+ if (cdata->boot_developer_switch)
iparams->flags |= VB_INIT_FLAG_DEV_SWITCH_ON;
- if (cdata->recovery_sw)
+ if (cdata->boot_recovery_switch)
iparams->flags |= VB_INIT_FLAG_REC_BUTTON_PRESSED;
- if (cdata->write_protect_sw)
+ if (cdata->boot_write_protect_switch)
iparams->flags |= VB_INIT_FLAG_WP_ENABLED;
}
@@ -226,63 +226,52 @@ static VbError_t call_VbSelectFirmware(VbCommonParams *cparams,
return ret;
}
-static void fill_boot_status(vb_global_t *global,
- uint32_t selected_firmware)
-{
- crossystem_data_t *cdata = &global->cdata_blob;
- VbSharedDataHeader *shared = (VbSharedDataHeader *)cdata->vbshared_data;
- /* mainfw_type of non-recovery boot depends on dev switch */
- int mainfw_type = cdata->developer_sw ? DEVELOPER_TYPE
- : NORMAL_TYPE;
-
- if (selected_firmware == VB_SELECT_FIRMWARE_RECOVERY) {
- crossystem_data_set_recovery_reason(cdata,
- shared->recovery_reason);
- mainfw_type = RECOVERY_TYPE;
- }
-
- crossystem_data_set_active_main_firmware(cdata, selected_firmware,
- mainfw_type);
-}
-
static int fill_crossystem_data(vb_global_t *global,
firmware_storage_t *file,
struct fdt_twostop_fmap *fmap,
uint32_t selected_firmware)
{
crossystem_data_t *cdata = &global->cdata_blob;
- char fwid[ID_LEN];
+ uint8_t fwid_buf[ID_LEN];
+ uint8_t *fwid = fwid_buf;
uint32_t fwid_offset;
-
- fill_boot_status(global, selected_firmware);
+ /* mainfw_type of non-recovery boot depends on dev switch */
+ int mainfw_type = cdata->boot_developer_switch ?
+ FIRMWARE_TYPE_DEVELOPER : FIRMWARE_TYPE_NORMAL;
/* Fills FWID */
switch (selected_firmware) {
case VB_SELECT_FIRMWARE_RECOVERY:
+ mainfw_type = FIRMWARE_TYPE_RECOVERY;
+ /* continue */
+
case VB_SELECT_FIRMWARE_READONLY:
- crossystem_data_set_fwid(cdata, (char *)cdata->frid);
+ fwid = cdata->readonly_firmware_id;
goto done;
case VB_SELECT_FIRMWARE_A:
fwid_offset = fmap->readwrite_a.firmware_id.offset;
+ assert(fmap->readwrite_a.firmware_id.length == ID_LEN);
break;
case VB_SELECT_FIRMWARE_B:
fwid_offset = fmap->readwrite_b.firmware_id.offset;
+ assert(fmap->readwrite_b.firmware_id.length == ID_LEN);
break;
default:
return 1;
}
- if (file->read(file, fwid_offset, ID_LEN, fwid)) {
+ if (file->read(file, fwid_offset, ID_LEN, fwid_buf)) {
VBDEBUG(PREFIX "Failed to read FWID from firmware!\n");
return 1;
}
- crossystem_data_set_fwid(cdata, fwid);
done:
+ crossystem_data_set_main_firmware(cdata, mainfw_type, fwid);
crossystem_data_dump(cdata);
+
return 0;
}
diff --git a/lib/vboot/global_data.c b/lib/vboot/global_data.c
index 70e986e481..428435590c 100644
--- a/lib/vboot/global_data.c
+++ b/lib/vboot/global_data.c
@@ -110,8 +110,9 @@ int init_vboot_global(vb_global_t *global, firmware_storage_t *file)
void *fdt_ptr = (void *)gd->blob;
cros_gpio_t wpsw, recsw, devsw;
struct fdt_twostop_fmap fmap;
- char frid[ID_LEN];
- uint8_t nvraw[VBNV_BLOCK_SIZE];
+ uint8_t frid[ID_LEN];
+ GoogleBinaryBlockHeader *gbb =
+ (GoogleBinaryBlockHeader *)global->gbb_data;
global->version = VBGLOBAL_VERSION;
memcpy(global->signature, VBGLOBAL_SIGNATURE,
@@ -155,14 +156,12 @@ int init_vboot_global(vb_global_t *global, firmware_storage_t *file)
return 1;
}
- if (VbExNvStorageRead(nvraw)) {
- VBDEBUG(PREFIX "Failed to read NvStorage!\n");
- return 1;
- }
-
- if (crossystem_data_init(&global->cdata_blob, frid,
- fmap.readonly.fmap.offset, global->gbb_data, nvraw,
- &wpsw, &recsw, &devsw)) {
+ if (crossystem_data_init(&global->cdata_blob,
+ &wpsw, &recsw, &devsw,
+ fmap.readonly.fmap.offset,
+ ACTIVE_EC_FIRMWARE_RO,
+ (uint8_t *)global->gbb_data + gbb->hwid_offset,
+ frid)) {
VBDEBUG(PREFIX "Failed to init crossystem data!\n");
return 1;
}
diff --git a/lib/vboot/main_entry.c b/lib/vboot/main_entry.c
index 7037e7c991..c6b67d5ba8 100644
--- a/lib/vboot/main_entry.c
+++ b/lib/vboot/main_entry.c
@@ -21,7 +21,7 @@ static void prepare_cparams(vb_global_t *global, VbCommonParams *cparams)
{
cparams->gbb_data = global->gbb_data;
cparams->gbb_size = global->gbb_size;
- cparams->shared_data_blob = global->cdata_blob.vbshared_data;
+ cparams->shared_data_blob = global->cdata_blob.vb_shared_data;
cparams->shared_data_size = VB_SHARED_DATA_REC_SIZE;
}