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 --- Documentation/mainboard/emulation/qemu-aarch64.md | 47 +++++++++++++++++++++++ Documentation/mainboard/index.md | 1 + 2 files changed, 48 insertions(+) create mode 100644 Documentation/mainboard/emulation/qemu-aarch64.md (limited to 'Documentation') diff --git a/Documentation/mainboard/emulation/qemu-aarch64.md b/Documentation/mainboard/emulation/qemu-aarch64.md new file mode 100644 index 0000000000..ee4c9e7a3b --- /dev/null +++ b/Documentation/mainboard/emulation/qemu-aarch64.md @@ -0,0 +1,47 @@ +# QEMU AArch64 emulator +This page discribes how to build and run coreboot for QEMU/AArch64. +You can use LinuxBoot via `make menuconfig` or an arbitrary FIT image +as a payload for QEMU/AArch64. + +## Running coreboot in QEMU +```bash +qemu-system-aarch64 -bios ./build/coreboot.rom \ + -M virt,secure=on,virtualization=on -cpu cortex-a53 \ + -nographic -m 8912M +``` + +- The default CPU in QEMU for AArch64 is a cortex-a15 which is 32-bit +ARM CPU. You need to specify 64-bit ARM CPU via `-cpu cortex-a53`. +- The default privilege level in QEMU for AArch64 is EL1 that we can't +have the right to access EL3/EL2 registers. You need to enable EL3/EL2 +via `-machine secure=on,virtualization=on`. +- You need to specify the size of memory more than 544 MiB because 512 +MiB is reserved for the kernel. + +## Building coreboot with an arbitrary FIT payload +There are 3 steps to make coreboot.rom for QEMU/AArch64. If you select +LinuxBoot, step 2 and 3 have done by LinuxBoot. +1. Get a DTB (Device Tree Blob) +2. Build a FIT image with a DTB +3. Add a FIT image to coreboot.rom + +### 1. Get a DTB +You can get the DTB from QEMU with the following command. +``` +$ qemu-system-aarch64 \ + -M virt,dumpdtb=virt.dtb,secure=on,virtualization=on \ + -cpu cortex-a53 -nographic -m 2048M +``` + +### 2. Build a FIT image with a DTB +You need to write an image source file that has an `.its` extension to +configure kernels, ramdisks, and DTBs. +See [Flattened uImage Tree documentation](../../lib/payloads/fit.md) for more details. + +### 3. Add a FIT image to coreboot.rom +You can use cbfstool to add the payload you created in step 2 to +the coreboot.rom. +``` +$ ./build/cbfstool ./build/coreboot.rom add -f /uImage \ + -n fallback/payload -t fit -c lzma +``` diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md index 8c3f6eae12..0f3105f85b 100644 --- a/Documentation/mainboard/index.md +++ b/Documentation/mainboard/index.md @@ -24,6 +24,7 @@ The boards in this section are not real mainboards, but emulators. - [Spike RISC-V emulator](emulation/spike-riscv.md) - [Qemu RISC-V emulator](emulation/qemu-riscv.md) +- [Qemu AArch64 emulator](emulation/qemu-aarch64.md) ## Intel -- cgit v1.2.3