From faf55131c9b86a8646dd80ca79b44a001b88a87f Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 10 Apr 2008 09:50:54 +0000 Subject: scripts: Add support for nokia800 to runqemu git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4226 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- scripts/poky-nokia800-flashutil | 53 +++++++++++++++++++++++++++++++++++++++++ scripts/poky-qemu-internal | 37 ++++++++++++++++++++++++---- scripts/runqemu | 14 ++++++++++- 3 files changed, 98 insertions(+), 6 deletions(-) create mode 100755 scripts/poky-nokia800-flashutil (limited to 'scripts') diff --git a/scripts/poky-nokia800-flashutil b/scripts/poky-nokia800-flashutil new file mode 100755 index 0000000000..8d40f1dbf9 --- /dev/null +++ b/scripts/poky-nokia800-flashutil @@ -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 []" + 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 diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal index 1a8fb63b35..4ddb116130 100755 --- a/scripts/poky-qemu-internal +++ b/scripts/poky-qemu-internal @@ -30,16 +30,16 @@ # 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 diff --git a/scripts/runqemu b/scripts/runqemu index 4bbd3f6d8a..854d675d19 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -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 -- cgit v1.2.3-54-g00ecf