Browse Source

mtd: Blackfin NFC: make sure to check NAND_ALE in cmd_ctrl

The NAND base may send some controls which are neither CLE nor ALE, so
we need to explicitly check both instead of assuming things are always
one or the other.  Otherwise, we sometimes send out illegal addresses
to the NAND device.

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Barry Song 15 years ago
parent
commit
fd508da220
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/mtd/nand/bf5xx_nand.c

+ 1 - 1
drivers/mtd/nand/bf5xx_nand.c

@@ -203,7 +203,7 @@ static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd,
 
 
 	if (ctrl & NAND_CLE)
 	if (ctrl & NAND_CLE)
 		bfin_write_NFC_CMD(cmd);
 		bfin_write_NFC_CMD(cmd);
-	else
+	else if (ctrl & NAND_ALE)
 		bfin_write_NFC_ADDR(cmd);
 		bfin_write_NFC_ADDR(cmd);
 	SSYNC();
 	SSYNC();
 }
 }