diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2011-07-25 16:10:31 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:12 -0700 |
commit | d1b1d2fe83e9ba91cc27dc66d5c73691ab61bdf2 (patch) | |
tree | 080b7230e975f834f128f4df20826046139a4421 /lib/chromeos | |
parent | 20ca441d1f790cbee8fb06a5781e09017cdb0868 (diff) |
CHROMIUM: reserve board-specific section for crossystem data
So far there seems to be no real board-specific data that crossystem
requires (the LBA/offset/size of non-volatile context used on ARM boards
are constants, and could be removed from crossystem data blob).
Nevertheless, I think it should be good to reserve a section for
board-specific data.
BUG=chromium-os:17876
TEST=make
Change-Id: I249fb6bb1ac1740df9f9596e1e1a61ab08c45659
Reviewed-on: http://gerrit.chromium.org/gerrit/4648
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'lib/chromeos')
-rw-r--r-- | lib/chromeos/crossystem_data.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/lib/chromeos/crossystem_data.c b/lib/chromeos/crossystem_data.c index cd20cc83176..831a38fbb3c 100644 --- a/lib/chromeos/crossystem_data.c +++ b/lib/chromeos/crossystem_data.c @@ -42,10 +42,6 @@ int crossystem_data_init(crossystem_data_t *cdata, memcpy(cdata->signature, CROSSYSTEM_DATA_SIGNATURE, sizeof(CROSSYSTEM_DATA_SIGNATURE)); - cdata->nonvolatile_context_lba = CHROMEOS_VBNVCONTEXT_LBA; - cdata->nonvolatile_context_offset = 0; - cdata->nonvolatile_context_size = VBNV_BLOCK_SIZE; - cdata->boot_write_protect_switch = write_protect_switch->value; cdata->boot_recovery_switch = recovery_switch->value; cdata->boot_developer_switch = developer_switch->value; @@ -65,6 +61,12 @@ int crossystem_data_init(crossystem_data_t *cdata, memcpy(cdata->readonly_firmware_id, readonly_firmware_id, sizeof(cdata->readonly_firmware_id)); +#ifdef CONFIG_TEGRA2 + cdata->board.arm.nonvolatile_context_lba = CHROMEOS_VBNVCONTEXT_LBA; + cdata->board.arm.nonvolatile_context_offset = 0; + cdata->board.arm.nonvolatile_context_size = VBNV_BLOCK_SIZE; +#endif + return 0; } @@ -158,13 +160,6 @@ int crossystem_data_embed_into_fdt(crossystem_data_t *cdata, void *fdt, err |= set_array_prop("signature", signature); err |= set_scalar_prop("version", version); - err |= set_scalar_prop("nonvolatile-context-lba", - nonvolatile_context_lba); - err |= set_scalar_prop("nonvolatile-context-offset", - nonvolatile_context_offset); - err |= set_scalar_prop("nonvolatile-context-size", - nonvolatile_context_size); - err |= set_bool_prop("boot-write-protect-switch", boot_write_protect_switch); err |= set_bool_prop("boot-recovery-switch", @@ -215,6 +210,15 @@ int crossystem_data_embed_into_fdt(crossystem_data_t *cdata, void *fdt, err |= set_array_prop("readonly-firmware-version", readonly_firmware_id); +#ifdef CONFIG_TEGRA2 + err |= set_scalar_prop("nonvolatile-context-lba", + board.arm.nonvolatile_context_lba); + err |= set_scalar_prop("nonvolatile-context-offset", + board.arm.nonvolatile_context_offset); + err |= set_scalar_prop("nonvolatile-context-size", + board.arm.nonvolatile_context_size); +#endif + err |= set_array_prop("vboot-shared-data", vb_shared_data); #undef set_scalar_prop @@ -235,10 +239,6 @@ void crossystem_data_dump(crossystem_data_t *cdata) _p("\"%s\"", signature); _p("%d", version); - _p("%08llx", nonvolatile_context_lba); - _p("%08x", nonvolatile_context_offset); - _p("%08x", nonvolatile_context_size); - _p("%d", boot_write_protect_switch); _p("%d", boot_recovery_switch); _p("%d", boot_developer_switch); @@ -256,5 +256,11 @@ void crossystem_data_dump(crossystem_data_t *cdata) _p("\"%s\"", hardware_id); _p("\"%s\"", readonly_firmware_id); _p("\"%s\"", firmware_id); + +#ifdef CONFIG_TEGRA2 + _p("%08llx", board.arm.nonvolatile_context_lba); + _p("%08x", board.arm.nonvolatile_context_offset); + _p("%08x", board.arm.nonvolatile_context_size); +#endif #undef _p } |