[coreboot] Patch set updated for coreboot: dde8521 cbfs: Fix CBFS max size calculation.

Hung-Te Lin (hungte@chromium.org) gerrit at coreboot.org
Wed Feb 6 05:23:53 CET 2013

Hung-Te Lin (hungte at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2292


commit dde852182905579a420a8055a248acf5a7bc55ae
Author: Hung-Te Lin <hungte at chromium.org>
Date:   Wed Feb 6 12:11:57 2013 +0800

    cbfs: Fix CBFS max size calculation.
    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
    Change-Id: I541961bc4dd083a583f8a80b69e293694fb055ef
    Signed-off-by: Hung-Te Lin <hungte at chromium.org>
 src/lib/cbfs_core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lib/cbfs_core.c b/src/lib/cbfs_core.c
index 6e4f489..1fd004f 100644
--- a/src/lib/cbfs_core.c
+++ b/src/lib/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.
-	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);
-	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);

More information about the coreboot mailing list