1# QEMU SBSA emulator 2This page describes how to build and run ```coreboot``` for QEMU's sbsa-ref machine. 3The qemu-sbsa ```coreboot``` image acts as BL-3.3 for Arm Trusted Firmware (```TF-A```) and 4mainly takes care of setting up SMBIOS and ACPI tables, hence, in order to boot, 5you also need to supply a ```TF-A``` image. 6 7## Building TF-A 8 9You can build ```TF-A``` from source by fetching 10``` 11https://github.com/ARM-software/arm-trusted-firmware 12``` 13and building the qemu-sbsa platform 14``` 15PLAT=qemu_sbsa 16``` 17Upon entry, ```coreboot``` expects a FDT pointer in x0, so make sure to compile ```TF-A``` with 18``` 19ARM_LINUX_KERNEL_AS_BL33=1 20``` 21This will force ```TF-A``` to pass a pointer to the FDT in x0. 22 23## Building coreboot 24 25Simply select the qemu-sbsa board and, optionally, configure a payload. We recommend 26the ```leanefi``` payload. ```leanefi``` will setup a minimal set of UEFI services, just enough 27to boot into a linux kernel. 28 29## Running coreboot in QEMU 30 31Once you have obtained ```TF-A``` and ```coreboot``` images, launch qemu via 32 33```bash 34qemu-system-aarch64 -nographic -m 1024 -M sbsa-ref -pflash <path/to/TFA.fd> \ 35 -pflash <path/to/coreboot.rom> 36``` 37 38## LBBR bootflow 39 40arm and 9elements worked together in order to create a LBBR compliant bootflow 41consisting of ```TF-A```, ```coreboot```, ```leanefi``` and ```LinuxBoot```. A proof of concept 42can be found here https://gitlab.arm.com/systemready/firmware-build/linuxboot/lbbr-coreboot-poc 43