[meta-xilinx] [PATCH 17/29] machine-xilinx-qemu.inc: Move common runqemu setup to include

Alistair Francis alistair23 at gmail.com
Wed Sep 28 14:50:20 PDT 2016


On Wed, Sep 28, 2016 at 8:15 AM, Nathan Rossi <nathan at nathanrossi.com> wrote:
> Move the common setup for QEMU machines into an include call
> 'machine-xilinx-qemu.inc'. This include is added to any machine that has
> a QEMU model. It sets up common QB_* values as well as inheriting the
> qemuboot class and adding the EXTRA_IMAGEDEPENDS on qemu-native.
>
> This include also has helper functions to automatically determine the
> DTB from KERNEL_DEVICETREE/MACHINE_DEVICETREE and automatically setup the
> 'console=' kernel command line based on SERIAL_CONSOLE.
>
> Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>

Awesome! Ignore my other comments about an include file then.

This one only gets an Ack as I don't know Python well enough to give
it a review. Looks good though.

Acked-by: Alistair Francis <alistair.francis at xilinx.com>

> ---
>  conf/machine/ep108-zynqmp.conf               | 11 ++-------
>  conf/machine/include/machine-xilinx-qemu.inc | 34 ++++++++++++++++++++++++++++
>  conf/machine/qemumicroblaze-s3adsp1800.conf  |  9 ++------
>  conf/machine/qemumicroblaze.conf             |  9 ++------
>  conf/machine/qemuzynq.conf                   | 10 ++------
>  conf/machine/zcu102-zynqmp.conf              | 11 ++-------
>  6 files changed, 44 insertions(+), 40 deletions(-)
>  create mode 100644 conf/machine/include/machine-xilinx-qemu.inc
>
> diff --git a/conf/machine/ep108-zynqmp.conf b/conf/machine/ep108-zynqmp.conf
> index 16e208c461..4e2c1b0363 100644
> --- a/conf/machine/ep108-zynqmp.conf
> +++ b/conf/machine/ep108-zynqmp.conf
> @@ -5,12 +5,10 @@
>  require conf/machine/include/tune-zynqmp.inc
>  require conf/machine/include/machine-xilinx-default.inc
>  require conf/machine/include/machine-xilinx-board.inc
> +require conf/machine/include/machine-xilinx-qemu.inc
>
>  MACHINE_FEATURES = ""
>
> -# This machine has a qemu machine model
> -EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
> -
>  SERIAL_CONSOLE = "115200 ttyPS0"
>
>  KERNEL_DEVICETREE = "xilinx/zynqmp-ep108.dtb"
> @@ -21,16 +19,11 @@ UBOOT_ENTRYPOINT = "0x80000"
>
>  EXTRA_IMAGEDEPENDS += "arm-trusted-firmware"
>
> -# For runqemu
> -IMAGE_CLASSES += "qemuboot"
> -QB_SYSTEM_NAME = "qemu-system-aarch64"
> +# This machine has a QEMU model, runqemu setup:
>  QB_MACHINE = "-machine xlnx-ep108"
>  QB_CPU = "-cpu cortex-a57"
>  QB_MEM = "-m 2048"
> -QB_DTB = "${KERNEL_IMAGETYPE}-${@os.path.splitext(os.path.basename(d.getVar("KERNEL_DEVICETREE",True)))[0]}.dtb"
>  QB_OPT_APPEND = "-nographic -serial mon:stdio -serial null"
> -QB_DEFAULT_FSTYPE = "cpio"
> -QB_KERNEL_CMDLINE_APPEND = "console=ttyPS0"
>  QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -net nic,netdev=net0,macaddr=@MAC@"
>  QB_SLIRP_OPT = "-netdev user,id=net0 -net nic,netdev=net0"
>
> diff --git a/conf/machine/include/machine-xilinx-qemu.inc b/conf/machine/include/machine-xilinx-qemu.inc
> new file mode 100644
> index 0000000000..f717f461c9
> --- /dev/null
> +++ b/conf/machine/include/machine-xilinx-qemu.inc
> @@ -0,0 +1,34 @@
> +

Why a newline at the top of the file?

Thanks,

Alistair

> +EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
> +
> +def qemu_default_dtb(d):
> +       if d.getVar("MACHINE_DEVICETREE", True):



More information about the meta-xilinx mailing list