Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r4121 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   2. r4122 - trunk/src/host/devirginator ([EMAIL PROTECTED])
   3. r4123 - trunk/src/host/devirginator ([EMAIL PROTECTED])
   4. r4124 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   5. r4125 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   6. r4126 - in trunk/src/host/devirginator: . tests
      ([EMAIL PROTECTED])
   7. r4127 - trunk/src/host/devirginator ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-02-27 13:56:41 +0100 (Wed, 27 Feb 2008)
New Revision: 4121

Added:
   branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch
Modified:
   branches/src/target/kernel/2.6.24.x/patches/series
Log:
fix-pcf50633-one-shot-resume.patch

From: Andy Green <[EMAIL PROTECTED]>

The wakeup sources behind the PMU interrupt only worked once
as a wakeup source for suspend.  This is because of further
resume sequencing trouble meaning that the PMU interrupt
gets accepted for service before the I2C driver resumed and
it is able to actually talk to the PMU.  A previous patch
stopped this situation stalling resume, but this patch
extends it to scheduling a retry after an msleep(1).

Failing to service the PMU interrupt led to no further PMU
interrupts being recognized due to edge triggering, with the
retry we typically get it on the next try since I2C is up
by then, and PMU interrupts continue to be recognized for
wake and other functions.

Signed-off-by: Andy Green <[EMAIL PROTECTED]>

---

 drivers/i2c/chips/pcf50633.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)



