From f795242f26887e08162b77c5ca2967f6ffcfee02 Mon Sep 17 00:00:00 2001 From: Asami Doi Date: Tue, 11 Jun 2019 16:01:31 +0900 Subject: mainboard/emulation/qemu-aarch64: Add new board for ARMv8 This CL adds a new board, QEMU/AArch64, for ARMv8. The machine supported is virt which is a QEMU 2.8 ARM virtual machine. The default CPU of qemu-system-aarch64 is Cortex-a15, so you need to specify a 64-bit cpu via a flag. To execute: $ qemu-system-aarch64 -M virt,secure=on,virtualization=on \ -cpu cortex-a53 -bios build/coreboot.rom -m 8192M -nographic Change-Id: Id7c0831b1ecf08785b4ec8139d809bad9b3e1eec Signed-off-by: Asami Doi Reviewed-on: https://review.coreboot.org/c/coreboot/+/33387 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel Reviewed-by: Julius Werner --- .../emulation/qemu-aarch64/bootblock_custom.S | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/mainboard/emulation/qemu-aarch64/bootblock_custom.S (limited to 'src/mainboard/emulation/qemu-aarch64/bootblock_custom.S') diff --git a/src/mainboard/emulation/qemu-aarch64/bootblock_custom.S b/src/mainboard/emulation/qemu-aarch64/bootblock_custom.S new file mode 100644 index 0000000000..f9e85d0efc --- /dev/null +++ b/src/mainboard/emulation/qemu-aarch64/bootblock_custom.S @@ -0,0 +1,36 @@ +/* + * Early initialization code for aarch64 (a.k.a. armv8) + * + * Copyright 2019 Asami Doi + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include + +ENTRY(_start) + /* Setup CPU. */ + bl arm64_init_cpu + + /* Get code positions. */ + ldr x1, =_flash + ldr x0, =_bootblock + + /* Calculate bootblock size. */ + ldr x2, =_ebootblock + sub x2, x2, x0 + + /* Call memcpy in arch/arm64/memcpy.S */ + bl memcpy + dmb sy + + /* Calculate relocation offset between bootblock in flash and in DRAM. */ + ldr x0, =_flash + ldr x1, =_bootblock + sub x1, x1, x0 + + /* Jump to main() in DRAM. */ + adr x0, main + add x0, x0, x1 + blr x0 +ENDPROC(_start) -- cgit v1.2.3