Patchwork QEMU with ARM Cortex A9 with hard float configuration - Kernel panic

login
register
mail settings
Submitter Elvis Dowson
Date Aug. 26, 2013, 7:35 p.m.
Message ID <2D33FB6A-9F7F-4E8E-8B1A-CED1D571A82C@gmail.com>
Download mbox | patch
Permalink /patch/56653/
State New
Headers show

Comments

Elvis Dowson - Aug. 26, 2013, 7:35 p.m.
Hi Bruce,

On Aug 26, 2013, at 11:08 PM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:

> Are you interested in something from scratch, versus something that
> isn't already partially in the tree (like qemuarma9) ?
> 
> We've got a few docs and tutorials, but I can also help step you through
> the process to assist the existing material.

I'd like to adapt the existing linux-yocto standard/base branch, and build up on existing qemuarma9 support. I've included detailed patch fragments below, so that you can replicate the current state of my work at your end.

I've performed the following steps till date, but unfortunately get a qemu ram / rom out of memory address error after doing all this. Must be because of an incorrectly mapped KMACHINE. The vexpress device doesn't support PCI, IDE or SCSI, only microsd card or ram devices, so the boot method should use an initrd file, for the root filesystem, as described here.

https://wiki.linaro.org/PeterMaydell/QemuVersatileExpress

Step 01.00: Clone linux-yocto-3.8 locally, create local meta branch, create local standard/qemuarma9 branch, tracking the master branch.

Make the following modification to the qemuarma9-standard.scc file.

From 8e9b465f242941b70d7b61045c073e82700fcd91 Mon Sep 17 00:00:00 2001
From: Elvis Dowson <elvis.dowson@gmail.com>
Date: Mon, 26 Aug 2013 22:18:24 +0400
Subject: [PATCH] qemuarma9: Update branch to qemuarma9.

Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
---
 meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Bruce Ashfield - Aug. 27, 2013, 8:03 p.m.
On 13-08-26 03:35 PM, Elvis Dowson wrote:
> Hi Bruce,
>
> On Aug 26, 2013, at 11:08 PM, Bruce Ashfield
> <bruce.ashfield@windriver.com <mailto:bruce.ashfield@windriver.com>> wrote:
>
>> Are you interested in something from scratch, versus something that
>> isn't already partially in the tree (like qemuarma9) ?
>>
>> We've got a few docs and tutorials, but I can also help step you through
>> the process to assist the existing material.
>
> I'd like to adapt the existing linux-yocto standard/base branch, and
> build up on existing qemuarma9 support. I've included detailed patch
> fragments below, so that you can replicate the current state of my work
> at your end.

Not ignoring this, I've just been tied up with 3.10 kernel work. I'll
get back to this shortly.

Cheers,

Bruce

