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
6ac13d5f3SPatrick WilliamsMACHINE_FEATURES += "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"
21475cb72dSAndrew GeisslerRISCV_SBI_PLAT ?= "generic"
22f3fd288eSBrad BishopRISCV_SBI_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin"
23f3fd288eSBrad Bishop
24213cb269SPatrick WilliamsUBOOT_ENTRYPOINT:riscv32 = "0x80400000"
25213cb269SPatrick WilliamsUBOOT_ENTRYPOINT:riscv64 = "0x80200000"
26f3fd288eSBrad Bishop
27f3fd288eSBrad Bishop# qemuboot options
286aa7eec5SAndrew GeisslerQB_SMP ?= "-smp 4"
29f3fd288eSBrad BishopQB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
30f3fd288eSBrad BishopQB_MACHINE = "-machine virt"
31c68388fcSBrad BishopQB_DEFAULT_BIOS = "fw_jump.elf"
32f3fd288eSBrad BishopQB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
33f3fd288eSBrad BishopQB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
34f3fd288eSBrad BishopQB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
35f3fd288eSBrad BishopQB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
3620137395SAndrew GeisslerQB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1,nodelay=on -device virtconsole,chardev=virtcon"
373b8a17c1SAndrew GeisslerQB_GRAPHICS = "-device bochs-display"
38*03514f19SPatrick WilliamsQB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd"
39*03514f19SPatrick WilliamsQB_OPT_APPEND:riscv32 = "-device virtio-tablet-pci -device virtio-keyboard-pci"
40