[U-Boot] [PATCH v2 4/8] nand: Merge changes from Linux nand driver

Scott Wood scottwood at freescale.com
Wed Jan 11 00:27:11 CET 2012


On Wed, Oct 12, 2011 at 09:32:02AM +0200, Christian Hitz wrote:
> [backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]
> 
> This patch synchronizes the nand driver with the Linux 3.0 state.
> 
> Signed-off-by: Christian Hitz <christian.hitz at aizo.com>
> Cc: Scott Wood <scottwood at freescale.com>
> ---
> 
> Adds 968 bytes to the image size.
> 
> Remaining checkpatch warnings come from code copied straight from
> Linux.
> 
> Changes since v1:
> 	- split patch into smaller chunks

Applied to u-boot-nand-flash with the following changes (as described
in previous feedback):

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ef389da..ed2640c 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1927,13 +1927,6 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
 	if (!writelen)
 		return 0;
 
-	/* reject writes, which are not page aligned */
-	if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
-		printk(KERN_NOTICE "%s: Attempt to write not "
-				"page aligned data\n", __func__);
-		return -EINVAL;
-	}
-
 	column = to & (mtd->writesize - 1);
 	subpage = column || (writelen & (mtd->writesize - 1));
 
@@ -2334,8 +2327,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
 		 */
 		if (bbt_masked_page != 0xffffffff &&
 		    (page & BBT_PAGE_MASK) == bbt_masked_page)
-			    rewrite_bbt[chipnr] =
-					((loff_t)page << chip->page_shift);
+			rewrite_bbt[chipnr] =
+				((loff_t)page << chip->page_shift);
 
 		/* Increment page address and decrement length */
 		len -= (1 << chip->phys_erase_shift);

-Scott



More information about the U-Boot mailing list