diff options
author | Gabe Black <gabeblack@chromium.org> | 2011-09-02 20:54:01 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@chromium.org> | 2011-09-14 18:42:04 -0700 |
commit | 8e93aec313c2807704b14fbd21123a9ffc86a087 (patch) | |
tree | 1d3dc2cc288015ff0f0cb1e282faa1f7ed3caffd /common | |
parent | 7e8332ca253ff564aa2975461ee4a5a53312d558 (diff) |
Add support for a bios-base device tree/flashmap setting
This setting specifies where the bios image described by the "flash" section
starts in the ROM. When the device tree is consumed by u-boot, this value is
added to the given offset of accesses to the flash so that it ends up in the
right place in the ROM. The binary fmap will reflect that address directly so
that tools like flashrom can use it without modification. By not modifying the
locations of the sections in the "flash" node of the device tree directly, we
can continue to share definitions between boards that have the same layout for
the BIOS image itself but who may be offset differently in the ROM. If not
present, a default value of 0 is used. Unmodified device trees will continue
to behave like they always have.
The name bios-base isn't perfect since on ARM there is no bios. Another
alternative firmware-base is also flawed because there are multiple firmwares
in the ROM on x86. Yet another option, flashmap-base, doesn't quite work either
because flashmap already has a very similarly named field which describes where
the image described by the flashmap appears in the physical address space.
Because bios-base fits the best on x86 and x86 is currently the only place it's
used, that's the name I went with.
BUG=chrome-os-partner:5844
TEST=Used this and other changes to compensate for the image offset and vboot
on stumpy. Vbooted on x86-alex. Built with vboot_test and vbexport_test built
in to verify that they still compile.
Change-Id: Ie727fc2db27f7d0db8ebf7ed2b98bc97052b4923
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/7239
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_vbexport_test.c | 2 | ||||
-rw-r--r-- | common/cmd_vboot_test.c | 2 | ||||
-rw-r--r-- | common/cmd_vboot_twostop.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/common/cmd_vbexport_test.c b/common/cmd_vbexport_test.c index de88098f1ee..fc198e96df6 100644 --- a/common/cmd_vbexport_test.c +++ b/common/cmd_vbexport_test.c @@ -410,7 +410,7 @@ static uint8_t *read_gbb_from_firmware(void) } /* Open firmware storage device. */ - if (firmware_storage_open_spi(&file)) { + if (firmware_storage_open_spi(&file, fmap.firmware_base)) { VbExDebug("Failed to open firmware device!\n"); return NULL; } diff --git a/common/cmd_vboot_test.c b/common/cmd_vboot_test.c index 8521a62e03c..5682134f7eb 100644 --- a/common/cmd_vboot_test.c +++ b/common/cmd_vboot_test.c @@ -61,7 +61,7 @@ static int do_vboot_test_fwrw(cmd_tbl_t *cmdtp, target_buf[i] = i & 0xff; /* Open firmware storage device. */ - if (firmware_storage_open_spi(&file)) { + if (firmware_storage_open_spi(&file, 0)) { VbExDebug("Failed to open firmware device!\n"); return 1; } diff --git a/common/cmd_vboot_twostop.c b/common/cmd_vboot_twostop.c index e247f43d314..265692eff42 100644 --- a/common/cmd_vboot_twostop.c +++ b/common/cmd_vboot_twostop.c @@ -467,7 +467,7 @@ twostop_init(struct twostop_fmap *fmap, firmware_storage_t *file, dump_fmap(fmap); /* We revert the decision of using firmware_storage_open_twostop() */ - if (firmware_storage_open_spi(file)) { + if (firmware_storage_open_spi(file, fmap->firmware_base)) { VBDEBUG(PREFIX "failed to open firmware storage\n"); return -1; } |