From: Graf Yang Date: Sat, 4 Apr 2009 11:45:57 +0000 (-0400) Subject: Blackfin: nand: flush peripheral before polling it X-Git-Tag: v2009.06-rc1~44^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a343ba87ea0320ca0a4ecfa2c42cd9d4f18883df;p=u-boot Blackfin: nand: flush peripheral before polling it We need to make sure the data written to the nand flash controller makes it there before we start polling its status register. Otherwise, we may get stale data and return before the controller is actually ready. Signed-off-by: Graf Yang Signed-off-by: Mike Frysinger Acked-by: Scott Wood --- diff --git a/drivers/mtd/nand/bfin_nand.c b/drivers/mtd/nand/bfin_nand.c index f6a0835b4b..f134ef100f 100644 --- a/drivers/mtd/nand/bfin_nand.c +++ b/drivers/mtd/nand/bfin_nand.c @@ -98,6 +98,7 @@ static void bfin_nfc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) /* Contents do not matter */ bfin_write_NFC_DATA_RD(0x0000); + SSYNC(); while (!(bfin_read_NFC_IRQSTAT() & RD_RDY)) if (ctrlc())