Patchwork [08/14] runqemu: Add qemush4 and qemumips64 knowledge

login
register
mail settings
Submitter Khem Raj
Date May 21, 2012, 3:35 a.m.
Message ID <3a5432aec0faea49d2c04984cd169ceb35bba89f.1337570904.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/28039/
State Accepted
Commit 3a5432aec0faea49d2c04984cd169ceb35bba89f
Headers show

Comments

Khem Raj - May 21, 2012, 3:35 a.m.
New machines need to be added and they also
have different kernel commandlines

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 scripts/runqemu          |   10 ++++++++--
 scripts/runqemu-internal |   35 ++++++++++++++++++++++++++++++++---
 2 files changed, 40 insertions(+), 5 deletions(-)

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index fc7363f..1e803ed 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -94,7 +94,7 @@  KVM_ENABLED="no"
 while true; do
     arg=${1}
     case "$arg" in
-        "qemux86" | "qemux86-64" | "qemuarm" | "qemumips" | "qemuppc")
+        "qemux86" | "qemux86-64" | "qemuarm" | "qemumips" | "qemumips64" | "qemush4"  | "qemuppc")
             [ -z "$MACHINE" ] && MACHINE=$arg || \
                 error "conflicting MACHINE types [$MACHINE] and [$arg]"
             ;;
@@ -223,7 +223,7 @@  if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
 fi
 
 if [ -z "$MACHINE" ]; then
-    MACHINE=`basename $KERNEL | sed 's/.*-\(qemux86-64\|qemux86\|qemuarm\|qemumips\|qemuppc\).*/\1/'`
+    MACHINE=`basename $KERNEL | sed 's/.*-\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
     if [ -z "$MACHINE" ]; then
         error "Unable to set MACHINE from kernel filename [$KERNEL]"
     fi
@@ -245,6 +245,12 @@  QEMUARM_DEFAULT_FSTYPE=ext3
 QEMUMIPS_DEFAULT_KERNEL=vmlinux-qemumips.bin
 QEMUMIPS_DEFAULT_FSTYPE=ext3
 
+QEMUMIPS64_DEFAULT_KERNEL=vmlinux-qemumips64.bin
+QEMUMIPS64_DEFAULT_FSTYPE=ext3
+
+QEMUSH4_DEFAULT_KERNEL=vmlinux-qemumips.bin
+QEMUSH4_DEFAULT_FSTYPE=ext3
+
 QEMUPPC_DEFAULT_KERNEL=vmlinux-qemuppc.bin
 QEMUPPC_DEFAULT_FSTYPE=ext3
 
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index fe2974b..c8e3186 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -51,12 +51,15 @@  else
         "qemuarm")
             mem_size=128
             ;;
-        "qemumips")
+        "qemumips"|"qemumips64")
             mem_size=128
             ;;
         "qemuppc")
             mem_size=128
             ;;
+        "qemush4")
+            mem_size=1024
+            ;;
         *)
             mem_size=64
             ;;
@@ -233,6 +236,8 @@  fi
 case "$MACHINE" in
     "qemuarm") ;;
     "qemumips") ;;
+    "qemumips64") ;;
+    "qemush4") ;;
     "qemuppc") ;;
     "qemuarmv6") ;;
     "qemuarmv7") ;;
@@ -370,8 +375,12 @@  if [ "$MACHINE" = "spitz" ]; then
     fi
 fi
 
-if [ "$MACHINE" = "qemumips" ]; then
-    QEMU=qemu-system-mips
+if [ "$MACHINE" = "qemumips" -o "$MACHINE" = "qemumips64" ]; then
+    if [ "$MACHINE" = "qemumips64" ]; then
+	QEMU=qemu-system-mips64
+    else
+	QEMU=qemu-system-mips
+    fi
     MACHINE_SUBTYPE=malta
     QEMU_UI_OPTIONS="-vga cirrus $QEMU_UI_OPTIONS"
     if [ "$FSTYPE" = "ext3" -o "$FSTYPE" = "btrfs" ]; then
@@ -411,6 +420,26 @@  if [ "$MACHINE" = "qemuppc" ]; then
     fi
 fi
 
+if [ "$MACHINE" = "qemush4" ]; then
+    QEMU=qemu-system-sh4
+    MACHINE_SUBTYPE=r2d
+    QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
+    if [ "$FSTYPE" = "ext3" -o "$FSTYPE" = "btrfs" ]; then
+        #KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+        KERNCMDLINE="root=/dev/hda rw console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
+    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
+        fi
+        KERNCMDLINE="root=/dev/nfs console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty 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 -monitor null -serial vc -serial stdio"
+    fi
+fi
+
 if [ "$MACHINE" = "akita" ]; then
     QEMU=qemu-system-arm
     if [ "$FSTYPE" = "jffs2" ]; then