summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-03-20 16:37:12 -0500
committerAaron Durbin <adurbin@google.com>2015-04-03 14:53:11 +0200
commitce9efe061a23bc3e3d2a4c17cf29692ce6f9eb53 (patch)
tree4c7715b3d7869bb3282751f536450e653dc83dbe /src/arch
parentb3847e64242228166976f425cd42331db7857551 (diff)
program loading: unify on struct prog
Instead of having different structures for loading ramstage and payload align to using struct prog. This also removes arch_payload_run() in favor of the prog_run() interface. Change-Id: I31483096094eacc713a7433811cd69cc5621c43e Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8849 Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/boot.c5
-rw-r--r--src/arch/arm64/boot.c5
-rw-r--r--src/arch/mips/boot.c5
-rw-r--r--src/arch/riscv/boot.c5
-rw-r--r--src/arch/x86/boot/boot.c18
5 files changed, 11 insertions, 27 deletions
diff --git a/src/arch/arm/boot.c b/src/arch/arm/boot.c
index 6a2934b86e..806e0d10ff 100644
--- a/src/arch/arm/boot.c
+++ b/src/arch/arm/boot.c
@@ -29,8 +29,3 @@ void arch_prog_run(struct prog *prog)
doit = prog_entry(prog);
doit(prog_entry_arg(prog));
}
-
-void arch_payload_run(struct payload *payload)
-{
- arch_prog_run(&payload->prog);
-}
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c
index b5e375193e..312ffdddc9 100644
--- a/src/arch/arm64/boot.c
+++ b/src/arch/arm64/boot.c
@@ -77,8 +77,3 @@ void arch_prog_run(struct prog *prog)
doit(prog_entry_arg(prog));
}
-
-void arch_payload_run(struct payload *payload)
-{
- arch_prog_run(&payload->prog);
-}
diff --git a/src/arch/mips/boot.c b/src/arch/mips/boot.c
index ebc45bb682..549d4833ca 100644
--- a/src/arch/mips/boot.c
+++ b/src/arch/mips/boot.c
@@ -24,8 +24,3 @@ void arch_prog_run(struct prog *prog)
{
stage_exit(prog_entry(prog));
}
-
-void arch_payload_run(struct payload *payload)
-{
- arch_prog_run(&payload->prog);
-}
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c
index f66c02ff2e..d273430085 100644
--- a/src/arch/riscv/boot.c
+++ b/src/arch/riscv/boot.c
@@ -26,8 +26,3 @@ void arch_prog_run(struct prog *prog)
doit = prog_entry(prog);
doit(prog_entry_arg(prog));
}
-
-void arch_payload_run(struct payload *payload)
-{
- arch_prog_run(&payload->prog);
-}
diff --git a/src/arch/x86/boot/boot.c b/src/arch/x86/boot/boot.c
index d5365842d2..08fabcfb4f 100644
--- a/src/arch/x86/boot/boot.c
+++ b/src/arch/x86/boot/boot.c
@@ -123,18 +123,22 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
);
}
-void arch_payload_run(struct payload *payload)
+static void try_payload(struct prog *prog)
{
- if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE))
- jmp_payload_no_bounce_buffer(prog_entry(&payload->prog));
- else
- jmp_payload(prog_entry(&payload->prog),
- (uintptr_t)payload->bounce.data,
- payload->bounce.size);
+ if (prog->type == PROG_PAYLOAD) {
+ if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE))
+ jmp_payload_no_bounce_buffer(prog_entry(prog));
+ else
+ jmp_payload(prog_entry(prog),
+ (uintptr_t)prog_start(prog),
+ prog_size(prog));
+ }
}
void arch_prog_run(struct prog *prog)
{
+ if (ENV_RAMSTAGE)
+ try_payload(prog);
__asm__ volatile (
"jmp *%%edi\n"
:: "D"(prog_entry(prog))