diff options
author | Hung-Te Lin <hungte@chromium.org> | 2013-02-20 15:50:06 +0800 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2013-02-22 09:23:43 +0100 |
commit | fbf078311f37ae392b1c97dd5271035f1a056486 (patch) | |
tree | 2663b3357d84b102d94963e10e3aa73a7c2d7e87 /payloads | |
parent | 58fd5e1d3d4153ae86a997fcc9b0cfc5fd85e4b7 (diff) | |
download | coreboot-fbf078311f37ae392b1c97dd5271035f1a056486.tar.xz |
libpayload: cbfs: Fix CBFS max size calculation.
Cherry-picking CBFS fix from http://review.coreboot.org/#/c/2292/
For x86, the old CBFS search behavior was to bypass bootblock and we should keep
that. This will speed up searching if a file does not exist in CBFS.
For arm, the size in header is correct now so we can remove the hack by
CONFIG_ROM_SIZE.
Change-Id: I286ecda73bd781550e03b0b817ed3fb567d6b8d7
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2458
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/libcbfs/cbfs_core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/payloads/libpayload/libcbfs/cbfs_core.c b/payloads/libpayload/libcbfs/cbfs_core.c index 9bae188cca..2ea2771e3a 100644 --- a/payloads/libpayload/libcbfs/cbfs_core.c +++ b/payloads/libpayload/libcbfs/cbfs_core.c @@ -116,12 +116,12 @@ struct cbfs_file *cbfs_get_file(struct cbfs_media *media, const char *name) align = ntohl(header->align); romsize = ntohl(header->romsize); - // TODO header->romsize seems broken now on ARM. Remove this when it's - // fixed. -#if defined(CONFIG_ARCH_ARMV7) && CONFIG_ARCH_ARMV7 - romsize = CONFIG_ROM_SIZE; + // TODO Add a "size" in CBFS header for a platform independent way to + // determine the end of CBFS data. +#if defined(CONFIG_ARCH_X86) && CONFIG_ARCH_X86 + romsize -= htonl(header->bootblocksize); #endif - DEBUG("offset: 0x%x, align: %d, romsize: %d\n", offset, align, romsize); + DEBUG("CBFS location: 0x%x~0x%x, align: %d\n", offset, romsize, align); LOG("Looking for '%s' starting from 0x%x.\n", name, offset); media->open(media); |