aboutsummaryrefslogtreecommitdiff
path: root/src/arch/arm/boot_linux.S
diff options
context:
space:
mode:
authorSam Lewis <sam.vr.lewis@gmail.com>2020-09-14 21:04:35 +1000
committerPatrick Georgi <pgeorgi@google.com>2020-09-21 08:10:56 +0000
commit362a1568670851cf25117d5660504dfb1d1b6331 (patch)
tree594596204207b4e909b685d52f9fbe164c091782 /src/arch/arm/boot_linux.S
parentd5dda47db8fe1ed48e5aa02c02b3b6fe9b1b5402 (diff)
arch/arm: Add support for loading Linux kernels
Adds support for loading Linux kernels through FIT payloads. This has been implemented as an assembly function in order to simplify dealing with some of the intricacies of loading a kernel (such as needing to jump to the kernel in ARM mode and the kernel ABI). TEST: Booted a FIT image containing a 5.4 kernel and initramfs on the Beaglebone Black. Change-Id: I7dbf9467665ec17447cec73676763844b4be4764 Signed-off-by: Sam Lewis <sam.vr.lewis@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45335 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/arch/arm/boot_linux.S')
-rw-r--r--src/arch/arm/boot_linux.S21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/arch/arm/boot_linux.S b/src/arch/arm/boot_linux.S
new file mode 100644
index 0000000000..e3985eae56
--- /dev/null
+++ b/src/arch/arm/boot_linux.S
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <arch/asm.h>
+
+/* Required to jump to kernel in ARM state */
+.arm
+/* void boot_linux(void *kernel_ptr, void *fdt_ptr); */
+ENTRY(boot_linux)
+ /* Save kernel ptr */
+ mov r3, r0
+ /* Set R2 = fdt */
+ mov r2, r1
+ /* Set R0 = 0x00000000 as expected by Linux ABI */
+ mov r0, #0
+ /* Set R1 = 0xffffffff as expected by Linux ABI */
+ mov r1, #-1
+ /* Linux ABI expects SVC mode (0x13) with IRQ(7) and FIQ(6) disabled. */
+ msr cpsr_cxf, #0xd3
+ /* Jump to kernel */
+ mov pc, r3
+ENDPROC(boot_linux)