summaryrefslogtreecommitdiff
path: root/src/arch/x86/boot
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-02-24 22:27:39 -0600
committerAaron Durbin <adurbin@google.com>2014-03-03 19:50:32 +0100
commit7d1996cc4af563f614455db23fe91a6feccd2560 (patch)
treed8bbaeb40898a3dbf197cbca991acf9962b7c7f9 /src/arch/x86/boot
parente58a24b1b598383eab918dac03be4d7122bf0ac5 (diff)
coreboot: introduce arch_payload_run()
The selfboot() function relied on global variables within the selfboot.c compilation unit. Now that the bounce buffer is a part of struct payload use a new architecture-specific arch_payload_run() function for jumping to the payload. selfboot() can then be removed. Change-Id: Icec74942e94599542148561b3311ce5096ac5ea5 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5300 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/arch/x86/boot')
-rw-r--r--src/arch/x86/boot/boot.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/arch/x86/boot/boot.c b/src/arch/x86/boot/boot.c
index 3ef46a5bf0..29070a0ce1 100644
--- a/src/arch/x86/boot/boot.c
+++ b/src/arch/x86/boot/boot.c
@@ -1,12 +1,12 @@
#include <console/console.h>
#include <arch/stages.h>
+#include <payload_loader.h>
#include <ip_checksum.h>
#include <string.h>
-#if CONFIG_RELOCATABLE_RAMSTAGE
/* When the ramstage is relocatable the elf loading ensures an elf image cannot
* be loaded over the ramstage code. */
-void jmp_to_elf_entry(void *entry, unsigned long unused1, unsigned long unused2)
+static void jmp_payload_no_bounce_buffer(void *entry)
{
/* Jump to kernel */
__asm__ __volatile__(
@@ -22,8 +22,8 @@ void jmp_to_elf_entry(void *entry, unsigned long unused1, unsigned long unused2)
"r" (entry)
);
}
-#else
-void jmp_to_elf_entry(void *entry, unsigned long buffer, unsigned long size)
+
+static void jmp_payload(void *entry, unsigned long buffer, unsigned long size)
{
extern unsigned char _ram_seg, _eram_seg;
unsigned long lb_start, lb_size;
@@ -122,6 +122,12 @@ void jmp_to_elf_entry(void *entry, unsigned long buffer, unsigned long size)
"ri"(0), "ri" (0)
);
}
-#endif /* CONFIG_RELOCATABLE_RAMSTAGE */
-
+void arch_payload_run(const struct payload *payload)
+{
+ if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE))
+ jmp_payload_no_bounce_buffer(payload->entry);
+ else
+ jmp_payload(payload->entry, (uintptr_t)payload->bounce.data,
+ payload->bounce.size);
+}