1f3fd288eSBrad BishopPREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" 2f3fd288eSBrad Bishop 3f3fd288eSBrad Bishoprequire conf/machine/include/qemu.inc 4f3fd288eSBrad Bishoprequire conf/machine/include/riscv/tune-riscv.inc 5f3fd288eSBrad Bishop 6f3fd288eSBrad BishopMACHINE_FEATURES = "screen keyboard ext2 ext3 serial" 7f3fd288eSBrad Bishop 8f3fd288eSBrad BishopKERNEL_IMAGETYPE = "Image" 9f3fd288eSBrad BishopKERNEL_IMAGETYPES += "uImage" 10f3fd288eSBrad BishopKEEPUIMAGE = "no" 11f3fd288eSBrad Bishop 12f3fd288eSBrad BishopSERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0" 13f3fd288eSBrad Bishop 1479641f25SBrad BishopIMAGE_FSTYPES += "ext4 wic.qcow2" 1579641f25SBrad Bishop 1679641f25SBrad BishopWKS_FILE ?= "qemuriscv.wks" 17f3fd288eSBrad Bishop 18f3fd288eSBrad BishopMACHINE_EXTRA_RRECOMMENDS += " kernel-modules" 19f3fd288eSBrad Bishop 20f3fd288eSBrad BishopEXTRA_IMAGEDEPENDS += "opensbi" 21*475cb72dSAndrew GeisslerRISCV_SBI_PLAT ?= "generic" 22f3fd288eSBrad BishopRISCV_SBI_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin" 23f3fd288eSBrad Bishop 24f3fd288eSBrad BishopUBOOT_ENTRYPOINT_riscv32 = "0x80400000" 25f3fd288eSBrad BishopUBOOT_ENTRYPOINT_riscv64 = "0x80200000" 26f3fd288eSBrad Bishop 27f3fd288eSBrad Bishop# qemuboot options 28f3fd288eSBrad BishopQB_KERNEL_CMDLINE_APPEND = "earlycon=sbi" 29f3fd288eSBrad BishopQB_MACHINE = "-machine virt" 30c68388fcSBrad BishopQB_DEFAULT_BIOS = "fw_jump.elf" 31f3fd288eSBrad BishopQB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" 32f3fd288eSBrad BishopQB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" 33f3fd288eSBrad BishopQB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" 34f3fd288eSBrad BishopQB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" 35f3fd288eSBrad BishopQB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" 36f3fd288eSBrad Bishop# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy 37f3fd288eSBrad BishopQB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0" 38f3fd288eSBrad Bishop 39