Douglas Raillard | d7c21b7 | 2017-06-28 15:23:03 +0100 | [diff] [blame] | 1 | ARM Trusted Firmware for QEMU virt ARMv8-A |
| 2 | ========================================== |
| 3 | |
| 4 | ARM Trusted Firmware implements the EL3 firmware layer for QEMU virt |
| 5 | ARMv8-A. BL1 is used as the BootROM, supplied with the -bios argument. |
| 6 | When QEMU starts all CPUs are released simultaneously, BL1 selects a |
| 7 | primary CPU to handle the boot and the secondaries are placed in a polling |
| 8 | loop to be released by normal world via PSCI. |
| 9 | |
| 10 | BL2 edits the Flattened Device Tree, FDT, generated by QEMU at run-time to |
| 11 | add a node describing PSCI and also enable methods for the CPUs. |
| 12 | |
| 13 | An ARM64 defonfig v4.5 Linux kernel is known to boot, FTD doesn't need to be |
| 14 | provided as it's generated by QEMU. |
| 15 | |
| 16 | Current limitations: |
| 17 | |
| 18 | - Only cold boot is supported |
| 19 | - No build instructions for QEMU\_EFI.fd and rootfs-arm64.cpio.gz |
| 20 | - No instructions for how to load a BL32 (Secure Payload) |
| 21 | |
| 22 | ``QEMU_EFI.fd`` can be dowloaded from |
| 23 | http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/latest/QEMU-KERNEL-AARCH64/RELEASE_GCC49/QEMU_EFI.fd |
| 24 | |
| 25 | Boot binaries, except BL1, are primarily loaded via semi-hosting so all |
| 26 | binaries has to reside in the same directory as QEMU is started from. This |
| 27 | is conveniently achieved with symlinks the local names as: |
| 28 | |
| 29 | - ``bl2.bin`` -> BL2 |
| 30 | - ``bl31.bin`` -> BL31 |
| 31 | - ``bl33.bin`` -> BL33 (``QEMU_EFI.fd``) |
| 32 | - ``Image`` -> linux/Image |
| 33 | |
| 34 | To build: |
| 35 | |
| 36 | :: |
| 37 | |
| 38 | make CROSS_COMPILE=aarch64-none-elf- PLAT=qemu |
| 39 | |
| 40 | To start (QEMU v2.6.0): |
| 41 | |
| 42 | :: |
| 43 | |
| 44 | qemu-system-aarch64 -nographic -machine virt,secure=on -cpu cortex-a57 \ |
| 45 | -kernel Image \ |
| 46 | -append console=ttyAMA0,38400 keep_bootcon root=/dev/vda2 \ |
| 47 | -initrd rootfs-arm64.cpio.gz -smp 2 -m 1024 -bios bl1.bin \ |
| 48 | -d unimp -semihosting-config enable,target=native |