[PATCH 2/2][v2] mtd/nand: Fix IFC driver to support 2K NAND page

Subsystems: memory technology devices (mtd), nand flash subsystem, the rest

STALE5334d

4 messages, 3 authors, 2012-01-17 · open the first message on its own page

[PATCH 2/2][v2] mtd/nand: Fix IFC driver to support 2K NAND page

From: Prabhakar Kushwaha <hidden>
Date: 2012-01-09 12:24:38

1) OOB area should be updated irrespective of NAND page size. Earlier it was
updated only for 512byte NAND page.

2) During OOB update fbcr should be equal to OOB size.

Signed-off-by: Poonam Aggrwal <redacted>
Signed-off-by: Prabhakar Kushwaha <redacted>
---
 git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git (branch next)

 This patch is created on top of IFC driver patch (already floated in mailing
 list). Please find their link:
 http://patchwork.ozlabs.org/patch/133315/
 http://patchwork.ozlabs.org/patch/133316/

 Tested on P1010RDB

  Changes for v2: Incorporated Scott's comments
 	- Added missed NAND_CMD_READOOB
	- Updated function as per Scott's advice

 drivers/mtd/nand/fsl_ifc_nand.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index c0529ea..52bd706d 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -440,22 +440,19 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
 			out_be32(&ifc->ifc_nand.nand_fir1,
 				 (IFC_FIR_OP_CW1 << IFC_NAND_FIR1_OP5_SHIFT));
 
-			if (column >= mtd->writesize) {
-				/* OOB area --> READOOB */
-				column -= mtd->writesize;
-				nand_fcr0 |= NAND_CMD_READOOB <<
-						IFC_NAND_FCR0_CMD0_SHIFT;
-				ifc_nand_ctrl->oob = 1;
-			} else if (column < 256)
-				/* First 256 bytes --> READ0 */
+			if (column >= mtd->writesize)
 				nand_fcr0 |=
-				NAND_CMD_READ0 << IFC_NAND_FCR0_CMD0_SHIFT;
+				NAND_CMD_READOOB << IFC_NAND_FCR0_CMD0_SHIFT;
 			else
-				/* Second 256 bytes --> READ1 */
 				nand_fcr0 |=
-				NAND_CMD_READ1 << IFC_NAND_FCR0_CMD0_SHIFT;
+				NAND_CMD_READ0 << IFC_NAND_FCR0_CMD0_SHIFT;
 		}
 
+		if (column >= mtd->writesize) {
+			/* OOB area --> READOOB */
+			column -= mtd->writesize;
+			ifc_nand_ctrl->oob = 1;
+		}
 		out_be32(&ifc->ifc_nand.nand_fcr0, nand_fcr0);
 		set_addr(mtd, column, page_addr, ifc_nand_ctrl->oob);
 		return;
@@ -466,7 +463,7 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command,
 		int full_page;
 		if (ifc_nand_ctrl->oob) {
 			out_be32(&ifc->ifc_nand.nand_fbcr,
-					ifc_nand_ctrl->index);
+				ifc_nand_ctrl->index - ifc_nand_ctrl->column);
 			full_page = 0;
 		} else {
 			out_be32(&ifc->ifc_nand.nand_fbcr, 0);
-- 
1.7.5.4

Re: [PATCH 2/2][v2] mtd/nand: Fix IFC driver to support 2K NAND page

From: Scott Wood <hidden>
Date: 2012-01-10 01:11:02

On 01/09/2012 06:24 AM, Prabhakar Kushwaha wrote:
1) OOB area should be updated irrespective of NAND page size. Earlier it was
updated only for 512byte NAND page.

2) During OOB update fbcr should be equal to OOB size.

Signed-off-by: Poonam Aggrwal <redacted>
Signed-off-by: Prabhakar Kushwaha <redacted>
---
 git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git (branch next)

 This patch is created on top of IFC driver patch (already floated in mailing
 list). Please find their link:
 http://patchwork.ozlabs.org/patch/133315/
 http://patchwork.ozlabs.org/patch/133316/
Looks good.

-Scott

Re: [PATCH 2/2][v2] mtd/nand: Fix IFC driver to support 2K NAND page

From: Kumar Gala <hidden>
Date: 2012-01-17 18:57:48

On Jan 9, 2012, at 7:10 PM, Scott Wood wrote:
On 01/09/2012 06:24 AM, Prabhakar Kushwaha wrote:
quoted
1) OOB area should be updated irrespective of NAND page size. Earlier =
it was
quoted
updated only for 512byte NAND page.
=20
2) During OOB update fbcr should be equal to OOB size.
=20
Signed-off-by: Poonam Aggrwal <redacted>
Signed-off-by: Prabhakar Kushwaha <redacted>
---
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git =
(branch next)
quoted
=20
This patch is created on top of IFC driver patch (already floated in =
mailing
quoted
list). Please find their link:
http://patchwork.ozlabs.org/patch/133315/
http://patchwork.ozlabs.org/patch/133316/
=20
Looks good.
=20
-Scott
Can we not merge all these into one updated IFC NAND patch?

- k=

Re: [PATCH 2/2][v2] mtd/nand: Fix IFC driver to support 2K NAND page

From: Scott Wood <hidden>
Date: 2012-01-17 19:10:12

On 01/17/2012 12:57 PM, Kumar Gala wrote:
On Jan 9, 2012, at 7:10 PM, Scott Wood wrote:
quoted
On 01/09/2012 06:24 AM, Prabhakar Kushwaha wrote:
quoted
1) OOB area should be updated irrespective of NAND page size. Earlier it was
updated only for 512byte NAND page.

2) During OOB update fbcr should be equal to OOB size.

Signed-off-by: Poonam Aggrwal <redacted>
Signed-off-by: Prabhakar Kushwaha <redacted>
---
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git (branch next)

This patch is created on top of IFC driver patch (already floated in mailing
list). Please find their link:
http://patchwork.ozlabs.org/patch/133315/
http://patchwork.ozlabs.org/patch/133316/
Looks good.

-Scott
Can we not merge all these into one updated IFC NAND patch?
Sure, once we've agreed on what the right fix is for the is_blank issue
(and I think we're pretty close).  It's been useful to see these fixes
as separate patches during the review/iteration phase, though.

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help