Added: branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch    
2008-02-27 07:36:29 UTC (rev 4120)
+++ branches/src/target/kernel/2.6.24.x/patches/pcf50633-suspend-hacks.patch    
2008-02-27 12:56:41 UTC (rev 4121)
@@ -0,0 +1,33 @@
+Index: linux-2.6.24/drivers/i2c/chips/pcf50633.c
+===================================================================
+--- linux-2.6.24.orig/drivers/i2c/chips/pcf50633.c
++++ linux-2.6.24/drivers/i2c/chips/pcf50633.c
+@@ -567,8 +567,26 @@ static void pcf50633_work(struct work_st
+        */
+       ret = i2c_smbus_read_i2c_block_data(&pcf->client, PCF50633_REG_INT1, 5,
+                                           pcfirq);
+-      if (ret != 5)
+-              DEBUGP("Oh crap PMU IRQ register read failed %d\n", ret);
++      if (ret != 5) {
++              DEBUGP("Oh crap PMU IRQ register read failed -- "
++                     "retrying later %d\n", ret);
++              /*
++               * this situation can happen during resume, just defer
++               * handling the interrupt until enough I2C is up we can
++               * actually talk to the PMU.  We can't just ignore this
++               * because we are on a falling edge interrupt and our
++               * PMU interrupt source does not clear until we read these
++               * interrupt source registers.
++               */
++              if (!schedule_work(&pcf->work) && !pcf->working)
++                      dev_dbg(&pcf->client.dev, "work item may be lost\n");
++
++              /* we don't put the device here, hold it for next time */
++              mutex_unlock(&pcf->working_lock);
++              /* don't spew, delaying whatever else is happening */
++              msleep(1);
++              return;
++      }
+ 
+       if (!pcf->coldplug_done) {
+               DEBUGP("PMU Coldplug init\n");

Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series  2008-02-27 07:36:29 UTC 
(rev 4120)
+++ branches/src/target/kernel/2.6.24.x/patches/series  2008-02-27 12:56:41 UTC 
(rev 4121)
@@ -46,6 +46,7 @@
 
 # gta02 feature set
 pcf50633.patch
+pcf50633-suspend-hacks.patch
 smedia-glamo.patch
 glamo-mmc.patch
 gta02-core.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-27 14:07:32 +0100 (Wed, 27 Feb 2008)
New Revision: 4122

Modified:
   trunk/src/host/devirginator/setup.sh
Log:
Fixed various silly bugs. Devirginating GTA02v5 now works. NOR is still
missing.

- setup.sh: progress is good, but the right word here really is "process"
- setup.sh: use new USB ID for GTA02
- setup.sh: "-s" was missing in env_size_opt
- setup.sh: unlike cpp, envedit.pl needs a space between -D and the token 



Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh        2008-02-27 12:56:41 UTC (rev 
4121)
+++ trunk/src/host/devirginator/setup.sh        2008-02-27 13:07:32 UTC (rev 
4122)
@@ -22,8 +22,9 @@
 #
 
 
-# USB ID of DFU target (Neo)
-USB_ID=-d1457:5119
+# USB ID of DFU target
+USB_ID_GTA01=-d1457:5119
+USB_ID_GTA02=-d1d50:5119
 
 mkdir -p tmp
 
@@ -305,8 +306,10 @@
 
 if [ "$PLATFORM" = gta01 ]; then
     env_size_opt=
+    usb_id=$USB_ID_GTA01
 else
-    env_size_opt=0x40000
+    env_size_opt="-s 0x40000"
+    usb_id=$USB_ID_GTA02
 fi
 
 cat <<EOF >devirginate
@@ -365,17 +368,17 @@
 if \$stage2; then
     echo === STAGE 2: DFU upload
     sleep 5
-    $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
+    $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
+    $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 $env_size_opt -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
+       -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
 
@@ -420,7 +423,7 @@
 - connect it to power and JTAG
 - switch it on
 - run ./devirginate
-- follow the progress, as described in README
+- follow the process, as described in README
 
 -------------------------------------------------------------------------------
 EOF




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-27 14:13:15 +0100 (Wed, 27 Feb 2008)
New Revision: 4123

Added:
   trunk/src/host/devirginator/config.gta02v5
Log:
Example devirginator configuration for GTA02v5.



Added: trunk/src/host/devirginator/config.gta02v5
===================================================================
--- trunk/src/host/devirginator/config.gta02v5  2008-02-27 13:07:32 UTC (rev 
4122)
+++ trunk/src/host/devirginator/config.gta02v5  2008-02-27 13:13:15 UTC (rev 
4123)
@@ -0,0 +1,20 @@
+#
+# config.gta02v5 - Devirginator configuration file
+#
+# This is a shell script sourced by "setup.sh".
+#
+
+OPENOCD_HOST=localhost
+PLATFORM=gta02
+BOARD=v5
+
+stuff=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/
+
+LOWLEVEL=$stuff/lowlevel-foo-$PLATFORM$BOARD-latest.bin
+UBOOT=$stuff/uboot-$PLATFORM$BOARD-latest.bin
+UIMAGE=$stuff/uImage-neo1973-latest.bin
+ROOTFS=$stuff/openmoko-devel-image-fic-$PLATFORM.jffs2
+
+DFU_UTIL=$stuff/dfu-util
+#OPENOCD=$stuff/openocd
+OPENOCD_CFG=http://people.openmoko.org/werner/openocd.cfg




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-28 05:12:43 +0100 (Thu, 28 Feb 2008)
New Revision: 4124

Modified:
   branches/src/target/kernel/2.6.24.x/patches/series
Log:
The initialization of clocks uses mutexes, but we execute the resume in
an interrupt context. We therefore have to hand this task to a non-interrupt.

Adapted from a patch by Andy Green.

resume-timers-wq.patch:
- arch/arm/plat-s3c24xx/time.c (s3c24xx_timer): for resume, call new function
  s3c2410_timer_resume instead of s3c2410_timer_setup
- arch/arm/plat-s3c24xx/time.c (s3c2410_timer_resume, 
  s3c2410_timer_resume_work): run s3c2410_timer_setup via a workqueue



Modified: branches/src/target/kernel/2.6.24.x/patches/series
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/series  2008-02-27 13:13:15 UTC 
(rev 4123)
+++ branches/src/target/kernel/2.6.24.x/patches/series  2008-02-28 04:12:43 UTC 
(rev 4124)
@@ -5,8 +5,9 @@
 asoc-neo1973_wm8753-power.patch
 asoc-core-suspend_resume.patch
 
-# this looks like a bug in upstream
+# these looks like bugs in upstream
 fix-i2c-s3c2410-resume-race.patch
+resume-timers-wq.patch
 
 # GTA01 core feature set
 s3c2410-bbt.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-28 05:20:40 +0100 (Thu, 28 Feb 2008)
New Revision: 4125

Added:
   branches/src/target/kernel/2.6.24.x/patches/resume-timers-wq.patch
Log:
Oops, forgot to add the actual patch.



Added: branches/src/target/kernel/2.6.24.x/patches/resume-timers-wq.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/resume-timers-wq.patch  
2008-02-28 04:12:43 UTC (rev 4124)
+++ branches/src/target/kernel/2.6.24.x/patches/resume-timers-wq.patch  
2008-02-28 04:20:40 UTC (rev 4125)
@@ -0,0 +1,35 @@
+The initialization of clocks uses mutexes, but we execute the resume in
+an interrupt context. We therefore have to hand this task to a non-interrupt.
+
+Adapted from a patch by Andy Green.
+
+Index: linux-2.6.24/arch/arm/plat-s3c24xx/time.c
+===================================================================
+--- linux-2.6.24.orig/arch/arm/plat-s3c24xx/time.c
++++ linux-2.6.24/arch/arm/plat-s3c24xx/time.c
+@@ -255,8 +255,24 @@ static void __init s3c2410_timer_init (v
+       setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
+ }
+ 
++static void s3c2410_timer_resume_work(struct work_struct *work)
++{
++      s3c2410_timer_setup();
++}
++
++static void s3c2410_timer_resume(void)
++{
++      static DECLARE_WORK(work, s3c2410_timer_resume_work);
++      int res;
++
++      res = schedule_work(&work);
++      if (!res)
++              printk(KERN_ERR
++                  "s3c2410_timer_resume_work already queued ???\n");
++}
++
+ struct sys_timer s3c24xx_timer = {
+       .init           = s3c2410_timer_init,
+       .offset         = s3c2410_gettimeoffset,
+-      .resume         = s3c2410_timer_setup
++      .resume         = s3c2410_timer_resume,
+ };




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-28 10:42:58 +0100 (Thu, 28 Feb 2008)
New Revision: 4126

Added:
   trunk/src/host/devirginator/tests/recurse
Modified:
   trunk/src/host/devirginator/envedit.pl
   trunk/src/host/devirginator/environment.in
   trunk/src/host/devirginator/mknor
   trunk/src/host/devirginator/setup.sh
Log:
mknor: we don't need to set "mtdids" and "usbtty"
mknor: reduced boot_menu_timeout from 20 hours to 1 minute
environment.in, mknor: unified NOR and NAND environment in environment.in
environment.in: added boot from SD/MMC with a combined FAT+ext2 setup
environment.in: moved "Power off" to the end of the menu
environment.in: abstracted u-boot MMC device number
environment.in: let user override init=... (e.g., with -D INIT=/bin/sh) and the 
  name of the kernel file when booting from SD/MMC (e.g., with 
  -D SD_KERNEL=uImage.bin)
setup.sh: added option -l to use local files without accessing the network
setup.sh (usage): added description of options
envedit.pl: added comment that just "#define MACRO" is also valid
envedit.pl, tests/recurse: added support for cpp-like handling of recursive 
  macros



Modified: trunk/src/host/devirginator/envedit.pl
===================================================================
--- trunk/src/host/devirginator/envedit.pl      2008-02-28 04:20:40 UTC (rev 
4125)
+++ trunk/src/host/devirginator/envedit.pl      2008-02-28 09:42:58 UTC (rev 
4126)
@@ -33,6 +33,7 @@
 #
 # Macro expansion:
 #
+# #define MACRO
 # #define MACRO TEXT ...
 # MACRO
 # MACRO##TOKEN
@@ -151,6 +152,35 @@
 }
 
 
+sub expand
+{
+    local ($s, @key) = @_;
+    local ($tmp, $pre, $exp, $post);
+    local ($i, @tmp);
+
+    $tmp = "";
+    while (length $s) {
+       $pre = $s;
+       $exp = "";
+       $post = "";
+       for ($i = 0; $i <= $#key; $i++) {
+           @tmp = @key;
+           splice(@tmp, $i, 1);
+           if ($s =~ /(##)?\b$key[$i]\b(##)?/) {
+               if (length $` < length $pre) {
+                   $pre = $`;
+                   $post = $';
+                   $exp = &expand($def{$key[$i]}, @tmp);
+               }
+           }
+       }
+       $tmp .= $pre.$exp;
+       $s = $post;
+    }
+    return $tmp;
+}
+
+
 if ($0 =~ m#/[^/]*$#) {
     push(@INC, $`);
 }
@@ -254,24 +284,7 @@
                $def{$1} = $3;
            }
 
-           $tmp = "";
-           while (length $_) {
-               $pre = $_;
-               $exp = "";
-               $post = "";
-               for $def (keys %def) {
-                   if (/(##)?\b$def\b(##)?/) {
-                       if (length $` < length $pre) {
-                           $pre = $`;
-                           $exp = $def{$def};
-                           $post = $';
-                       }
-                   }
-               }
-               $tmp .= $pre.$exp;
-               $_ = $post;
-           }
-           $_ = $tmp;
+           $_ = &expand($_, keys %def);
 
            s/#.*//;
            s/\s*$//;

Modified: trunk/src/host/devirginator/environment.in
===================================================================
--- trunk/src/host/devirginator/environment.in  2008-02-28 04:20:40 UTC (rev 
4125)
+++ trunk/src/host/devirginator/environment.in  2008-02-28 09:42:58 UTC (rev 
4126)
@@ -12,22 +12,38 @@
 #define CONSOLE ttySAC2
 #define ROOTDEV /dev/mtdblock6
 #define FRAMEBUFFER 0x8800000
+#define MMC_NUM 1
 
 #else # GTA01
 
 #define CONSOLE ttySAC0
 #define ROOTDEV /dev/mtdblock4
 #define FRAMEBUFFER 0x33d00000
+#define MMC_NUM 0
 
 #endif
 
+#ifdef INIT
+#define INIT_OPT init=INIT
+#else
+#define INIT_OPT
+#endif
 
+#ifndef SD_KERNEL
+#define SD_KERNEL uImage
+#endif
+
+
+##### Common settings #########################################################
+
+
 bootargs_base=
   rootfstype=jffs2
   root=ROOTDEV
   console=CONSOLE,115200
   console=tty0
   loglevel=8
+  INIT_OPT
   regular_boot
 
 bootcmd=
@@ -35,6 +51,23 @@
   nand read.e 0x32000000 kernel 0x200000;
   bootm 0x32000000
 
+stdout=usbtty
+stderr=usbtty
+stdin=usbtty
+
+sd_image_name=SD_KERNEL
+
+
+##### Appearance and mode of interaction ######################################
+
+
+#ifdef NOR
+
+bootdelay=5
+boot_menu_timeout=60
+
+#else
+
 bootdelay=1
 
 quiet=1
@@ -43,39 +76,67 @@
   nand read.e 0x32000000 splash 0x5000;
   unzip 0x32000000 FRAMEBUFFER 0x96000
 
-stdout=usbtty
-stderr=usbtty
-stdin=usbtty
+#endif
 
-sd_image_name=uImage
 
+##### Menu items ##############################################################
+
+
 menu_1=
-  Boot from microSD:
+  Boot from microSD (FAT+ext2):
   setenv bootargs
+    ${bootargs_base} rootfstype=ext2 rootfs=/dev/mmcblk0p2 rootdelay=5
+    ${mtdparts} ro;
+  mmcinit;
+  fatload mmc MMC_NUM 0x32000000 ${sd_image_name};
+  bootm 0x32000000
+
+menu_2=
+  Boot from microSD (ext2):
+  setenv bootargs
     ${bootargs_base} rootfstype=ext2 rootfs=/dev/mmcblk0p1 rootdelay=5
     ${mtdparts} ro;
   mmcinit;
-  ext2load mmc 0 0x32000000 /boot/${sd_image_name};
+  ext2load mmc MMC_NUM 0x32000000 /boot/${sd_image_name};
   bootm 0x32000000
 
-menu_2=
+#ifdef NOR
+
+menu_3=
+  Copy u-boot from NOR to NAND:
+  cp.l 0x18000000 0x32000000 0x10000;
+  mw.l 0x32000040 0 2;
+  nand write.e 0x32000000 0 0x40000;
+  dynenv set u-boot_env
+
+#endif
+
+menu_4=
   Set console to USB:
   setenv stdin usbtty;
   setenv stdout usbtty;
   setenv stderr usbtty
 
-menu_3=
+menu_5=
   Set console to serial:
   setenv stdin serial;
   setenv stdout serial;
   setenv stderr serial
 
-menu_4=
-  Power off:
-  neo1973 power-off
+menu_6=
+  Reset:
+  reset
 
-menu_5=
+#ifdef UNUSED
+
+menu_7=
   Factory reset:
   defaultenv;
   dynpart;
   bootd
+
+#endif
+
+menu_8=
+  Power off:
+  neo1973 power-off

Modified: trunk/src/host/devirginator/mknor
===================================================================
--- trunk/src/host/devirginator/mknor   2008-02-28 04:20:40 UTC (rev 4125)
+++ trunk/src/host/devirginator/mknor   2008-02-28 09:42:58 UTC (rev 4126)
@@ -58,60 +58,8 @@
   ../splash/splashimg.pl -pnm - |
   gzip -9 >_splash
 
-./envedit.pl -f - -o _env <<EOF
-mtdids=nor0=physmap-flash,nand0=neo1973-nand
+./envedit.pl -D GTA02 -D NOR -f environment.in -o _env
 
-stdin=usbtty
-stdout=usbtty
-stderr=usbtty
-
-bootdelay=5
-
-usbtty=cdc_acm
-
-boot_menu_timeout=72000
-
-bootargs_base=
-  rootfstype=jffs2
-  root=/dev/mtdblock6
-  console=ttySAC2,115200
-  console=tty0
-  loglevel=8
-  regular_boot
-
-bootcmd=
-  setenv bootargs \${bootargs_base} \${mtdparts};
-  nand read.e 0x32000000 kernel 0x200000;
-  bootm 0x32000000
-
-menu_1=
-  Copy u-boot from NOR to NAND:
-  cp.l 0x18000000 0x32000000 0x10000;
-  mw.l 0x32000040 0 2;
-  nand write.e 0x32000000 0 0x40000;
-  dynenv set u-boot_env
-
-menu_2=
-  Set console to USB:
-  setenv stdin usbtty;
-  setenv stdout usbtty;
-  setenv stderr usbtty
-
-menu_3=
-  Set console to serial:
-  setenv stdin serial;
-  setenv stdout serial;
-  setenv stderr serial
-
-menu_4=
-  Reset:
-  reset
-
-menu_5=
-  Power off:
-  neo1973 power-off
-EOF
-
 ./blink.pl \
   /home/moko/2624/u-boot/[EMAIL PROTECTED] \
   [EMAIL PROTECTED] \

Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh        2008-02-28 04:20:40 UTC (rev 
4125)
+++ trunk/src/host/devirginator/setup.sh        2008-02-28 09:42:58 UTC (rev 
4126)
@@ -26,6 +26,8 @@
 USB_ID_GTA01=-d1457:5119
 USB_ID_GTA02=-d1d50:5119
 
+DEFAULT_CONFIG=config
+
 mkdir -p tmp
 
 
@@ -34,15 +36,25 @@
 
 download()
 {
+    base="`basename \"$2\"`"
+
+    # if it is a local file, just use it
     if [ -r "$2" ]; then
        if $tarball; then
-           base="`basename \"$2\"`"
            cp "$2" "tmp/$base"
            eval $1=\"tmp/$base\"
            add_file "tmp/$base"
        fi
        return
     fi
+
+    # don't look for updates if we can use cached files
+    if [ -r "tmp/$base" ] && $local; then
+       eval $1=\"tmp/$base\"
+       add_file "tmp/$base"
+       return
+    fi
+
     index=tmp/index-${SNAPSHOT}.html
     rm -f $index
     wget -O $index "`dirname \"$2\"`/"
@@ -108,13 +120,20 @@
 
 usage()
 {
-    echo "usage: $0 [-c config_file] [-t] [variable=value ...]" 1>&2
+cat <<EOF 1>&2
+usage: $0 [-c config_file] [-l] [-t] [variable=value ...]
+
+  -c config_file  use the specified file (default: $DEFAULT_CONFIG)
+  -l              use locally cached files (in tmp/), if present
+  -t              make a tarball of all the downloaded and generated files
+EOF
     exit 1
 }
 
 
 tarball=false
-config=config
+local=false
+config=$DEFAULT_CONFIG
 
 while [ ! -z "$*" ]; do
     case "$1" in
@@ -122,6 +141,7 @@
                [ ! -z "$1" ] || usage
                config=$1;;
        -t)     tarball=true;;
+       -l)     local=true;;
        *=*)    eval "$1";;
        *)      usage;;
     esac

