Skip to contentSkip to conversation

NAND: Add 16bit NAND support for the NDFC

PATCH Superseded Alex Waterman 2 participants 4 messages May 27, 2011 – Jun 7, 2011

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 NAND: Add 16bit NAND support for the NDFC

#1 lore raw

PATCH v2 1/1 NAND: Add 16bit NAND support for the NDFC

Quoted 5 lines · Alex Waterman
nand_spl/nand_boot.c +0 -0
index 9545a9a..725356f 100644

nand_spl/nand_boot.c static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8 · line 86

Quoted 9 lines
nand_spl/nand_boot.c +3 -2
@@ -80,9 +80,10 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
 		cmd = NAND_CMD_READ0;
 	}
 
+#ifdef CONFIG_SYS_NDFC_16BIT
 	/* Shift the offset from byte addressing to word addressing. */
-	if (this->options & NAND_BUSWIDTH_16)
-		offs >>= 1;
+	offs >>= 1;
+#endif

This is not an NDFC-specific file.

-Scott

#2 lore raw

PATCH v2 1/1 NAND: Add 16bit NAND support for the NDFC

Quoted 9 lines

Review

Quoted 7 lines
(quoted diff) +3 -2
+#ifdef CONFIG_SYS_NDFC_16BIT
 	/* Shift the offset from byte addressing to word addressing. */
-	if (this->options & NAND_BUSWIDTH_16)
-		offs >>= 1;
+	offs >>= 1;
+#endif

This is not an NDFC-specific file.

Oh, yeah, I see. This should not have been swapped to a preprocessor condition. Could we make a general define for 16 bit NAND not just limited to the NDFC? Or would you rather just have the extra if condition despite the extra code space it takes up?

Regards,
Alex

Signature · 4 lines
Alex Waterman
Computer Engineer
Phone: 215-896-4920
Email: awaterman at dawning.com
#3 lore raw

PATCH v2 1/1 NAND: Add 16bit NAND support for the NDFC

Quoted 10 lines · On Tue, 7 Jun 2011 08:33:25 -0400 Alex Waterman <[email protected]> wrote:
Quoted 9 lines

Review

Quoted 7 lines
(quoted diff) +3 -2
+#ifdef CONFIG_SYS_NDFC_16BIT
 	/* Shift the offset from byte addressing to word addressing. */
-	if (this->options & NAND_BUSWIDTH_16)
-		offs >>= 1;
+	offs >>= 1;
+#endif

This is not an NDFC-specific file.

Quoted 4 lines

Oh, yeah, I see. This should not have been swapped to a preprocessor condition. Could we make a general define for 16 bit NAND not just limited to the NDFC? Or would you rather just have the extra if condition despite the extra code space it takes up?

I'm fine with either way. If you make it compile-time, make sure you update all boards that use SPL with 16-bit, and document that it's limited to SPL (unless you really want to update all the boards using 16-bit, SPL or not, and update the main NAND code to take advantage of this, and there's enough advantage to be gained to make it worthwhile).

-Scott