diff options
author | Grant Likely <grant.likely@arm.com> | 2020-08-13 11:24:29 +0100 |
---|---|---|
committer | Grant Likely <grant.likely@arm.com> | 2020-08-13 11:24:29 +0100 |
commit | 818010d9285ddeea9d372bda11c936aadf394889 (patch) | |
tree | 22308cce7c4101ebea3a73d6aac764ca13751f93 | |
parent | d01f29d678ce5237f314af03f41fe9f7dbf1d2bc (diff) |
Collect common QEMU arguments into common place
Use a single variable for the common QEMU arguments and document how to
run U-Boot in QEMU.
Signed-off-by: Grant Likely <grant.likely@arm.com>
-rw-r--r-- | board-qemu-arm.mk | 20 | ||||
-rw-r--r-- | top.mk | 11 |
2 files changed, 23 insertions, 8 deletions
diff --git a/board-qemu-arm.mk b/board-qemu-arm.mk index 46fe1ab..139b762 100644 --- a/board-qemu-arm.mk +++ b/board-qemu-arm.mk @@ -31,14 +31,18 @@ ifeq ($(CONFIG_OPTEE),y) endif cp $(UBOOT_OUTPUT)/u-boot.bin output/bl33.bin +# Core QEMU configuration. +QEMU_BASE_CONFIG += -machine virt,secure=on -cpu cortex-a57 +QEMU_BASE_CONFIG += -smp 2 -m 1024 -d unimp -monitor null -no-acpi +QEMU_BASE_CONFIG += -nographic +QEMU_BASE_CONFIG += -serial stdio # Non-secure; u-boot console +QEMU_BASE_CONFIG += -serial tcp::5000,server,nowait # Secure; optee +ifneq ($(VIRTDISK),) +QEMU_BASE_CONFIG += -drive if=virtio,format=raw,file=$(VIRTDISK) +endif + qemu-fip: - qemu-system-aarch64 -nographic -machine virt,secure=on -cpu cortex-a57 \ - -no-acpi -smp 2 -m 1024 -bios $(FLASH_IMAGE) -d unimp \ - -monitor null -serial stdio -serial tcp::5000,server,nowait + qemu-system-aarch64 $(QEMU_BASE_CONFIG) -bios $(FLASH_IMAGE) $(QEMU_EXTRA) qemu-semihosting: - cd output && qemu-system-aarch64 -nographic -machine virt,secure=on -cpu cortex-a57 \ - -no-acpi -smp 2 -m 1024 -bios bl1.bin -d unimp \ - -monitor null -serial stdio -serial tcp::5000,server,nowait \ - -semihosting-config enable,target=native - + cd output && qemu-system-aarch64 $(QEMU_BASE_CONFIG) -bios bl1.bin -semihosting-config enable,target=native $(QEMU_EXTRA) @@ -60,6 +60,17 @@ help: @echo ' devicetree/<name> - Build Devicetree target <name> *' @echo ' * Can only be called if U-Boot is configured' @echo '' + @echo 'Emulation targets (if available for given u-boot configuration:' + @echo '' + @echo ' qemu-fip: - Boot in QEMU using FIP image as -bios' + @echo ' qemu-semihosting: - Boot in QEMU with semihosting' + @echo '' + @echo ' QEMU configuration can be manipulated with environmental variables:' + @echo ' VIRTDISK Path to a raw disk image. Could be an ISO, or a GPT or MBR' + @echo ' partitioned disk image. The image will be passed to QEMU as a' + @echo ' virtio block device' + @echo ' QEMU_EXTRA List of extra command line options passed to QEMU' + @echo '' @echo 'Other targets:' @echo '' @echo ' help - This help text' |