coreboot: infrastructure for different ramstage loaders
There are 2 methods currently available in coreboot to load ramstage from romstage: cbfs and vboot. The vboot path had to be explicitly enabled and code needed to be added to each chipset to support both. Additionally, many of the paths were duplicated between the two. An additional complication is the presence of having a relocatable ramstage which creates another path with duplication. To rectify this situation provide a common API through the use of a callback to load the ramstage. The rest of the existing logic to handle all the various cases is put in a common place. Change-Id: I5268ce70686cc0d121161a775c3a86ea38a4d8ae Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5087 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
committed by
Aaron Durbin
parent
e9aaa71fb1
commit
0f333071ef
@@ -17,27 +17,10 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <console/console.h>
|
||||
#include <cbfs.h>
|
||||
#include <arch/stages.h>
|
||||
#include <timestamp.h>
|
||||
|
||||
static void cbfs_and_run_core(const char *filename)
|
||||
{
|
||||
u8 *dst;
|
||||
|
||||
timestamp_add_now(TS_START_COPYRAM);
|
||||
print_debug("Loading image.\n");
|
||||
dst = cbfs_load_stage(CBFS_DEFAULT_MEDIA, filename);
|
||||
if ((void *)dst == (void *) -1)
|
||||
die("FATAL: Essential component is missing.\n");
|
||||
|
||||
timestamp_add_now(TS_END_COPYRAM);
|
||||
print_debug("Jumping to image.\n");
|
||||
stage_exit(dst);
|
||||
}
|
||||
#include <ramstage_loader.h>
|
||||
|
||||
void asmlinkage copy_and_run(void)
|
||||
{
|
||||
cbfs_and_run_core(CONFIG_CBFS_PREFIX "/coreboot_ram");
|
||||
run_ramstage();
|
||||
}
|
||||
|
Reference in New Issue
Block a user