Send commitlog mailing list submissions to
        [email protected]

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. r1067 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   2. r1068 - developers/werner ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2007-02-21 03:52:39 +0100 (Wed, 21 Feb 2007)
New Revision: 1067

Added:
   trunk/src/target/u-boot/patches/dynenv-harden.patch
Modified:
   trunk/src/target/u-boot/patches/series
Log:
common/cmd_nand.c: globalized arg_off_size
include/util.h: new header to convenience functions, such as arg_off_size
common/cmd_dynenv.c (do_dynenv): use arg_off_size to sanity-check offset and to
  allow use of partition name
common/cmd_dynenv.c (do_dynenv): indicate in no uncertain terms when an update
  would not work due to Flash bits already cleared



Added: trunk/src/target/u-boot/patches/dynenv-harden.patch
===================================================================
--- trunk/src/target/u-boot/patches/dynenv-harden.patch 2007-02-21 01:11:02 UTC 
(rev 1066)
+++ trunk/src/target/u-boot/patches/dynenv-harden.patch 2007-02-21 02:52:39 UTC 
(rev 1067)
@@ -0,0 +1,128 @@
+common/cmd_nand.c: globalized arg_off_size
+include/util.h: new header to convenience functions, such as arg_off_size
+common/cmd_dynenv.c (do_dynenv): use arg_off_size to sanity-check offset and to
+  allow use of partition name
+common/cmd_dynenv.c (do_dynenv): indicate in no uncertain terms when an update
+  would not work due to Flash bits already cleared
+
+- Werner Almesberger <[EMAIL PROTECTED]>
+
+Index: u-boot/common/cmd_nand.c
+===================================================================
+--- u-boot.orig/common/cmd_nand.c
++++ u-boot/common/cmd_nand.c
+@@ -100,7 +100,7 @@ static inline int str2long(char *p, ulon
+       return (*p != '\0' && *endptr == '\0') ? 1 : 0;
+ }
+ 
+-static int
++int
+ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong 
*size)
+ {
+       int idx = nand_curr_device;
+Index: u-boot/include/util.h
+===================================================================
+--- /dev/null
++++ u-boot/include/util.h
+@@ -0,0 +1,33 @@
++/*
++ * util.h - Convenience functions
++ *
++ * (C) Copyright 2006-2007 OpenMoko, Inc.
++ * Author: Werner Almesberger <[EMAIL PROTECTED]>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#ifndef UTIL_H
++#define UTIL_H
++
++#include "nand.h"
++
++
++/* common/cmd_nand.c */
++int arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off,
++  ulong *size);
++
++#endif /* UTIL_H */
+Index: u-boot/common/cmd_dynenv.c
+===================================================================
+--- u-boot.orig/common/cmd_dynenv.c
++++ u-boot/common/cmd_dynenv.c
+@@ -23,6 +23,7 @@
+ #include <malloc.h>
+ #include <environment.h>
+ #include <nand.h>
++#include <util.h>
+ #include <asm/errno.h>
+ 
+ #if defined(CFG_ENV_OFFSET_OOB)
+@@ -39,8 +40,8 @@ int do_dynenv(cmd_tbl_t *cmdtp, int flag
+       if (!buf)
+               return -ENOMEM;
+ 
++      ret = mtd->read_oob(mtd, 8, size, (size_t *) &size, (u_char *) buf);
+       if (!strcmp(cmd, "get")) {
+-              ret = mtd->read_oob(mtd, 8, size, (size_t *) &size, (u_char *) 
buf);
+ 
+               if (buf[0] == 'E' && buf[1] == 'N' &&
+                   buf[2] == 'V' && buf[3] == '0')
+@@ -49,7 +50,8 @@ int do_dynenv(cmd_tbl_t *cmdtp, int flag
+                       printf("No dynamic environment marker in OOB block 
0\n");
+ 
+       } else if (!strcmp(cmd, "set")) {
+-              unsigned long addr;
++              unsigned long addr, dummy;
++
+               if (argc < 3)
+                       goto usage;
+ 
+@@ -57,7 +59,23 @@ int do_dynenv(cmd_tbl_t *cmdtp, int flag
+               buf[1] = 'N';
+               buf[2] = 'V';
+               buf[3] = '0';
+-              addr = simple_strtoul(argv[2], NULL, 16);
++
++              if (arg_off_size(argc-2, argv+2, mtd, &addr, &dummy) < 0) {
++                      printf("Offset or partition name expected\n");
++                      goto fail;
++              }
++              if (!ret) {
++                      uint8_t tmp[4];
++                      int i;
++
++                      memcpy(&tmp, &addr, 4);
++                      for (i = 0; i != 4; i++)
++                              if (tmp[i] & ~buf[i+4]) {
++                                      printf("ERROR: erase OOB block to "
++                                        "write this value\n");
++                                      goto fail;
++                              }
++              }
+               memcpy(buf+4, &addr, 4);
+ 
+               printf("%02x %02x %02x %02x - %02x %02x %02x %02x\n",
+@@ -72,8 +90,9 @@ int do_dynenv(cmd_tbl_t *cmdtp, int flag
+       return ret;
+ 
+ usage:
+-      free(buf);
+       printf("Usage:\n%s\n", cmdtp->usage);
++fail:
++      free(buf);
+       return 1;
+ }
+ 

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2007-02-21 01:11:02 UTC (rev 
1066)
+++ trunk/src/target/u-boot/patches/series      2007-02-21 02:52:39 UTC (rev 
1067)
@@ -42,3 +42,5 @@
 splashimage-command.patch
 cmd-unzip.patch
 enable-splash-bmp.patch
+
+dynenv-harden.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2007-02-21 04:00:42 +0100 (Wed, 21 Feb 2007)
New Revision: 1068

Modified:
   developers/werner/TODO
Log:
Feb 20 updates



Modified: developers/werner/TODO
===================================================================
--- developers/werner/TODO      2007-02-21 02:52:39 UTC (rev 1067)
+++ developers/werner/TODO      2007-02-21 03:00:42 UTC (rev 1068)
@@ -1,8 +1,8 @@
 IRC/neo-devel:
 - kick off bad block migration with all other phase -1 developers
 
-neo-devel:
-- phase 0 default environment draft
+planning/design:
+- phase 0 default environment draft (neo-devel)
 
 Mickey:
 - ask for quick walk-through review
@@ -13,9 +13,7 @@
 bugzilla:
   P0
   - #79: suspend/resume to RAM support
-  - #14: bootloader should display startup image before booting
     (as early as possible, i.e., even before LCM is up)
-  - #40: test + debug display of image on LCM in u-boot 
   - #178: u-boot 'factory reset' option
   P1
   - #164: improve non-SanDisk microSD support in u-boot 
@@ -23,29 +21,32 @@
 
 other:
 - test V-360 headset
+- set up automated build tests on buildhost-old
+  - check: does default build yield old or new sjf ? if new, update
+    Building_OpenMoko_from_scratch#Flash_boot_loader_into_NAND
+- once SVN opens, check that build passes without prompting for certificates or
+  authentication. then update Building_OpenMoko_from_scratch#OpenEmbedded_build
+- local: make fs ("lab") boot into Gentoo directly
+
+u-boot:
 - set up openocd and familiarize with it (-> update wiki)
 - u-boot: start.S: boot from RAM with relocation
-- GTA01Bv2 # dynenv set u-boot_env
-  45 4e 56 30 - 00 00 00 00
-  *OUCH* !
 - bbt migration & walk-through: future updates
   - update for debug v2
   - switch from wiggler to openocd
   - all boards will be v3 or later, so mention battery in
     Building_OpenMoko_from_scratch#Start_the_Neo_and_enter_the_boot_prompt
 - u-boot: fix weird "product name" after "mmc[init]"
-- set up automated build tests on buildhost-old
-  - check: does default build yield old or new sjf ? if new, update
-    Building_OpenMoko_from_scratch#Flash_boot_loader_into_NAND
 - write "intelligent" serial/USB console tool
-- once SVN opens, check that build passes without prompting for certificates or
-  authentication. then update Building_OpenMoko_from_scratch#OpenEmbedded_build
 - u-boot: make fatload behave like ext2load (hex output, ${filesize})
-- connect charger when off -> show battery gauge
+- idea: connect charger when off -> show battery gauge
 - check and report IMEI
   https://wiki.internal.openmoko.org/wiki/Bluetooth_MAC_Assignments
-- buy and try battery
-- u-boot NAND update also removes environment offset. document or fix this ?
+- u-boot NAND update also removes environment offset. Documented it. Fix it,
+  too ?
+- nice to have: make u-boot detect at run-time if it's booting from RAM or NAND
+- check that we don't have hidden power-on sequences (e.g., USB disconnect)
+- board/neo1973/neo1973.c: start LCD first, to avoid white flash
 
 --- Feb 13 --------------------------------------------------------------------
 
@@ -53,7 +54,7 @@
 - check (non-)use of BB_COLLECTIONS (do I have to care ?) [mickey says it's ok]
 - check walk-through exceptions [mickey says keep them]
 - put shipping instructions on Wiki
-- complete bad block migration
+- complete bad block migration (mickey)
 
 --- Feb 14 --------------------------------------------------------------------
 
@@ -72,3 +73,14 @@
 - bbt migration & walk-through: clone and merge
   - nand flashing: do gradual erases (env, kernel, etc.), use partition names
     and ${filesize}
+- buy and try battery
+
+(Not much happened for a while, 'cause some flu bug had other plans for me.)
+
+--- Feb 20 --------------------------------------------------------------------
+
+  - #14: bootloader should display startup image before booting
+  - #40: test + debug display of image on LCM in u-boot 
+- GTA01Bv2 # dynenv set u-boot_env
+  45 4e 56 30 - 00 00 00 00
+  *OUCH* !




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to