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
14*79641f25SBrad BishopIMAGE_FSTYPES += "ext4 wic.qcow2"
15*79641f25SBrad Bishop
16*79641f25SBrad BishopWKS_FILE ?= "qemuriscv.wks"
17f3fd288eSBrad Bishop
18f3fd288eSBrad BishopMACHINE_EXTRA_RRECOMMENDS += " kernel-modules"
19f3fd288eSBrad Bishop
20f3fd288eSBrad BishopEXTRA_IMAGEDEPENDS += "opensbi"
21f3fd288eSBrad BishopRISCV_SBI_PLAT ?= "qemu/virt"
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
39f3fd288eSBrad BishopBAD_RECOMMENDATIONS += "\
40f3fd288eSBrad Bishop    libcxx-dev \
41f3fd288eSBrad Bishop    libcxx-staticdev \
42f3fd288eSBrad Bishop    compiler-rt-dev \
43f3fd288eSBrad Bishop    compiler-rt-staticdev \
44f3fd288eSBrad Bishop"
45f3fd288eSBrad Bishop
46f3fd288eSBrad BishopASSUME_PROVIDED += "\
47f3fd288eSBrad Bishop    libcxx-dev \
48f3fd288eSBrad Bishop    libcxx-staticdev \
49f3fd288eSBrad Bishop    compiler-rt-dev \
50f3fd288eSBrad Bishop    compiler-rt-staticdev \
51f3fd288eSBrad Bishop"
52