From ad83eb1ee6bb833783c4b870c86413978fb5d4ba Mon Sep 17 00:00:00 2001 From: David Milosevic Date: Thu, 16 Nov 2023 05:11:18 +0100 Subject: mainboard/emulation/qemu-sbsa: Add qemu-sbsa board Add coreboot support for qemu's sbsa-ref (Server Base System Architecture) machine (-m sbsa-ref). The qemu-sbsa coreboot port runs on EL2 and is the payload of the EL3 firmware (Arm Trusted Firmware). Note that, coreboot expects a pointer to the FDT in x0. Make sure to configure TF-A to handoff the FDT pointer. Example qemu commandline: qemu-system-aarch64 -nographic -m 2048 -M sbsa-ref \ -pflash \ -pflash The Documentation can be found here: Documentation/mainboard/emulation/qemu-sbsa.md Change-Id: Iacc9aaf065e0d153336cbef9a9b5b46a9eb24a53 Signed-off-by: David Milosevic Reviewed-on: https://review.coreboot.org/c/coreboot/+/79086 Tested-by: build bot (Jenkins) Reviewed-by: Lean Sheng Tan --- Documentation/mainboard/emulation/qemu-sbsa.md | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/mainboard/emulation/qemu-sbsa.md (limited to 'Documentation/mainboard/emulation') diff --git a/Documentation/mainboard/emulation/qemu-sbsa.md b/Documentation/mainboard/emulation/qemu-sbsa.md new file mode 100644 index 000000000000..abbd1895a51f --- /dev/null +++ b/Documentation/mainboard/emulation/qemu-sbsa.md @@ -0,0 +1,42 @@ +# QEMU SBSA emulator +This page describes how to build and run ```coreboot``` for QEMU's sbsa-ref machine. +The qemu-sbsa ```coreboot``` image acts as BL-3.3 for Arm Trusted Firmware (```TF-A```) and +mainly takes care of setting up SMBIOS and ACPI tables, hence, in order to boot, +you also need to supply a ```TF-A``` image. + +## Building TF-A + +You can build ```TF-A``` from source by fetching +``` +https://github.com/ARM-software/arm-trusted-firmware +``` +and building the qemu-sbsa platform +``` +PLAT=qemu_sbsa +``` +Upon entry, ```coreboot``` expects a FDT pointer in x0, so make sure to compile ```TF-A``` with +``` +ARM_LINUX_KERNEL_AS_BL33=1 +``` +This will force ```TF-A``` to pass a pointer to the FDT in x0. + +## Building coreboot + +Simply select the qemu-sbsa board and, optionally, configure a payload. We recommend +the ```leanefi``` payload. ```leanefi``` will setup a minimal set of UEFI services, just enough +to boot into a linux kernel. + +## Running coreboot in QEMU + +Once you have obtained ```TF-A``` and ```coreboot``` images, launch qemu via + +```bash +qemu-system-aarch64 -nographic -m 1024 -M sbsa-ref -pflash \ + -pflash +``` + +## LBBR bootflow + +arm and 9elements worked together in order to create a LBBR compliant bootflow +consisting of ```TF-A```, ```coreboot```, ```leanefi``` and ```LinuxBoot```. A proof of concept +can be found here https://gitlab.arm.com/systemready/firmware-build/linuxboot/lbbr-coreboot-poc -- cgit v1.2.3