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