r4081 - trunk/src/host/devirginator
werner at sita.openmoko.org
werner at sita.openmoko.org
Sat Feb 16 16:36:51 CET 2008
Author: werner
Date: 2008-02-16 16:36:40 +0100 (Sat, 16 Feb 2008)
New Revision: 4081
Modified:
trunk/src/host/devirginator/Makefile
trunk/src/host/devirginator/environment.in
trunk/src/host/devirginator/openocd.in
trunk/src/host/devirginator/setup.sh
trunk/src/host/devirginator/u-boot.in
Log:
Various changes, mainly for GTA02. Note: needs more testing.
Add support for GTA02:
devirginator/setup.sh: pass openocd.in and u-boot.in through CPP
devirginator/setup.sh: new variables U_PLATFORM and U_BOARD containing upper
case versions of PLATFORM and BOARD
devirginator/setup.sh: pass -D<platform> and -D<platform><board> (in upper
case) to envedit.pl
devirginator/openocd.in: added GTA02 memory map
devirginator/openocd.in: enable backlight only if GTA01
devirginator/u-boot.in: corrected misleading comment regarding backlight status
devirginator/u-boot.in: updated NAND BBT location for GTA02
devirginator/u-boot.in: added distinct smiley handling (frame buffer address)
for GTA01 and GTA02
devirginator/environment.in: added console, root device, and frame buffer
(splash screen) handling for GTA02
devirginator/environment.in (bootcmd): limit kernel load size to 2MB
General improvements:
devirginator/Makefile: added "clean" target
devirginator/environment.in: added the "Factory reset" menu option, which used
to be hard-coded in u-boot
Modified: trunk/src/host/devirginator/Makefile
===================================================================
--- trunk/src/host/devirginator/Makefile 2008-02-16 15:18:08 UTC (rev 4080)
+++ trunk/src/host/devirginator/Makefile 2008-02-16 15:36:40 UTC (rev 4081)
@@ -1,7 +1,7 @@
#
# Makefile - Setup and handling of prerequisites
#
-# Copyright (C) 2006-2007 by OpenMoko, Inc.
+# Copyright (C) 2006-2008 by OpenMoko, Inc.
# Written by Werner Almesberger <werner at openmoko.org>
# All Rights Reserved
#
@@ -26,7 +26,7 @@
TARDIR=devirginate-$(TARBALL_VERSION)
TARBALL=$(TARDIR).tar.gz
-.PHONY: tarball
+.PHONY: tarball clean
#devirginate: config environment.in openocd.in u-boot.in \
# setup.sh smiley.gz \
@@ -63,3 +63,6 @@
$(TMP_FILES:%=$(TARDIR)/%) || \
{ rm -f $(TARDIR); exit 1; }
rm -f $(TARDIR)
+
+clean:
+ rm -f smiley.ppm smiley.png smiley.gz
Modified: trunk/src/host/devirginator/environment.in
===================================================================
--- trunk/src/host/devirginator/environment.in 2008-02-16 15:18:08 UTC (rev 4080)
+++ trunk/src/host/devirginator/environment.in 2008-02-16 15:36:40 UTC (rev 4081)
@@ -2,17 +2,37 @@
# environment.in - The default environment
#
+#
+# Note: for backwards-compatibility, we don't test whether the symbol "GTA01"
+# is defined, but we only test for "GTA02".
+#
+
+#ifdef GTA02
+
+#define CONSOLE ttySAC2
+#define ROOTDEV /dev/mtdblock6
+#define FRAMEBUFFER 0x8800000
+
+#else # GTA01
+
+#define CONSOLE ttySAC0
+#define ROOTDEV /dev/mtdblock4
+#define FRAMEBUFFER 0x33d00000
+
+#endif
+
+
bootargs_base=
rootfstype=jffs2
- root=/dev/mtdblock4
- console=ttySAC0,115200
+ root=ROOTDEV
+ console=CONSOLE,115200
console=tty0
loglevel=8
regular_boot
bootcmd=
setenv bootargs ${bootargs_base} ${mtdparts};
- nand read.e 0x32000000 kernel;
+ nand read.e 0x32000000 kernel 0x200000;
bootm 0x32000000
bootdelay=1
@@ -21,7 +41,7 @@
splashimage=
nand read.e 0x32000000 splash 0x5000;
- unzip 0x32000000 0x33d00000 0x96000
+ unzip 0x32000000 FRAMEBUFFER 0x96000
stdout=usbtty
stderr=usbtty
@@ -53,3 +73,9 @@
menu_4=
Power off:
neo1973 power-off
+
+menu_5=
+ Factory reset:
+ defaultenv;
+ dynpart;
+ bootd
Modified: trunk/src/host/devirginator/openocd.in
===================================================================
--- trunk/src/host/devirginator/openocd.in 2008-02-16 15:18:08 UTC (rev 4080)
+++ trunk/src/host/devirginator/openocd.in 2008-02-16 15:36:40 UTC (rev 4081)
@@ -5,7 +5,8 @@
#
# Memory map:
#
-# 0x33FFFFFF end of RAM
+# 0x37FFFFFF end of RAM (GTA02)
+# 0x33FFFFFF end of RAM (GTA01)
# 0x33F80000 u-boot
# 0x33D00000 frame buffer
# 0x32300000 interim logo
@@ -21,9 +22,11 @@
wait_halt
sleep 2000
+#ifdef GTA01
# turn on the backlight
mww 0x56000010 0x1
mww 0x56000014 1
+#endif
# load and run the low-level hardware setup
load_binary $LOWLEVEL 0
Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh 2008-02-16 15:18:08 UTC (rev 4080)
+++ trunk/src/host/devirginator/setup.sh 2008-02-16 15:36:40 UTC (rev 4081)
@@ -2,7 +2,7 @@
#
# setup.sh - Set up the devirginator
#
-# Copyright (C) 2006-2007 by OpenMoko, Inc.
+# Copyright (C) 2006-2008 by OpenMoko, Inc.
# Written by Werner Almesberger <werner at openmoko.org>
# All Rights Reserved
#
@@ -80,6 +80,12 @@
}
+cppify()
+{
+ sed '/^#[a-z]/{n;};s/#.*$//' | cpp -D$U_PLATFORM -D$U_PLATFORM$U_BOARD
+}
+
+
# --- Configuration defaults --------------------------------------------------
@@ -136,6 +142,9 @@
RELEASE_DIR=${RELEASE_DIR}/${PLATFORM}-${SNAPSHOT}/tmp/deploy/images
fi
+U_PLATFORM="`echo \"$PLATFORM\" | LANG=C tr a-z A-Z`"
+U_BOARD="`echo \"$BOARD\" | LANG=C tr a-z A-Z`"
+
# lowlevel_foo.bin
if [ -z "$LOWLEVEL" ]; then
@@ -236,11 +245,11 @@
# --- Stage 1: OpenOCD script -------------------------------------------------
-{
+cppify <openocd.in | {
while read l; do
eval "echo $l"
done
-} <openocd.in >tmp/script.ocd
+} >tmp/script.ocd
add_file tmp/script.ocd
@@ -263,7 +272,7 @@
# --- Stage 1: u-boot script --------------------------------------------------
-perl ./scriptify.pl u-boot.in >tmp/u-boot.out
+cppify <u-boot.in | perl ./scriptify.pl >tmp/u-boot.out
add_file tmp/u-boot.out
@@ -353,11 +362,13 @@
$DFU_UTIL $USB_ID -a kernel -D $UIMAGE
$DFU_UTIL $USB_ID -a rootfs -D $ROOTFS
$DFU_UTIL $USB_ID -a splash -D tmp/splash.gz
+ rm -f tmp/env.old tmp/env.new
$DFU_UTIL $USB_ID -a u-boot_env -U tmp/env.old
./openocdcmd.pl $OPENOCD_HOST $OPENOCD_PORT \
"reset halt" wait_halt resume exit
sleep 5
- ./envedit.pl -i tmp/env.old -o tmp/env.new -f tmp/environment
+ ./envedit.pl -i tmp/env.old -o tmp/env.new \
+ -D$U_PLATFORM -D$U_PLATFORM$U_BOARD -f tmp/environment
$DFU_UTIL $USB_ID -a u-boot_env -D tmp/env.new
./openocdcmd.pl $OPENOCD_HOST $OPENOCD_PORT "reset run" exit
fi
Modified: trunk/src/host/devirginator/u-boot.in
===================================================================
--- trunk/src/host/devirginator/u-boot.in 2008-02-16 15:18:08 UTC (rev 4080)
+++ trunk/src/host/devirginator/u-boot.in 2008-02-16 15:36:40 UTC (rev 4081)
@@ -6,7 +6,7 @@
# interactive testing one may wish to do.
#
-# switch on the backlight, so one can see that we're alive
+# toggle the backlight, so one can see that we're alive
neo1973 backlight off
@@ -16,7 +16,12 @@
# remove any pre-existing bad block table and create a new one
+#ifndef GTA02
setenv scrub_true nand scrub 0x3ff0000 0x10000
+#else
+setenv scrub_true nand scrub 0x7f80000 0x80000
+#endif
+
setenv scrub_ echo Not scrubbing
run scrub_${scrub}
@@ -45,7 +50,13 @@
setenv bootcmd
setenv bootdelay 604800
+
+#ifndef GTA02
setenv splashimage nand read.e 0x32000000 splash 0x1000\; unzip 0x32000000 0x33d00000 0x96000
+#else
+setenv splashimage nand read.e 0x32000000 splash 0x1000\; unzip 0x32000000 0x8800000 0x96000
+#endif
+
setenv usbtty cdc_acm
saveenv
More information about the commitlog
mailing list