Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 1 | PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" |
| 2 | |
| 3 | require conf/machine/include/qemu.inc |
| 4 | require conf/machine/include/riscv/tune-riscv.inc |
| 5 | |
| 6 | MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" |
| 7 | |
| 8 | KERNEL_IMAGETYPE = "Image" |
| 9 | KERNEL_IMAGETYPES += "uImage" |
| 10 | KEEPUIMAGE = "no" |
| 11 | |
| 12 | SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0" |
| 13 | |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 14 | IMAGE_FSTYPES += "ext4 wic.qcow2" |
| 15 | |
| 16 | WKS_FILE ?= "qemuriscv.wks" |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 17 | |
| 18 | MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" |
| 19 | |
| 20 | EXTRA_IMAGEDEPENDS += "opensbi" |
| 21 | RISCV_SBI_PLAT ?= "qemu/virt" |
| 22 | RISCV_SBI_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin" |
| 23 | |
| 24 | UBOOT_ENTRYPOINT_riscv32 = "0x80400000" |
| 25 | UBOOT_ENTRYPOINT_riscv64 = "0x80200000" |
| 26 | |
| 27 | # qemuboot options |
| 28 | QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi" |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 29 | QB_MACHINE = "-machine virt" |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 30 | QB_DEFAULT_BIOS = "fw_jump.elf" |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 31 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" |
| 32 | QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" |
| 33 | QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" |
| 34 | QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" |
| 35 | QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" |
| 36 | # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy |
| 37 | QB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0" |
| 38 | |