>
> I've performed the following steps till date, but unfortunately get a
> qemu ram / rom out of memory address error after doing all this. Must be
> because of an incorrectly mapped KMACHINE. The vexpress device doesn't
> support PCI, IDE or SCSI, only microsd card or ram devices, so the boot
> method should use an initrd file, for the root filesystem, as described
> here.
>
> https://wiki.linaro.org/PeterMaydell/QemuVersatileExpress
>
> *_Step 01.00: Clone linux-yocto-3.8 locally, create local meta branch,
> create local standard/qemuarma9 branch, tracking the master branch._*
>
> Make the following modification to the qemuarma9-standard.scc file.
>
>  From 8e9b465f242941b70d7b61045c073e82700fcd91 Mon Sep 17 00:00:00 2001
> From: Elvis Dowson <elvis.dowson@gmail.com <mailto:elvis.dowson@gmail.com>>
> Date: Mon, 26 Aug 2013 22:18:24 +0400
> Subject: [PATCH] qemuarma9: Update branch to qemuarma9.
>
> Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com
> <mailto:elvis.dowson@gmail.com>>
> ---
>   meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
> b/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
> index c71fe1c..729125d 100644
> --- a/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
> +++ b/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
> @@ -3,7 +3,7 @@ define KTYPE standard
>   define KARCH arm
>
>   include ktypes/standard/standard.scc
> -branch arm-versatile-926ejs
> +branch qemuarma9
>
>   include qemuarma9.scc
>
> --
> 1.7.10.4
>
>
> *_Step 02.00: Create a new qemuarma9.conf machine definition._*
>
> There is a dts file in arch/arm/boot/dts called vexpress-v2p-ca9.dts.
>
> Q01: I guess the KMACHINE_qemuarma9 should be set to "vex press" ?
> instead of qemuarma9 below?
>
> #@TYPE: Machine
> #@NAME: qemuarma9
> #@DESCRIPTION: Machine configuration for QEMU ARM Cortex A9.
>
> # Specify the default tune.
> DEFAULTTUNE = "armv7a-neon"
>
> require conf/machine/include/qemu.inc
> require conf/machine/include/tune-cortexa9.inc
>
> # Specify the preferred kernel recipe version.
> PREFERRED_VERSION_linux-yocto ?= "3.8%"
>
> # Specify the machine name used by the kernel.
> KMACHINE_qemuarma9 = "qemuarma9" # Error?!!
>
> # Specify the kernel image type.
> KERNEL_IMAGETYPE = "uImage"
>
> MACHINE_DEVICETREE := "qemuarma9.dts"
>
> # Specify the serial console parameters.
> SERIAL_CONSOLE = "115200 ttyAMA0"
>
>
> *_Step 03.00: Patch the oe-core sources._*
>
> *Step 03.01: *Patch scripts/runqemu
>
> @@ -37,10 +37,11 @@ usage() {
>       echo "  qemuparams=\"xyz\" - specify custom parameters to QEMU"
>       echo "  bootparams=\"xyz\" - specify custom kernel parameters
> during boot"
>       echo ""
>       echo "Examples:"
>       echo "  $MYNAME qemuarm"
> +    echo "  $MYNAME qemuarma9 ramfs"
>       echo "  $MYNAME qemux86-64 core-image-sato ext3"
>       echo "  $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/
> serial"
>       echo "  $MYNAME qemux86 ramfs"
>       echo "  $MYNAME qemux86 iso"
>       echo "  $MYNAME qemux86 qemuparams=\"-m 256\""
> @@ -105,11 +106,11 @@ process_filename() {
>   # bit more complex, but offers a great user experience.
>   KVM_ENABLED="no"
>   while true; do
>       arg=${1}
>       case "$arg" in
> -        "qemux86" | "qemux86-64" | "qemuarm" | "qemumips" |
> "qemumipsel" | \
> +        "qemux86" | "qemux86-64" | "qemuarm" | "qemuarma9" |"qemumips"
> | "qemumipsel" | \
>           "qemumips64" | "qemush4"  | "qemuppc" | "qemumicroblaze" |
> "qemuzynq")
>               [ -z "$MACHINE" ] && MACHINE=$arg || \
>                   error "conflicting MACHINE types [$MACHINE] and [$arg]"
>               ;;
>           "ext2" | "ext3" | "ext4" | "jffs2" | "nfs" | "btrfs")
> @@ -222,17 +223,17 @@ if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
>       error "NFS booting without an explicit ROOTFS path is not yet
> supported"
>   fi
>   if [ -z "$MACHINE" ]; then
>       if [ "x$FSTYPE" = "xvmdk" ]; then
> -        MACHINE=`basename $VM | sed
> 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> +        MACHINE=`basename $VM | sed
> 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemuarma9\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
>           if [ -z "$MACHINE" ]; then
>               error "Unable to set MACHINE from vmdk filename [$VM]"
>           fi
>           echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]"
>       else
> -        MACHINE=`basename $KERNEL | sed
> 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> +        MACHINE=`basename $KERNEL | sed
> 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemuarma9\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
>           if [ -z "$MACHINE" ]; then
>               error "Unable to set MACHINE from kernel filename [$KERNEL]"
>           fi
>           echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
>       fi
> @@ -292,10 +293,13 @@ QEMUX86_64_DEFAULT_KERNEL=bzImage-qemux86-64.bin
>   QEMUX86_64_DEFAULT_FSTYPE=ext3
>   QEMUARM_DEFAULT_KERNEL=zImage-qemuarm.bin
>   QEMUARM_DEFAULT_FSTYPE=ext3
> +QEMUARMA9_DEFAULT_KERNEL=uImage
> +QEMUARMA9_DEFAULT_FSTYPE=cpio.gz
> +
>   QEMUMIPS_DEFAULT_KERNEL=vmlinux-qemumips.bin
>   QEMUMIPS_DEFAULT_FSTYPE=ext3
>   QEMUMIPSEL_DEFAULT_KERNEL=vmlinux-qemumipsel.bin
>   QEMUMIPSEL_DEFAULT_FSTYPE=ext3
>
>
> *Step 03.02: *Patch runqemu-internal.
>
> @@ -48,10 +48,13 @@ else
>               mem_size=128
>               ;;
>           "qemuarm")
>               mem_size=128
>               ;;
> +        "qemuarma9")
> +            mem_size=128
> +            ;;
>           "qemumicroblaze")
>               mem_size=64
>               ;;
>           "qemumips"|"qemumips64")
>               mem_size=128
> @@ -265,10 +268,11 @@ else
>           fi
>   fi
>   case "$MACHINE" in
>       "qemuarm") ;;
> +    "qemuarma9") ;;
>       "qemumicroblaze") ;;
>       "qemumips") ;;
>       "qemumipsel") ;;
>       "qemumips64") ;;
>       "qemush4") ;;
> @@ -348,10 +352,39 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" =
> "qemuarmv6" -o "$MACHINE" = "qemuarm
>           QEMUOPTIONS="$QEMUOPTIONS -cpu arm1136"
>       fi
>       if [ "$MACHINE" = "qemuarmv7" ]; then
>           QEMUOPTIONS="$QEMUOPTIONS -cpu cortex-a8"
>       fi
> +    if [ "$MACHINE" = "qemuarma9" ]; then
> +        MACHINE_SUBTYPE=vexpress-a9
> +        QEMUOPTIONS="$QEMUOPTIONS -cpu cortex-a9"
> +    fi
> +fi
> +
> +if [ "$MACHINE" = "qemuarma9" ]; then
> +    QEMU=qemu-system-arm
> +    MACHINE_SUBTYPE=vexpress-a9
> +    QEMUOPTIONS="$QEMUOPTIONS -cpu cortex-a9"
> +    export QEMU_AUDIO_DRV="none"
> +    QEMU_UI_OPTIONS="-show-cursor -usb"
> +    # QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -force-pointer"
> +    #QEMU_SYSTEM_OPTIONS="-M $MACHINE_SUBTYPE -serial null -serial
> mon:stdio -dtb $KERNEL-$MACHINE.dtb"
> +    if [ "${FSTYPE:0:3}" = "ext" -o "${FSTYPE:0:4}" = "cpio" ]; then
> +        KERNCMDLINE="earlyprintk root=/dev/mmcblk0p2 rw
> console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY
> highres=off -dtb $KERNEL-$MACHINE.dtb"
> +        QEMUOPTIONS="-M ${MACHINE_SUBTYPE} -initrd $ROOTFS -no-reboot
> $QEMU_UI_OPTIONS"
> +        #QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} -hda
> $ROOTFS -no-reboot $QEMU_UI_OPTIONS"
> +    fi
> +
> +    if [ "$FSTYPE" = "nfs" ]; then
> +        if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
> +            echo "Error: NFS mount point $ROOTFS doesn't exist"
> +            cleanup
> +            return 1
> +        fi
> +        KERNCMDLINE="root=/dev/nfs
> nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD
> mem=$QEMU_MEMORY"
> +        QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE}
> --no-reboot $QEMU_UI_OPTIONS"
> +    fi
>   fi
>   if [ "$MACHINE" = "qemux86" ]; then
>       QEMU=qemu-system-i386
>       QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -vga vmware"
> @@ -520,11 +553,11 @@ if [ "$MACHINE" = "qemuzynq" ]; then
>       fi
>   fi
>   if [ "x$RAMFS" = "xtrue" ]; then
>       QEMUOPTIONS="-initrd $ROOTFS -nographic"
> -    KERNCMDLINE="root=/dev/ram0 debugshell"
> +    KERNCMDLINE="earlyprintk root=/dev/mmcblk0p2 debugshell"
>   fi
>   if [ "x$ISOFS" = "xtrue" ]; then
>       QEMUOPTIONS="$QEMU_NETWORK_CMD -cdrom $ROOTFS $QEMU_UI_OPTIONS"
>   fi
>
> Best regards,
>
> Elvis Dowson
>
>
Elvis Dowson - Aug. 28, 2013, 3:16 p.m.
Hi,
       I get the following error while running the bitbake linux-yocto command for a qemu machine conf that I'm building. The build system is unable to find the dtc binary:

