[linux-yocto] [kernel-cache][PATCHv2 1/1] bsp/beaglebone: support qemu -machine virt

2019-06-16 Thread Adrian Freihofer
Purpose: Support booting a beaglebone image with runqemu.

If the kernel supports Qemu's virt machine, runqemu works almost for free.
The device tree for machine virt is included in Qemu, which simplifies
everything quite a bit.
This change adds ARCH_VIRT=y and some drivers to the beaglebone kernel
configuration which allows to:

  export MACHINE="beaglebone-yocto"
  bitbake core-image-minimale
  runqemu

This also works out of an eSDK. Whithout this feature usually two different
SDKs need to be compiled and maintained. One SDK is used for development
in Qemu, another one is used to develop for the real target hardware.

[Yocto #13384]

Signed-off-by: Adrian Freihofer 
---
 bsp/beaglebone/beaglebone.scc | 5 +
 bsp/beaglebone/qemu-bb.cfg| 9 +
 bsp/beaglebone/qemu-bb.scc| 1 +
 3 files changed, 15 insertions(+)
 create mode 100644 bsp/beaglebone/qemu-bb.cfg
 create mode 100644 bsp/beaglebone/qemu-bb.scc

diff --git a/bsp/beaglebone/beaglebone.scc b/bsp/beaglebone/beaglebone.scc
index 4b15ec06..2a5e67b1 100644
--- a/bsp/beaglebone/beaglebone.scc
+++ b/bsp/beaglebone/beaglebone.scc
@@ -5,3 +5,8 @@ include features/usb-net/usb-net.scc
 include features/input/input.scc
 include cfg/usb-mass-storage.scc
 include wifi.scc
+
+# With these addons, runqemu just works (-machine virt)
+# The size of the zImage is increased by 168k for kernel 5.0.
+include cfg/virtio.scc
+include qemu-bb.scc
diff --git a/bsp/beaglebone/qemu-bb.cfg b/bsp/beaglebone/qemu-bb.cfg
new file mode 100644
index ..28b3d4ec
--- /dev/null
+++ b/bsp/beaglebone/qemu-bb.cfg
@@ -0,0 +1,9 @@
+CONFIG_ARCH_VIRT=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SPI=y
+CONFIG_SPI_PL022=y
+CONFIG_ARM_SP805_WATCHDOG=y
+CONFIG_RTC_DRV_PL031=y
+CONFIG_PL330_DMA=y
+CONFIG_ARM_TIMER_SP804=y
diff --git a/bsp/beaglebone/qemu-bb.scc b/bsp/beaglebone/qemu-bb.scc
new file mode 100644
index ..8bbcae8d
--- /dev/null
+++ b/bsp/beaglebone/qemu-bb.scc
@@ -0,0 +1 @@
+kconf hardware qemu-bb.cfg
-- 
2.11.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache][PATCHv2 0/1] qemu support for ARM devices

2019-06-16 Thread Adrian Freihofer
Hi, Bruce,

Compared to v1, this is more or less a rewrite. It is now very similar to the 
qemuarma15 BSP as suggested by you.

The qemuarm15 BSP generates a kernel of 7046128 bytes.
The current Beaglebone yocto configuration produces a kernel of 6451976 bytes.

In addition to the configuration flags already set in the Beaglebone 
configuration, the qemuarm15 configuration includes cfg/virtio.scc and 
qemuarma15.scc. The virtio.scc is well suited for both. The qemuarma15.scc is 
too heavy for the Beaglebone, mainly due to SMP and NEON.

The kernel configuration with this patch results in a Beaglebone kernel with a 
size of 6623704 bytes, which is a plus of ~170k. But this makes it possible to 
start the Beaglebone images in Qemu with graphics.

Adrian Freihofer (1):
  bsp/beaglebone: support qemu -machine virt

 bsp/beaglebone/beaglebone.scc | 5 +
 bsp/beaglebone/qemu-bb.cfg| 9 +
 bsp/beaglebone/qemu-bb.scc| 1 +
 3 files changed, 15 insertions(+)
 create mode 100644 bsp/beaglebone/qemu-bb.cfg
 create mode 100644 bsp/beaglebone/qemu-bb.scc

-- 
2.11.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache][PATCH 0/2] qemu support for ARM devices

2019-06-09 Thread Adrian Freihofer
The purpose/idea is documented here:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13384

Adrian Freihofer (2):
  features: add qemu-guest
  bsp/beaglebone: include qemu-guest feature

 bsp/beaglebone/beaglebone.scc |  1 +
 features/qemu-guest/qemu-arm-virt.cfg | 10 ++
 features/qemu-guest/qemu-arm-virt.scc |  4 
 3 files changed, 15 insertions(+)
 create mode 100644 features/qemu-guest/qemu-arm-virt.cfg
 create mode 100644 features/qemu-guest/qemu-arm-virt.scc

-- 
2.11.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache][PATCH 1/2] features: add qemu-guest

2019-06-09 Thread Adrian Freihofer
Purpose: Provide an easy way to add ARCH_VIRT=y to the kernel configuration.
This allows to boot ARM images compiled for real hardware in Qemu as well.
Including this feature e.g. into the Beaglebone BSP allows to:

  export MACHINE="beaglebone-yocto"
  bitbake core-image-minimale
  runqemu

This also works with the eSDK. Whithout this feature usually two different
SDKs need to be compiled and maintained. One SDK is used for development
in Qemu, another one is used to develop for the real target hardware.

Note: For newer aarch64 devices a pci variant of this config snipped
  might be beneficial.

[Yocto #13384]

Signed-off-by: Adrian Freihofer 
---
 features/qemu-guest/qemu-arm-virt.cfg | 10 ++
 features/qemu-guest/qemu-arm-virt.scc |  4 
 2 files changed, 14 insertions(+)
 create mode 100644 features/qemu-guest/qemu-arm-virt.cfg
 create mode 100644 features/qemu-guest/qemu-arm-virt.scc

diff --git a/features/qemu-guest/qemu-arm-virt.cfg 
b/features/qemu-guest/qemu-arm-virt.cfg
new file mode 100644
index ..7aec61de
--- /dev/null
+++ b/features/qemu-guest/qemu-arm-virt.cfg
@@ -0,0 +1,10 @@
+CONFIG_ARCH_VIRT=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_VIRTIO_BLK_SCSI=y
+CONFIG_VIRTIO_NET=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_VIRTIO=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
diff --git a/features/qemu-guest/qemu-arm-virt.scc 
b/features/qemu-guest/qemu-arm-virt.scc
new file mode 100644
index ..54682dcf
--- /dev/null
+++ b/features/qemu-guest/qemu-arm-virt.scc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable options for ARM images in Qemu"
+define KFEATURE_COMPATIBILITY board
+
+kconf hardware qemu-arm-virt.cfg
-- 
2.11.0

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto