r929 - trunk/src/target/u-boot/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Fri Feb 9 07:36:30 CET 2007
Author: werner
Date: 2007-02-09 07:36:26 +0100 (Fri, 09 Feb 2007)
New Revision: 929
Added:
trunk/src/target/u-boot/patches/nand-badisbad.patch
trunk/src/target/u-boot/patches/uboot-strtoul.patch
Modified:
trunk/src/target/u-boot/patches/series
Log:
uboot-strtoul.patch: Harald's uppercase hex fixes for strtoul
nand-badisbad.patch: make nand_block_checkbad check both the BBT and the actual
OOB data
Added: trunk/src/target/u-boot/patches/nand-badisbad.patch
===================================================================
--- trunk/src/target/u-boot/patches/nand-badisbad.patch 2007-02-09 03:52:54 UTC (rev 928)
+++ trunk/src/target/u-boot/patches/nand-badisbad.patch 2007-02-09 06:36:26 UTC (rev 929)
@@ -0,0 +1,30 @@
+This patch makes nand_block_checkbad check both the BBT and the actual
+OOB data. This avoids accidently passing blocks as good when BBT and
+OOB markers are not synchronized, e.g., before "nand createbbt".
+
+Experimental.
+
+- Werner Almesberger <werner at openmoko.org>
+
+Index: u-boot/drivers/nand/nand_base.c
+===================================================================
+--- u-boot.orig/drivers/nand/nand_base.c
++++ u-boot/drivers/nand/nand_base.c
+@@ -517,11 +517,14 @@ static int nand_block_checkbad (struct m
+ {
+ struct nand_chip *this = mtd->priv;
+
+- if (!this->bbt)
+- return this->block_bad(mtd, ofs, getchip);
++ if (this->block_bad(mtd, ofs, getchip))
++ return 1;
+
+ /* Return info from the table */
+- return nand_isbad_bbt (mtd, ofs, allowbbt);
++ if (this->bbt && nand_isbad_bbt (mtd, ofs, allowbbt))
++ return 1;
++
++ return 0;
+ }
+
+ /**
Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series 2007-02-09 03:52:54 UTC (rev 928)
+++ trunk/src/target/u-boot/patches/series 2007-02-09 06:36:26 UTC (rev 929)
@@ -22,3 +22,5 @@
bbt-create-optional.patch
nand-createbbt.patch
uboot-mokoversion.patch
+uboot-strtoul.patch
+nand-badisbad.patch
Added: trunk/src/target/u-boot/patches/uboot-strtoul.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-strtoul.patch 2007-02-09 03:52:54 UTC (rev 928)
+++ trunk/src/target/u-boot/patches/uboot-strtoul.patch 2007-02-09 06:36:26 UTC (rev 929)
@@ -0,0 +1,41 @@
+Make simple_strtoul work with upper-case hex numbers.
+
+Index: u-boot/lib_generic/vsprintf.c
+===================================================================
+--- u-boot.orig/lib_generic/vsprintf.c
++++ u-boot/lib_generic/vsprintf.c
+@@ -25,21 +25,22 @@ unsigned long simple_strtoul(const char
+ {
+ unsigned long result = 0,value;
+
+- if (*cp == '0') {
+- cp++;
+- if ((*cp == 'x') && isxdigit(cp[1])) {
+- base = 16;
+- cp++;
+- }
+- if (!base) {
+- base = 8;
+- }
+- }
+ if (!base) {
+ base = 10;
++ if (*cp == '0') {
++ base = 8;
++ cp++;
++ if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
++ cp++;
++ base = 16;
++ }
++ }
++ } else if (base == 16) {
++ if (cp[0] == '0' && toupper(cp[1]) == 'X')
++ cp += 2;
+ }
+- while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
+- ? toupper(*cp) : *cp)-'A'+10) < base) {
++ while (isxdigit(*cp) &&
++ (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
+ result = result*base + value;
+ cp++;
+ }
More information about the commitlog
mailing list