1*864cc43bSPatrick WilliamsPREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
2*864cc43bSPatrick Williams
3*864cc43bSPatrick Williamsrequire conf/machine/include/qemu.inc
4*864cc43bSPatrick Williamsrequire conf/machine/include/loongarch/tune-loongarch.inc
5*864cc43bSPatrick Williams
6*864cc43bSPatrick WilliamsMACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
7*864cc43bSPatrick Williams
8*864cc43bSPatrick WilliamsKERNEL_IMAGETYPE = "vmlinuz"
9*864cc43bSPatrick WilliamsKERNEL_IMAGETYPES += "vmlinuz"
10*864cc43bSPatrick WilliamsKEEPUIMAGE = "no"
11*864cc43bSPatrick Williams
12*864cc43bSPatrick WilliamsSERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0"
13*864cc43bSPatrick Williams
14*864cc43bSPatrick WilliamsIMAGE_FSTYPES += "ext4 wic.qcow2"
15*864cc43bSPatrick Williams
16*864cc43bSPatrick WilliamsWKS_FILE ?= "qemuloongarch.wks"
17*864cc43bSPatrick Williams
18*864cc43bSPatrick WilliamsMACHINE_EXTRA_RRECOMMENDS += " kernel-modules"
19*864cc43bSPatrick Williams
20*864cc43bSPatrick Williams#EXTRA_IMAGEDEPENDS += "opensbi"
21*864cc43bSPatrick Williams
22*864cc43bSPatrick WilliamsUBOOT_ENTRYPOINT_loongarch32 = "0x80400000"
23*864cc43bSPatrick WilliamsUBOOT_ENTRYPOINT_loongarch64 = "0x80200000"
24*864cc43bSPatrick Williams
25*864cc43bSPatrick Williams# qemuboot options
26*864cc43bSPatrick WilliamsQB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
27*864cc43bSPatrick WilliamsQB_MACHINE = "-machine virt"
28*864cc43bSPatrick WilliamsQB_DEFAULT_BIOS = "fw_jump.elf"
29*864cc43bSPatrick WilliamsQB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
30*864cc43bSPatrick WilliamsQB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
31*864cc43bSPatrick WilliamsQB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
32*864cc43bSPatrick WilliamsQB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
33*864cc43bSPatrick WilliamsQB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
34*864cc43bSPatrick Williams# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
35*864cc43bSPatrick WilliamsQB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0"
36