coreboot: unify infrastructure for loading payloads

A payload can be loaded either from a vboot region or from cbfs.
Provide a common place for choosing where the payload is loaded
from. Additionally, place the logic in the 'loaders' directory
similarly to the ramstage loader infrastructure.

Change-Id: I6b0034ea5ebd04a3d058151819ac77a126a6bfe2
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/5296
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Aaron Durbin
2014-02-24 14:56:34 -06:00
committed by Aaron Durbin
parent 9cd96b4096
commit bdf913ab01
10 changed files with 222 additions and 40 deletions

View File

@ -65,12 +65,6 @@
#include "cbfs_core.c"
#if CONFIG_VBOOT_VERIFY_FIRMWARE
#include <vendorcode/google/chromeos/chromeos.h>
#else
static inline void *vboot_get_payload(int *len) { return NULL; }
#endif
#ifndef __SMM__
static inline int tohex4(unsigned int c)
{
@ -160,19 +154,6 @@ void * cbfs_load_stage(struct cbfs_media *media, const char *name)
return (void *) entry;
}
void *cbfs_load_payload(struct cbfs_media *media, const char *name)
{
struct cbfs_payload *payload;
payload = vboot_get_payload(NULL);
if (payload != NULL)
return payload;
payload = (struct cbfs_payload *)cbfs_get_file_content(
media, name, CBFS_TYPE_PAYLOAD, NULL);
return payload;
}
/* Simple buffer */
void *cbfs_simple_buffer_map(struct cbfs_simple_buffer *buffer,