]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: Add support for nokia800 to runqemu
authorRichard Purdie <richard@openedhand.com>
Thu, 10 Apr 2008 09:50:54 +0000 (09:50 +0000)
committerRichard Purdie <richard@openedhand.com>
Thu, 10 Apr 2008 09:50:54 +0000 (09:50 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4226 311d38ba-8fff-0310-9ca6-ca027cbcb966

scripts/poky-nokia800-flashutil [new file with mode: 0755]
scripts/poky-qemu-internal
scripts/runqemu

diff --git a/scripts/poky-nokia800-flashutil b/scripts/poky-nokia800-flashutil
new file mode 100755 (executable)
index 0000000..8d40f1d
--- /dev/null
@@ -0,0 +1,53 @@
+#! /bin/sh
+# Copyright (C) 2008 OpenedHand Ltd.
+# Contact: andrew@openedhand.com
+#
+# Erase the partition given in $3 (default: rootfs) and flash the contents
+# of image given in $1 into the image $2.
+
+if [ ! -r "$1" ]; then
+       echo "Usage: $0 <image> <destimage> [<partition>]"
+       exit -1
+fi
+
+if [ ! -e "$2" ]; then
+        echo "foo"
+       # Making an empty/erased flash image.  Need a correct echo behavior.
+       dd if=/dev/zero of=$2 bs=268435456 count=0 seek=1
+       bash -c 'echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b'
+       cat .8b .8b > .16b # OOB is 16 bytes
+       cat .16b .16b .16b .16b .16b .16b .16b .16b > .8sec
+       cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec
+       cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec
+       cat .512sec .512sec .512sec .512sec > .2ksec
+       cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16k
+       cat .16k .16k .16k .16k .16k .16k .16k .16k > .128k
+       # N800 NAND is 512k sectors big
+       cat  .128k .128k .128k .128k >> $2
+       rm -rf .8b .16b .8sec .64sec .512sec .2ksec .16k, .128k
+fi
+
+if [ "$3" != "" ]; then
+       case "$3" in
+       config)
+               partition=/dev/mtd1
+               page=64
+               ;;
+       initfs)
+               partition=/dev/mtd3
+               page=1280
+               ;;
+       rootfs)
+               partition=/dev/mtd4
+               page=2304
+               ;;
+       *)
+               echo "Unknown partition $2"
+               exit -1
+       esac
+else
+       partition=/dev/mtd4
+       page=2304
+fi
+
+dd if=$1 of=$2 conv=notrunc bs=2048 seek=$page
index 1a8fb63b358dae7d2b765ffc4d29d53527162818..4ddb116130193e7755988bf4004cb8905402f5fa 100755 (executable)
 #   HDIMAGE - the disk image file to use
 #
 
+if [ -z "$QEMU_MEMORY" ]; then
+    QEMU_MEMORY="64M"
+fi
+
 QEMUIFUP=`which poky-qemu-ifup`
 QEMUIFDOWN=`which poky-qemu-ifdown`
 KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0"
 QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN"
 KERNCMDLINE="mem=$QEMU_MEMORY"
 
-if [ -z "$QEMU_MEMORY" ]; then
-    QEMU_MEMORY="64M"
-fi
-
 SERIALOPTS=""
 if [ "x$SERIAL_LOGFILE" != "x" ]; then
     SERIALOPTS="-serial file:$SERIAL_LOGFILE"
@@ -50,6 +50,7 @@ case "$MACHINE" in
        "qemux86") ;;
        "akita") ;;
        "spitz") ;;
+       "nokia800") ;;
        *)
                echo "Error: Unsupported machine type $MACHINE"
                return
@@ -130,13 +131,39 @@ if [ "$MACHINE" = "akita" ]; then
     fi
 fi
 
+if [ "$MACHINE" = "nokia800" ]; then
+    QEMU=qemu-system-arm
+    if [ "$TYPE" = "jffs2" ]; then
+        HDIMAGE=`readlink -f $HDIMAGE`
+        if [ ! -e "$HDIMAGE.qemuflash" ]; then
+            #if [ ! -e "$HDIMAGE.initfs" ]; then
+            #    echo "Error, $HDIMAGE.initfs must exist!"
+            #    return
+            #fi
+            #if [ ! -e "$HDIMAGE.config" ]; then
+            #    echo "Error, $HDIMAGE.config must exist!"
+            #    return
+            #fi
+            #echo "'Flashing' config partition, please wait..."
+            #poky-nokia800-flashutil $HDIMAGE.config $HDIMAGE.qemuflash config
+            #echo "'Flashing' initfs, please wait..."
+            #poky-nokia800-flashutil $HDIMAGE.initfs $HDIMAGE.qemuflash initfs
+            echo "'Flashing' rootfs, please wait..."
+            poky-nokia800-flashutil $HDIMAGE $HDIMAGE.qemuflash 
+        fi
+       KERNCMDLINE="root=/dev/mtdblock4 rootfstype=jffs2"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -M n800 -mtdblock $HDIMAGE.qemuflash -serial vc -m 130 -serial vc -serial vc -serial vc"
+    fi
+fi
+
+
 if [ "x$QEMUOPTIONS" = "x" ]; then
     echo "Error: Unable to support this combination of options"
     return
 fi
 
 SDKDIR="/usr/local/poky/eabi-glibc"
-if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then
+if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then
     SDKPATH="$SDKDIR/arm/arm-poky-linux-gnueabi/bin:$SDKDIR/arm/bin"
 fi
 
index 4bbd3f6d8aeab6f54be41c9dd208055f07820602..854d675d19152c21ffceeaac5e07c5afbda7344d 100755 (executable)
@@ -45,6 +45,9 @@ else
     if [ "$MACHINE" = "akita" ]; then
         TYPE="jffs2"
     fi
+    if [ "$MACHINE" = "nokia800" ]; then
+        TYPE="jffs2"
+    fi
     if [ "$MACHINE" = "spitz" ]; then
         TYPE="ext3"
     fi
@@ -58,7 +61,7 @@ if [ "x$4" != "x" ]; then
     HDIMAGE=$4
 fi
 
-if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" ]; then
+if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "spitz" -o "$MACHINE" = "borzoi" -o "$MACHINE" = "akita" -o "$MACHINE" = "nokia800" ]; then
     if [ "x$ZIMAGE" = "x" ]; then
         ZIMAGE=$BUILDDIR/tmp/deploy/images/zImage-$MACHINE.bin
     fi
@@ -96,6 +99,15 @@ if [ "$MACHINE" = "akita" ]; then
     fi
 fi
 
+if [ "$MACHINE" = "nokia800" ]; then
+    if [ "$TYPE" = "jffs2" ]; then
+        if [ "x$HDIMAGE" = "x" ]; then
+           HDIMAGE=$BUILDDIR/tmp/deploy/images/poky-image-sato-nokia800.jffs2
+        fi
+    fi
+fi
+
+
 if [ "$MACHINE" = "qemux86" ]; then
     if [ "x$ZIMAGE" = "x" ]; then
         ZIMAGE=$BUILDDIR/tmp/deploy/images/bzImage-$MACHINE.bin