| make: Leaving directory `/tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/image/usr/src/kernel'
| NOTE: make -j 6 vexpress-v2p-ca9.dtb
|   DTC     arch/arm/boot/vexpress-v2p-ca9.dtb
| /bin/sh: /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/linux-qemuarma9-standard-build/scripts/dtc/dtc: No such file or directory
| make[3]: *** [arch/arm/boot/vexpress-v2p-ca9.dtb] Error 1
| make[2]: *** [vexpress-v2p-ca9.dtb] Error 2
| make[1]: *** [sub-make] Error 2
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/run.do_install.10606:1 exit 1 from
|   exit 1
| ERROR: Function failed: do_install (log file is located at /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/log.do_install.10606)
ERROR: Task 4 (/tool/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.4.bb, do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 598 tasks of which 597 didn't need to be rerun and 1 failed.


File : qemuarmhf.conf

#@TYPE: Machine
#@NAME: qemuarma9
#@DESCRIPTION: Machine configuration for QEMU ARM Cortex A9.

# Specify the default tune.
DEFAULTTUNE = "armv7a-neon"

require conf/machine/include/qemu.inc
require conf/machine/include/tune-cortexa9.inc

# Specify the kernel devicetree.
KERNEL_DEVICETREE = "vexpress-v2p-ca9.dtb"

# Specify the machine name used by the kernel.
KMACHINE_qemuarma9 = "vexpress"

# Specify the kernel image type.
KERNEL_IMAGETYPE = "uImage"

# Set default load address.
# Override with KERNEL_EXTRA_ARGS_<board> += "..." in machine file if required
#KERNEL_EXTRA_ARGS_qemuarma9 += "UIMAGE_LOADADDR=0x8000"

# Specify the serial console parameters.
SERIAL_CONSOLE = "115200 ttyAMA0"


Best regards,

Elvis Dowson
Bruce Ashfield - Aug. 28, 2013, 10:43 p.m.
On 13-08-28 11:16 AM, Elvis Dowson wrote:
> Hi,
>         I get the following error while running the bitbake linux-yocto
> command for a qemu machine conf that I'm building. The build system is
> unable to find the dtc binary:
>
> | make: Leaving directory
> `/tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/image/usr/src/kernel'
> | NOTE: make -j 6 vexpress-v2p-ca9.dtb
> |   DTC     arch/arm/boot/vexpress-v2p-ca9.dtb
> | /bin/sh:
> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/linux-qemuarma9-standard-build/scripts/dtc/dtc:
> No such file or directory
> | make[3]: *** [arch/arm/boot/vexpress-v2p-ca9.dtb] Error 1
> | make[2]: *** [vexpress-v2p-ca9.dtb] Error 2
> | make[1]: *** [sub-make] Error 2
> | make: *** [all] Error 2
> | ERROR: oe_runmake failed
> | WARNING:
> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/run.do_install.10606:1
> exit 1 from
> |   exit 1
> | ERROR: Function failed: do_install (log file is located at
> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/log.do_install.10606)
> ERROR: Task 4
> (/tool/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.4.bb,
> do_install) failed with exit code '1'
> NOTE: Tasks Summary: Attempted 598 tasks of which 597 didn't need to be
> rerun and 1 failed.

