]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
yocto-bsp: runqemu runs beaglebone-yocto
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Thu, 18 Jul 2019 21:35:40 +0000 (23:35 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 19 Jul 2019 15:21:16 +0000 (16:21 +0100)
Append the necessary QB_ flags to the MACHINE configuration of
beaglebone-yocto. Using Qemu with "-machine virt" simplifies things
greatly because for this machine the dtb is compiled into qemu. Since
the beaglebone-yocto kernel config also supports this cpu architecture,
it just works. However, u-boot is not involved and the virt machine is
not 100% equal to a am335x SoC.

A MACHINE configuration suitable for Qemu as well as for the real
hardware allows to provide just one eSDK where both runqemu and devtool
build-image work. Otherwise a qemuarm and a beaglebord-yocto MACHINE
eSDK would be required to support development in Qemu as well as on real
hardware.

(From meta-yocto rev: 48bf40749cc63e8e951c76abbe65b1b9620b2481)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta-yocto-bsp/conf/machine/beaglebone-yocto.conf

index 35814cd8f1aef8f508411c056d2df4b2f74afe41..7c7b3059a9f6e997a3e1f7d7dcf4597771fd39fa 100644 (file)
@@ -20,7 +20,7 @@ WKS_FILE ?= "beaglebone-yocto.wks"
 IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
 do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot u-boot:do_deploy"
 
-SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyO0"
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyO0 115200;ttyAMA0"
 SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
@@ -39,3 +39,21 @@ UBOOT_LOADADDRESS = "0x80008000"
 MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
 
 IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO zImage am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
+
+# support runqemu
+EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
+IMAGE_CLASSES += "qemuboot"
+QB_DEFAULT_FSTYPE = "wic"
+QB_FSINFO = "wic:no-kernel-in-fs"
+QB_KERNEL_ROOT = "/dev/vda2"
+QB_SYSTEM_NAME = "qemu-system-arm"
+QB_MEM = "-m 512"
+QB_MACHINE = "-machine virt"
+QB_CPU = "-cpu cortex-a15"
+QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0 systemd.mask=systemd-networkd"
+QB_OPT_APPEND = "-device virtio-rng-device"
+QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
+QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
+QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
+QB_SERIAL_OPT = ""
+QB_TCPSERIAL_OPT = "-device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"