linux-dm8000: add nand flash driver fix (this fixes mtd/jffs2 ecc error messages...
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 10 Feb 2011 16:29:37 +0000 (17:29 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 10 Feb 2011 16:29:37 +0000 (17:29 +0100)
recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-dm8000-nand-smp-fix.patch [new file with mode: 0644]
recipes/linux/linux-dm8000_2.6.18.bb

diff --git a/recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-dm8000-nand-smp-fix.patch b/recipes/linux/linux-dm8000-2.6.18/linux-2.6.18-dm8000-nand-smp-fix.patch
new file mode 100644 (file)
index 0000000..801e6d6
--- /dev/null
@@ -0,0 +1,42 @@
+--- linux-2.6.18-org/drivers/mtd/nand/dm8000_nand.c    2010-10-18 22:40:58.000000000 +0200
++++ linux-2.6.18/drivers/mtd/nand/dm8000_nand.c        2011-02-09 19:23:15.808489533 +0100
+@@ -16,6 +16,7 @@
+  *
+  */
++#include <linux/delay.h>
+ #include <linux/jiffies.h>
+ #include <linux/slab.h>
+ #include <linux/module.h>
+@@ -61,16 +62,24 @@
+ };
+ #define NUM_PARTITIONS 7
++static int dm8000_nand_dev_ready(struct mtd_info *mtd);
++
+ static void dm8000_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+ {
+-      if (ctrl & NAND_CTRL_CHANGE) {
+-              if (!(ctrl & NAND_NCE))
+-                      writeb(0, (void __iomem *)0xBF030003);
+-              //else
+-              //      readb((void __iomem *)0xBF030002);
+-      }
+-      if (cmd == NAND_CMD_NONE)
++      if (ctrl & NAND_CTRL_CHANGE && !(ctrl & NAND_NCE))
++              writeb(0, (void __iomem *)0xBF030003);
++
++      if (cmd == NAND_CMD_NONE) {
++#ifdef CONFIG_SMP
++              struct nand_chip *this = (struct nand_chip *)(dm8000_mtd+1);
++              int cnt=0;
++              while (cnt < this->chip_delay && !dm8000_nand_dev_ready(mtd)) {
++                      ++cnt;
++                      udelay(1);
++              }
++#endif
+               return;
++      }
+       if (ctrl & NAND_CLE)
+               writeb(cmd, (void __iomem *)0xBF030000);
index f86030e..2428b6d 100644 (file)
@@ -1,7 +1,8 @@
 require linux-opendreambox-2.6.18.inc
 
-PR="${PR_INC}.0"
+PR="${PR_INC}.1"
 
 SRC_URI += "\
        file://linux-2.6.18-disable-unneeded-uarts.patch;patch=1 \
+       file://linux-2.6.18-dm8000-nand-smp-fix.patch;patch=1 \
 "