Patchwork mxc_nand: preset_v1_v2: unlock all NAND flash blocks

login
register
mail settings
Submitter Michael Thalmeier
Date Sept. 23, 2011, 11:53 a.m.
Message ID <1316778824-12518-1-git-send-email-michael.thalmeier@hale.at>
Download mbox | patch
Permalink /patch/116047/
State New
Headers show

Comments

Michael Thalmeier - Sept. 23, 2011, 11:53 a.m.
From: Wolfram Stering <wolfram.stering@hale.at>

For NFC v1, the unlock end block address was 0x4000, which would only
unlock the first 32 blocks of the NAND flash.  Change that value to
0xffff to unlock all available blocks, as is done for NFC v21 as well.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
---
 drivers/mtd/nand/mxc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - Sept. 26, 2011, 7:03 a.m.
On Fri, 2011-09-23 at 13:53 +0200, Michael Thalmeier wrote:
> From: Wolfram Stering <wolfram.stering@hale.at>
> 
> For NFC v1, the unlock end block address was 0x4000, which would only
> unlock the first 32 blocks of the NAND flash.  Change that value to
> 0xffff to unlock all available blocks, as is done for NFC v21 as well.
> 
> Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>

Pushed to l2-mtd-2.6.git tree, thanks!

Patch

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 90df34c..5b40786 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -849,7 +849,7 @@  static void preset_v1_v2(struct mtd_info *mtd)
 		writew(0xffff, NFC_V21_UNLOCKEND_BLKADDR3);
 	} else if (nfc_is_v1()) {
 		writew(0x0, NFC_V1_UNLOCKSTART_BLKADDR);
-		writew(0x4000, NFC_V1_UNLOCKEND_BLKADDR);
+		writew(0xffff, NFC_V1_UNLOCKEND_BLKADDR);
 	} else
 		BUG();