aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux/acern30/n30-nand-hack.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/linux/linux/acern30/n30-nand-hack.patch')
-rw-r--r--recipes/linux/linux/acern30/n30-nand-hack.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes/linux/linux/acern30/n30-nand-hack.patch b/recipes/linux/linux/acern30/n30-nand-hack.patch
new file mode 100644
index 0000000000..d606f2b47c
--- /dev/null
+++ b/recipes/linux/linux/acern30/n30-nand-hack.patch
@@ -0,0 +1,32 @@
+The flash is locked on the n30 and needs to be unlocked before every
+write. It should be possible to do one big unlock operation outside
+of the erase and write functions but for some strange reason that
+doesn't seem to work any more, so do this ugly workaround for now.
+
+Index: linux-2.6.14/drivers/mtd/nand/nand_base.c
+===================================================================
+--- linux-2.6.14.orig/drivers/mtd/nand/nand_base.c
++++ linux-2.6.14/drivers/mtd/nand/nand_base.c
+@@ -866,6 +866,10 @@ static int nand_write_page (struct mtd_i
+ /* FIXME: Enable cached programming */
+ cached = 0;
+
++ /* unlock the page */
++ this->cmdfunc (mtd, 0x23, -1, page);
++ this->cmdfunc (mtd, 0x24, -1, page);
++
+ /* Send command to begin auto page programming */
+ this->cmdfunc (mtd, NAND_CMD_SEQIN, 0x00, page);
+
+@@ -2037,6 +2041,11 @@ out:
+ static void single_erase_cmd (struct mtd_info *mtd, int page)
+ {
+ struct nand_chip *this = mtd->priv;
++
++ /* unlock the page */
++ this->cmdfunc (mtd, 0x23, -1, page);
++ this->cmdfunc (mtd, 0x24, -1, page);
++
+ /* Send commands to erase a block */
+ this->cmdfunc (mtd, NAND_CMD_ERASE1, -1, page);
+ this->cmdfunc (mtd, NAND_CMD_ERASE2, -1, -1);