Added: trunk/src/host/devirginator/tests/recurse
===================================================================
--- trunk/src/host/devirginator/tests/recurse   2008-02-28 04:20:40 UTC (rev 
4125)
+++ trunk/src/host/devirginator/tests/recurse   2008-02-28 09:42:58 UTC (rev 
4126)
@@ -0,0 +1,62 @@
+#!/bin/sh
+. Common
+
+# -----------------------------------------------------------------------------
+
+setup "macro within macro" <<EOF
+EOF
+
+edit -D bar=blah -p <<EOF
+#define foo bar
+a=foo
+EOF
+
+expect <<EOF
+a=blah
+EOF
+
+# -----------------------------------------------------------------------------
+
+setup "macro within macro within macro" <<EOF
+EOF
+
+edit -p <<EOF
+#define a b
+#define c d
+#define b c
+a=foo
+EOF
+
+expect <<EOF
+d=foo
+EOF
+
+# -----------------------------------------------------------------------------
+
+setup "self-recursive macro" <<EOF
+EOF
+
+edit -p <<EOF
+#define foo foo
+a=foo
+EOF
+
+expect <<EOF
+a=foo
+EOF
+
+# -----------------------------------------------------------------------------
+
+setup "two-macro recursion" <<EOF
+EOF
+
+edit -p <<EOF
+#define foo bar
+#define bar blah
+#define blah bar
+a=foo
+EOF
+
+expect <<EOF
+a=bar
+EOF


