소스 검색

mtd: Blackfin NFC: wait for the ECC reset to finish

When resetting the ECC registers/counters, the bit will automatically
clear itself once the reset has actually finished.  So make sure we
wait for that to occur before doing anything else rather than assuming
everything is peachy and proceeding with stale ECC values.

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 년 전
부모
커밋
752b957a37
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      drivers/mtd/nand/bf5xx_nand.c

+ 2 - 0
drivers/mtd/nand/bf5xx_nand.c

@@ -507,6 +507,8 @@ static void bf5xx_nand_dma_rw(struct mtd_info *mtd,
 	 */
 	 */
 	bfin_write_NFC_RST(ECC_RST);
 	bfin_write_NFC_RST(ECC_RST);
 	SSYNC();
 	SSYNC();
+	while (bfin_read_NFC_RST() & ECC_RST)
+		cpu_relax();
 
 
 	disable_dma(CH_NFC);
 	disable_dma(CH_NFC);
 	clear_dma_irqstat(CH_NFC);
 	clear_dma_irqstat(CH_NFC);