[RFC PATCH openbmc v3 2/8] runqemu: Add palmetto target

Patrick Williams patrick at stwcx.xyz
Tue May 17 06:17:29 AEST 2016


We need to find a way to do this without adding new machines to
scripts/runqemu each time.

On Wed, Mar 23, 2016 at 06:33:29PM +1030, Andrew Jeffery wrote:
> Example use:
> 
>     $ bitbake obmc-phosphor-image
>     $ runqemu palmetto slirp
> 
> Specifying slirp avoids needing root to configure network, which won't
> work (yet). The palmetto-bmc machine currently only models the VIC and
> timers from the AST2400, and adds a 8250 UART for a console, so there's
> not much interesting to play with in terms of hardware support. But, we
> can now boot the one kernel both on the hardware and in QEMU.
> 
> Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
> ---
>  .../meta-ibm/meta-palmetto/conf/conf-notes.txt               |  3 +++
>  yocto-poky/scripts/runqemu                                   |  9 ++++++---
>  yocto-poky/scripts/runqemu-internal                          | 12 ++++++++++++
>  3 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/conf-notes.txt b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/conf-notes.txt
> index 9b3c01a..24bfffe 100644
> --- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/conf-notes.txt
> +++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf/conf-notes.txt
> @@ -1,2 +1,5 @@
>  Common targets are:
>       obmc-phosphor-image
> +
> +You can also run generated images with qemu:
> +     runqemu palmetto
> diff --git a/yocto-poky/scripts/runqemu b/yocto-poky/scripts/runqemu
> index 23cf5be..f09da50 100755
> --- a/yocto-poky/scripts/runqemu
> +++ b/yocto-poky/scripts/runqemu
> @@ -110,7 +110,7 @@ while true; do
>      arg=${1}
>      case "$arg" in
>          "qemux86" | "qemux86-64" | "qemuarm" | "qemuarm64" | "qemumips" | "qemumipsel" | \
> -        "qemumips64" | "qemush4"  | "qemuppc" | "qemumicroblaze" | "qemuzynq")
> +        "qemumips64" | "qemush4"  | "qemuppc" | "qemumicroblaze" | "qemuzynq" | "palmetto")
>              [ -z "$MACHINE" ] && MACHINE=$arg || \
>                  error "conflicting MACHINE types [$MACHINE] and [$arg]"
>              ;;
> @@ -236,13 +236,13 @@ fi
>  
>  if [ -z "$MACHINE" ]; then
>      if [ "x$FSTYPE" = "xvmdk" ] || [ "x$FSTYPE" = "xhddimg" ] || [ "x$FSTYPE" = "xhdddirect" ]; then
> -        MACHINE=`basename $VM | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'`
> +        MACHINE=`basename $VM | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4|palmetto\).*/\1/p'`
>          if [ -z "$MACHINE" ]; then
>              error "Unable to set MACHINE from image filename [$VM]"
>          fi
>          echo "Set MACHINE to [$MACHINE] based on image [$VM]"
>      else
> -        MACHINE=`basename $KERNEL | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'`
> +        MACHINE=`basename $KERNEL | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4|palmetto\).*/\1/p'`
>          if [ -z "$MACHINE" ]; then
>              error "Unable to set MACHINE from kernel filename [$KERNEL]"
>          fi
> @@ -332,6 +332,9 @@ QEMUMICROBLAZE_DEFAULT_FSTYPE=cpio
>  QEMUZYNQ_DEFAULT_KERNEL=uImage
>  QEMUZYNQ_DEFAULT_FSTYPE=cpio
>  
> +PALMETTO_DEFAULT_KERNEL=cuImage
> +PALMETTO_DEFAULT_FSTYPE=cpio.gz
> +
>  AKITA_DEFAULT_KERNEL=zImage-akita.bin
>  AKITA_DEFAULT_FSTYPE=jffs2
>  
> diff --git a/yocto-poky/scripts/runqemu-internal b/yocto-poky/scripts/runqemu-internal
> index 1527268..479d61c 100755
> --- a/yocto-poky/scripts/runqemu-internal
> +++ b/yocto-poky/scripts/runqemu-internal
> @@ -53,6 +53,9 @@ else
>          "qemuarm64")
>              mem_size=512
>              ;;
> +        "palmetto")
> +            mem_size=512
> +            ;;
>          "qemumicroblaze")
>              mem_size=64
>              ;;
> @@ -295,6 +298,7 @@ fi
>  
>  case "$MACHINE" in
>      "qemuarm") ;;
> +    "palmetto") ;;
>      "qemuarm64") ;;
>      "qemumicroblaze") ;;
>      "qemumips") ;;
> @@ -384,6 +388,14 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm
>      fi
>  fi
>  
> +if [ "$MACHINE" = "palmetto" ]; then
> +    QEMU=qemu-system-arm
> +    MACHINE_SUBTYPE=palmetto-bmc
> +    export QEMU_AUDIO_DRV="none"
> +    KERNCMDLINE="console=ttyS4"
> +    QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} -initrd $ROOTFS -no-reboot -nographic"
> +fi
> +
>  if [ "$MACHINE" = "qemuarm64" ]; then
>      QEMU=qemu-system-aarch64
>  
> -- 
> 2.5.0
> 
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20160516/1eb40159/attachment.sig>


More information about the openbmc mailing list