Property changes on: trunk/src/host/devirginator/tests/recurse
___________________________________________________________________
Name: svn:executable
   + *




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-28 11:15:47 +0100 (Thu, 28 Feb 2008)
New Revision: 4127

Modified:
   trunk/src/host/devirginator/environment.in
   trunk/src/host/devirginator/mknor
   trunk/src/host/devirginator/setup.sh
Log:
setup.sh: added support to passing cpp-style definitions with the option -D to
  cpp and envedit.pl
environment.in, mknor: renamed option NOR to NOR_ENV, to avoid conflict with 
  use of the word "NOR" in text



Modified: trunk/src/host/devirginator/environment.in
===================================================================
--- trunk/src/host/devirginator/environment.in  2008-02-28 09:42:58 UTC (rev 
4126)
+++ trunk/src/host/devirginator/environment.in  2008-02-28 10:15:47 UTC (rev 
4127)
@@ -61,7 +61,7 @@
 ##### Appearance and mode of interaction ######################################
 
 
-#ifdef NOR
+#ifdef NOR_ENV
 
 bootdelay=5
 boot_menu_timeout=60
@@ -100,7 +100,7 @@
   ext2load mmc MMC_NUM 0x32000000 /boot/${sd_image_name};
   bootm 0x32000000
 
-#ifdef NOR
+#ifdef NOR_ENV
 
 menu_3=
   Copy u-boot from NOR to NAND:

