coreboot-kgpe-d16/Documentation/mainboard/emulation/qemu-aarch64.md
Asami Doi f795242f26 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 <d0iasm.pub@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33387
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2019-08-08 01:12:06 +00:00

1.7 KiB

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

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 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 <path-to-a-payload>/uImage \
    -n fallback/payload -t fit -c lzma