Did you ever get past this ? It looks like the recent device tree
changes where we use the kernel dtc versus an external dtc are causing
you a problem.

Bruce

>
> *_
> _*
> *_File : qemuarmhf.conf_*
>
> #@TYPE: Machine
> #@NAME: qemuarma9
> #@DESCRIPTION: Machine configuration for QEMU ARM Cortex A9.
>
> # Specify the default tune.
> DEFAULTTUNE = "armv7a-neon"
>
> require conf/machine/include/qemu.inc
> require conf/machine/include/tune-cortexa9.inc
>
> # Specify the kernel devicetree.
> KERNEL_DEVICETREE = "vexpress-v2p-ca9.dtb"
>
> # Specify the machine name used by the kernel.
> KMACHINE_qemuarma9 = "vexpress"
>
> # Specify the kernel image type.
> KERNEL_IMAGETYPE = "uImage"
>
> # Set default load address.
> # Override with KERNEL_EXTRA_ARGS_<board> += "..." in machine file if
> required
> #KERNEL_EXTRA_ARGS_qemuarma9 += "UIMAGE_LOADADDR=0x8000"
>
> # Specify the serial console parameters.
> SERIAL_CONSOLE = "115200 ttyAMA0"
>
>
> Best regards,
>
> Elvis Dowson
Elvis Dowson - Aug. 29, 2013, 4:36 a.m.
On Aug 29, 2013, at 2:43 AM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:

