cbfs: alternative support for cbfs_load_payload()

In certain situations boot speed can be increased by providing an
alternative implementation to cbfs_load_payload(). The
ALT_CBFS_LOAD_PAYLOAD option allows for the mainboard or chipset to
provide its own implementation.

Booted baskingridge board with alternative and regular
cbfs_load_payload().

Change-Id: I547ac9881a82bacbdb3bbdf38088dfcc22fd0c2c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/2782
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Aaron Durbin 2013-01-22 13:22:02 -06:00 committed by Stefan Reinauer
parent 4063ede3fb
commit 81108b9059
3 changed files with 11 additions and 1 deletions

View File

@ -47,6 +47,15 @@ config CBFS_PREFIX
Select the prefix to all files put into the image. It's "fallback" Select the prefix to all files put into the image. It's "fallback"
by default, "normal" is a common alternative. by default, "normal" is a common alternative.
config ALT_CBFS_LOAD_PAYLOAD
bool "Use alternative cbfs_load_payload() implementation."
default n
help
Either board or southbridge provide an alternative cbfs_load_payload()
implementation. This may be used, for example, if accessing the ROM
through memory-mapped I/O is slow and a faster alternative can be
provided.
choice choice
prompt "Compiler to use" prompt "Compiler to use"
default COMPILER_GCC default COMPILER_GCC

View File

@ -165,11 +165,13 @@ int cbfs_execute_stage(struct cbfs_media *media, const char *name)
return run_address((void *)(uintptr_t)ntohll(stage->entry)); return run_address((void *)(uintptr_t)ntohll(stage->entry));
} }
#if !CONFIG_ALT_CBFS_LOAD_PAYLOAD
void *cbfs_load_payload(struct cbfs_media *media, const char *name) void *cbfs_load_payload(struct cbfs_media *media, const char *name)
{ {
return (struct cbfs_payload *)cbfs_get_file_content( return (struct cbfs_payload *)cbfs_get_file_content(
media, name, CBFS_TYPE_PAYLOAD); media, name, CBFS_TYPE_PAYLOAD);
} }
#endif
/* Simple buffer */ /* Simple buffer */

View File

@ -536,4 +536,3 @@ int selfboot(struct lb_memory *mem, struct cbfs_payload *payload)
out: out:
return 0; return 0;
} }