1PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" 2 3require conf/machine/include/qemu.inc 4require conf/machine/include/loongarch/tune-loongarch.inc 5 6MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" 7 8KERNEL_IMAGETYPE = "vmlinuz" 9KERNEL_IMAGETYPES += "vmlinuz" 10KEEPUIMAGE = "no" 11 12SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0" 13 14IMAGE_FSTYPES += "ext4 wic.qcow2" 15 16WKS_FILE ?= "qemuloongarch.wks" 17 18MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" 19 20#EXTRA_IMAGEDEPENDS += "opensbi" 21 22UBOOT_ENTRYPOINT_loongarch32 = "0x80400000" 23UBOOT_ENTRYPOINT_loongarch64 = "0x80200000" 24 25# qemuboot options 26QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi" 27QB_MACHINE = "-machine virt" 28QB_DEFAULT_BIOS = "fw_jump.elf" 29QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" 30QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" 31QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" 32QB_SERIAL_OPT = "-device virtio-serial-pci -chardev null,id=virtcon -device virtconsole,chardev=virtcon" 33QB_TCPSERIAL_OPT = " -device virtio-serial-pci -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1,nodelay=on -device virtconsole,chardev=virtcon" 34# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy 35QB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0" 36