From ac12c66cf91343153ea90a6f33977a13e10b21d0 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 20 May 2015 12:08:55 -0500 Subject: assets: abstract away the firmware assets used for booting As there can be more than one source of firmware assets this patch generalizes the notion of locating a particular asset. struct asset is added along with some helper functions for working on assets as a first class citizen. Change-Id: I2ce575d1e5259aed4c34c3dcfd438abe9db1d7b9 Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/10264 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/arch/arm64/arm_tf.c | 5 +---- src/arch/arm64/boot.c | 2 +- src/arch/x86/boot/boot.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/arch') diff --git a/src/arch/arm64/arm_tf.c b/src/arch/arm64/arm_tf.c index 3e0892ec34..29dc7c344f 100644 --- a/src/arch/arm64/arm_tf.c +++ b/src/arch/arm64/arm_tf.c @@ -45,10 +45,7 @@ void __attribute__((weak)) *soc_get_bl31_plat_params(bl31_params_t *params) void arm_tf_run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr) { - struct prog bl31 = { - .type = PROG_BL31, - .name = CONFIG_CBFS_PREFIX"/bl31", - }; + struct prog bl31 = PROG_INIT(ASSET_BL31, CONFIG_CBFS_PREFIX"/bl31"); void (*bl31_entry)(bl31_params_t *params, void *plat_params) = NULL; if (prog_locate(&bl31)) diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c index 88d477c71f..b22f029e58 100644 --- a/src/arch/arm64/boot.c +++ b/src/arch/arm64/boot.c @@ -73,7 +73,7 @@ void arch_prog_run(struct prog *prog) void (*doit)(void *); void *arg; - if (ENV_RAMSTAGE && prog->type == PROG_PAYLOAD) { + if (ENV_RAMSTAGE && prog_type(prog) == ASSET_PAYLOAD) { run_payload(prog); return; } diff --git a/src/arch/x86/boot/boot.c b/src/arch/x86/boot/boot.c index 0ff8a6c37f..d86a6c35b8 100644 --- a/src/arch/x86/boot/boot.c +++ b/src/arch/x86/boot/boot.c @@ -125,7 +125,7 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size) static void try_payload(struct prog *prog) { - if (prog->type == PROG_PAYLOAD) { + if (prog_type(prog) == ASSET_PAYLOAD) { if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)) jmp_payload_no_bounce_buffer(prog_entry(prog)); else -- cgit v1.2.3