summaryrefslogtreecommitdiff
path: root/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openembedded.org>2007-08-09 08:41:19 +0000
committerMarcin Juszkiewicz <hrw@openembedded.org>2007-08-09 08:41:19 +0000
commit9d829ed05c295df608b4fc108eb1c628fd06fd39 (patch)
treec1b27cfe4498f8abef1a61325922906f3e6a32ff /packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
parent1434b204e16e87b7f59f074f3036d5dcbcf0116f (diff)
parent6ccac10beeaaa02a86081bd6179fd57c208ad6b1 (diff)
merge of '76e1e69496801009ea0aa69c84f76e858978ab99'
and 'db976a98427dd6a195e2cf167e225de2d0206aea'
Diffstat (limited to 'packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch')
-rw-r--r--packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch b/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
new file mode 100644
index 0000000000..a5800e2499
--- /dev/null
+++ b/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
@@ -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@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;
+ }
+
+ /**