summaryrefslogtreecommitdiffstats
path: root/meta/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch')
-rw-r--r--meta/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch b/meta/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
new file mode 100644
index 0000000000..a5800e2499
--- /dev/null
+++ b/meta/packages/uboot/u-boot-mkimage-openmoko-native/nand-badisbad.patch
@@ -0,0 +1,30 @@
1This patch makes nand_block_checkbad check both the BBT and the actual
2OOB data. This avoids accidently passing blocks as good when BBT and
3OOB markers are not synchronized, e.g., before "nand createbbt".
4
5Experimental.
6
7- Werner Almesberger <werner@openmoko.org>
8
9Index: u-boot/drivers/nand/nand_base.c
10===================================================================
11--- u-boot.orig/drivers/nand/nand_base.c
12+++ u-boot/drivers/nand/nand_base.c
13@@ -517,11 +517,14 @@ static int nand_block_checkbad (struct m
14 {
15 struct nand_chip *this = mtd->priv;
16
17- if (!this->bbt)
18- return this->block_bad(mtd, ofs, getchip);
19+ if (this->block_bad(mtd, ofs, getchip))
20+ return 1;
21
22 /* Return info from the table */
23- return nand_isbad_bbt (mtd, ofs, allowbbt);
24+ if (this->bbt && nand_isbad_bbt (mtd, ofs, allowbbt))
25+ return 1;
26+
27+ return 0;
28 }
29
30 /**