> On 13-08-28 11:16 AM, Elvis Dowson wrote:
>> Hi,
>>        I get the following error while running the bitbake linux-yocto
>> command for a qemu machine conf that I'm building. The build system is
>> unable to find the dtc binary:
>> 
>> | make: Leaving directory
>> `/tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/image/usr/src/kernel'
>> | NOTE: make -j 6 vexpress-v2p-ca9.dtb
>> |   DTC     arch/arm/boot/vexpress-v2p-ca9.dtb
>> | /bin/sh:
>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/linux-qemuarma9-standard-build/scripts/dtc/dtc:
>> No such file or directory
>> | make[3]: *** [arch/arm/boot/vexpress-v2p-ca9.dtb] Error 1
>> | make[2]: *** [vexpress-v2p-ca9.dtb] Error 2
>> | make[1]: *** [sub-make] Error 2
>> | make: *** [all] Error 2
>> | ERROR: oe_runmake failed
>> | WARNING:
>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/run.do_install.10606:1
>> exit 1 from
>> |   exit 1
>> | ERROR: Function failed: do_install (log file is located at
>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/log.do_install.10606)
>> ERROR: Task 4
>> (/tool/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.4.bb,
>> do_install) failed with exit code '1'
>> NOTE: Tasks Summary: Attempted 598 tasks of which 597 didn't need to be
>> rerun and 1 failed.
> 
> Did you ever get past this ? It looks like the recent device tree
> changes where we use the kernel dtc versus an external dtc are causing
> you a problem.

I did get past this, after I updated the SRCREV_meta with the correct commit,
which resulted in the correct kconfig fragment being picked up, with enabled
the device tree option in the kernel.

However, I'm unable to get qemu to boot correctly, for both ARM Cortex A9
and ARM Cortex A* (beagle). Maybe this has to do with the fact that it needs
xload+uboot in addition to the kernel, using an SD card image.

Any suggestions on how I can do this?

I'd like to know how qemuarmv6, qemuarmv9 and qemuarma9 were tested
earlier.

I think its important to get atleast the A8 and A( QEMU platforms up and running
in oe-core, since they represent a bunch of the current targets used for actual
development.

Best regards,

Elvis Dowson
Khem Raj - Aug. 29, 2013, 5:48 a.m.
On Aug 28, 2013, at 9:36 PM, Elvis Dowson <elvis.dowson@gmail.com> wrote:

> 
> On Aug 29, 2013, at 2:43 AM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:
> 
>> On 13-08-28 11:16 AM, Elvis Dowson wrote:
>>> Hi,
>>>       I get the following error while running the bitbake linux-yocto
>>> command for a qemu machine conf that I'm building. The build system is
>>> unable to find the dtc binary:
>>> 
>>> | make: Leaving directory
>>> `/tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/image/usr/src/kernel'
>>> | NOTE: make -j 6 vexpress-v2p-ca9.dtb
>>> |   DTC     arch/arm/boot/vexpress-v2p-ca9.dtb
>>> | /bin/sh:
>>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/linux-qemuarma9-standard-build/scripts/dtc/dtc:
>>> No such file or directory
>>> | make[3]: *** [arch/arm/boot/vexpress-v2p-ca9.dtb] Error 1
>>> | make[2]: *** [vexpress-v2p-ca9.dtb] Error 2
>>> | make[1]: *** [sub-make] Error 2
>>> | make: *** [all] Error 2
>>> | ERROR: oe_runmake failed
>>> | WARNING:
>>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/run.do_install.10606:1
>>> exit 1 from
>>> |   exit 1
>>> | ERROR: Function failed: do_install (log file is located at
>>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/log.do_install.10606)
>>> ERROR: Task 4
>>> (/tool/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.4.bb,
>>> do_install) failed with exit code '1'
>>> NOTE: Tasks Summary: Attempted 598 tasks of which 597 didn't need to be
>>> rerun and 1 failed.
>> 
>> Did you ever get past this ? It looks like the recent device tree
>> changes where we use the kernel dtc versus an external dtc are causing
>> you a problem.
> 
> I did get past this, after I updated the SRCREV_meta with the correct commit,
> which resulted in the correct kconfig fragment being picked up, with enabled
> the device tree option in the kernel.
> 
> However, I'm unable to get qemu to boot correctly, for both ARM Cortex A9
> and ARM Cortex A* (beagle). Maybe this has to do with the fact that it needs
> xload+uboot in addition to the kernel, using an SD card image.
> 
> Any suggestions on how I can do this?
> 
> I'd like to know how qemuarmv6, qemuarmv9 and qemuarma9 were tested
> earlier.
> 
> I think its important to get atleast the A8 and A( QEMU platforms up and running
> in oe-core, since they represent a bunch of the current targets used for actual
> development.

also take a look at meta-linaro, they test armv7+ qemu regularly.

> 
> Best regards,
> 
> Elvis Dowson
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Elvis Dowson - Aug. 29, 2013, 8:50 a.m.
>> also take a look at meta-linaro, they test armv7+ qemu regularly.

I built core-image-minimal using meta-linaro, using genericarmv7 machine but it just generates an Image file for the kernel and a tar.gz rootfs. It doesn't look like its useful out of the box for a QEMU image. Additionally you have to do something extra for the image to be usable for a beagle QEMU machine, related to x-load and u-boot, to get it to work.

Are you aware of the extract steps? Most of the docs I've seen use pre built sd card images.

Best regards,

Elvis
Bruce Ashfield - Aug. 29, 2013, 12:35 p.m.
On 13-08-29 12:36 AM, Elvis Dowson wrote:
>
> On Aug 29, 2013, at 2:43 AM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:
>
>> On 13-08-28 11:16 AM, Elvis Dowson wrote:
>>> Hi,
>>>         I get the following error while running the bitbake linux-yocto
>>> command for a qemu machine conf that I'm building. The build system is
>>> unable to find the dtc binary:
>>>
>>> | make: Leaving directory
>>> `/tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/image/usr/src/kernel'
>>> | NOTE: make -j 6 vexpress-v2p-ca9.dtb
>>> |   DTC     arch/arm/boot/vexpress-v2p-ca9.dtb
>>> | /bin/sh:
>>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/linux-qemuarma9-standard-build/scripts/dtc/dtc:
>>> No such file or directory
>>> | make[3]: *** [arch/arm/boot/vexpress-v2p-ca9.dtb] Error 1
>>> | make[2]: *** [vexpress-v2p-ca9.dtb] Error 2
>>> | make[1]: *** [sub-make] Error 2
>>> | make: *** [all] Error 2
>>> | ERROR: oe_runmake failed
>>> | WARNING:
>>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/run.do_install.10606:1
>>> exit 1 from
>>> |   exit 1
>>> | ERROR: Function failed: do_install (log file is located at
>>> /tool/yocto/poky/build/tmp/work/qemuarma9-poky-linux-gnueabi/linux-yocto/3.4.52+gitAUTOINC+7250de4d4a_4122d6cf3f-r4.5/temp/log.do_install.10606)
>>> ERROR: Task 4
>>> (/tool/yocto/poky/meta/recipes-kernel/linux/linux-yocto_3.4.bb,
>>> do_install) failed with exit code '1'
>>> NOTE: Tasks Summary: Attempted 598 tasks of which 597 didn't need to be
>>> rerun and 1 failed.
>>
>> Did you ever get past this ? It looks like the recent device tree
>> changes where we use the kernel dtc versus an external dtc are causing
>> you a problem.
>
> I did get past this, after I updated the SRCREV_meta with the correct commit,
> which resulted in the correct kconfig fragment being picked up, with enabled
> the device tree option in the kernel.
>
> However, I'm unable to get qemu to boot correctly, for both ARM Cortex A9
> and ARM Cortex A* (beagle). Maybe this has to do with the fact that it needs
> xload+uboot in addition to the kernel, using an SD card image.
>
> Any suggestions on how I can do this?
>

With that, it's always been a manual setup for me in the past. The typical
workflow is to test them via the usermode NFS boot. Have you given
that a go ?

Once I'm over the 3.10 introduction curve, I'm happy to dust off my
old A9 support and get the right qemu support for a full system boot.

Cheers,

Bruce

> I'd like to know how qemuarmv6, qemuarmv9 and qemuarma9 were tested
> earlier.
>
> I think its important to get atleast the A8 and A( QEMU platforms up and running
> in oe-core, since they represent a bunch of the current targets used for actual
> development.
>
> Best regards,
>
> Elvis Dowson
>
Elvis Dowson - Aug. 29, 2013, 2:02 p.m.
Hi Bruce,

On Aug 29, 2013, at 4:35 PM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:

> With that, it's always been a manual setup for me in the past. The typical
> workflow is to test them via the usermode NFS boot. Have you given
> that a go ?

Does yocto have some wrapper script/command to setup nfs boot automatically
without too much manual configuration? The runqemu and runqemu-internal
scripts seems to indicate that, but haven't tried this before.

Let me know if it exists! If not, if you could point me to a link that describes how
to set NFS boot, and use it to load a beagleboard image it would be great!

> Once I'm over the 3.10 introduction curve, I'm happy to dust off my
> old A9 support and get the right qemu support for a full system boot.

That sounds good. We should aim for adding support for both A8 and A9,
since that represent the current bulk of last-gen and current-gen platforms
out there.

Best regards,

Elvis Dowson
Khem Raj - Aug. 29, 2013, 4:17 p.m.
On Aug 29, 2013, at 1:50 AM, Elvis Dowson <elvis.dowson@gmail.com> wrote:

>>> also take a look at meta-linaro, they test armv7+ qemu regularly.
> 
> I built core-image-minimal using meta-linaro, using genericarmv7 machine but it just generates an Image file for the kernel and a tar.gz rootfs. It doesn't look like its useful out of the box for a QEMU image. Additionally you have to do something extra for the image to be usable for a beagle QEMU machine, related to x-load and u-boot, to get it to work.

x-load, u-boot are not needed when booting a qemu machine. You just need a kernel and rfs. So make sure that you use a kernel thats configured correctly to boot on say vexpress emulation on qemu and that should be it. Real thing is to figure out the kernel and any patches if needed.

> 
> Are you aware of the extract steps? Most of the docs I've seen use pre built sd card images.
> 
> Best regards,
> 
> Elvis
Bruce Ashfield - Aug. 29, 2013, 4:18 p.m.
On 13-08-29 12:17 PM, Khem Raj wrote:
>
> On Aug 29, 2013, at 1:50 AM, Elvis Dowson <elvis.dowson@gmail.com> wrote:
>
>>>> also take a look at meta-linaro, they test armv7+ qemu regularly.
>>
>> I built core-image-minimal using meta-linaro, using genericarmv7 machine but it just generates an Image file for the kernel and a tar.gz rootfs. It doesn't look like its useful out of the box for a QEMU image. Additionally you have to do something extra for the image to be usable for a beagle QEMU machine, related to x-load and u-boot, to get it to work.
>
> x-load, u-boot are not needed when booting a qemu machine. You just need a kernel and rfs. So make sure that you use a kernel thats configured correctly to boot on say vexpress emulation on qemu and that should be it. Real thing is to figure out the kernel and any patches if needed.

vexpress itself works out of the box with the changes in the kernel,
I boot it frequently via NFS out of linux-yocto. It's the platform's
lack of bus/disk support that is the real issue.

Bruce

>
>>
>> Are you aware of the extract steps? Most of the docs I've seen use pre built sd card images.
>>
>> Best regards,
>>
>> Elvis
>
Elvis Dowson - Aug. 29, 2013, 4:22 p.m.
On Aug 29, 2013, at 8:17 PM, Khem Raj <raj.khem@gmail.com> wrote:

> 
> On Aug 29, 2013, at 1:50 AM, Elvis Dowson <elvis.dowson@gmail.com> wrote:
> 
>>>> also take a look at meta-linaro, they test armv7+ qemu regularly.
>> 
>> I built core-image-minimal using meta-linaro, using genericarmv7 machine but it just generates an Image file for the kernel and a tar.gz rootfs. It doesn't look like its useful out of the box for a QEMU image. Additionally you have to do something extra for the image to be usable for a beagle QEMU machine, related to x-load and u-boot, to get it to work.
> 
> x-load, u-boot are not needed when booting a qemu machine. You just need a kernel and rfs. So make sure that you use a kernel thats configured correctly to boot on say vexpress emulation on qemu and that should be it. Real thing is to figure out the kernel and any patches if needed.

Tried that with the current poky master, it doesn't work. 

The only two qemu arm based machine configurations that work, at the moment are qemuarm (versatilepb) and qemuzynq from the meta-xilinx layer (xilinx-zynq-a9).

The others don't work, it crashes upon booting.

If you've got -M vexpress-a9 working, please let me know how you got it to run against yocto master.

Elvis Dowson
Bruce Ashfield - Aug. 29, 2013, 4:23 p.m.
On 13-08-29 10:02 AM, Elvis Dowson wrote:
> Hi Bruce,
>
> On Aug 29, 2013, at 4:35 PM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:
>
>> With that, it's always been a manual setup for me in the past. The typical
>> workflow is to test them via the usermode NFS boot. Have you given
>> that a go ?
>
> Does yocto have some wrapper script/command to setup nfs boot automatically
> without too much manual configuration? The runqemu and runqemu-internal
> scripts seems to indicate that, but haven't tried this before.
>
> Let me know if it exists! If not, if you could point me to a link that describes how
> to set NFS boot, and use it to load a beagleboard image it would be great!

This is supported right out of the box, and it should be documented in
the project docs.

Search for users-space NFS in 
http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html

Cheers,

Bruce

>
>> Once I'm over the 3.10 introduction curve, I'm happy to dust off my
>> old A9 support and get the right qemu support for a full system boot.
>
> That sounds good. We should aim for adding support for both A8 and A9,
> since that represent the current bulk of last-gen and current-gen platforms
> out there.
>
> Best regards,
>
> Elvis Dowson
>
>
Elvis Dowson - Aug. 29, 2013, 4:28 p.m.
On Aug 29, 2013, at 8:23 PM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:

> On 13-08-29 10:02 AM, Elvis Dowson wrote:
>> Hi Bruce,
>> 
>> On Aug 29, 2013, at 4:35 PM, Bruce Ashfield <bruce.ashfield@windriver.com> wrote:
>> 
>>> With that, it's always been a manual setup for me in the past. The typical
>>> workflow is to test them via the usermode NFS boot. Have you given
>>> that a go ?
>> 
>> Does yocto have some wrapper script/command to setup nfs boot automatically
>> without too much manual configuration? The runqemu and runqemu-internal
>> scripts seems to indicate that, but haven't tried this before.
>> 
>> Let me know if it exists! If not, if you could point me to a link that describes how
>> to set NFS boot, and use it to load a beagleboard image it would be great!
> 
> This is supported right out of the box, and it should be documented in
> the project docs.
> 
> Search for users-space NFS in http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html

I saw this, its only for the rootfs. what I've read on the net alluded to the fact that you need to have
xload, uboot and the kernel image on a specific partition inside an sdcard image. Those were
the boot procedures used for the beagleboard using qemu.

This is for -M beagle, with qemu-system-arm. 

Anyway, I just need a way to boot vexpress-a9 using QEMU. I'll send a private email, with the
patch to you, so that you can start off from where I left, in terms of modifications to poky-master
and be able to debug the issue directly at your end.

Best regards,

Elvis Dowson

Patch

diff --git a/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc b/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
index c71fe1c..729125d 100644
--- a/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
+++ b/meta/cfg/kernel-cache/bsp/qemuarma9/qemuarma9-standard.scc
@@ -3,7 +3,7 @@  define KTYPE standard
 define KARCH arm
 
 include ktypes/standard/standard.scc
-branch arm-versatile-926ejs
+branch qemuarma9
 
 include qemuarma9.scc