Modified: trunk/src/host/devirginator/mknor
===================================================================
--- trunk/src/host/devirginator/mknor   2008-02-28 09:42:58 UTC (rev 4126)
+++ trunk/src/host/devirginator/mknor   2008-02-28 10:15:47 UTC (rev 4127)
@@ -58,7 +58,7 @@
   ../splash/splashimg.pl -pnm - |
   gzip -9 >_splash
 
-./envedit.pl -D GTA02 -D NOR -f environment.in -o _env
+./envedit.pl -D GTA02 -D NOR_ENV -f environment.in -o _env
 
 ./blink.pl \
   /home/moko/2624/u-boot/[EMAIL PROTECTED] \

Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh        2008-02-28 09:42:58 UTC (rev 
4126)
+++ trunk/src/host/devirginator/setup.sh        2008-02-28 10:15:47 UTC (rev 
4127)
@@ -95,7 +95,8 @@
 
 cppify()
 {
-    sed '/^#[a-z]/{n;};s/#.*$//' | cpp -D$U_PLATFORM -D$U_PLATFORM$U_BOARD
+    sed '/^#[a-z]/{n;};s/#.*$//' | 
+      cpp -D$U_PLATFORM -D$U_PLATFORM$U_BOARD $defines
 }
 
 
@@ -121,11 +122,12 @@
 usage()
 {
 cat <<EOF 1>&2
-usage: $0 [-c config_file] [-l] [-t] [variable=value ...]
+usage: $0 [-c config_file] [-l] [-t] [-Dvar[=value]] [variable=value ...]
 
   -c config_file  use the specified file (default: $DEFAULT_CONFIG)
   -l              use locally cached files (in tmp/), if present
   -t              make a tarball of all the downloaded and generated files
+  -D var[=value]  pass a cpp-style -D option to cpp and envedit.pl
 EOF
     exit 1
 }
@@ -134,6 +136,7 @@
 tarball=false
 local=false
 config=$DEFAULT_CONFIG
+defines=
 
 while [ ! -z "$*" ]; do
     case "$1" in
@@ -142,6 +145,10 @@
                config=$1;;
        -t)     tarball=true;;
        -l)     local=true;;
+       -D)     shift
+               [ ! -z "$1" ] || usage
+               defines="$defines -D $1"
+               ;;
        *=*)    eval "$1";;
        *)      usage;;
     esac
@@ -397,7 +404,7 @@
       "reset halt" wait_halt resume exit
     sleep 5
     ./envedit.pl $env_size_opt -i tmp/env.old -o tmp/env.new \
-       -D $U_PLATFORM -D $U_PLATFORM$U_BOARD -f tmp/environment
+       -D $U_PLATFORM -D $U_PLATFORM$U_BOARD $defines -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




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to