diff options
author | Roger Quadros <rogerq@ti.com> | 2015-08-05 06:36:43 -0400 |
---|---|---|
committer | Roger Quadros <rogerq@ti.com> | 2016-04-15 04:53:20 -0400 |
commit | d6e552168db59d627fd56074f2c588df1faf0c95 (patch) | |
tree | b1613d8ba94b30cea06943b0304ac0a39e5a4635 /drivers/mtd | |
parent | c509aefd75d026f4ef4aa306131d7a780c2eda7b (diff) |
mtd: nand: omap: Switch to using GPMC-NAND ops for writebuffer empty check
Instead of accessing the gpmc_status register directly start
using the gpmc_nand_ops->nand_writebuffer_empty() helper
to check write buffer empty status.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/omap2.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index cba9bf0adba1..98023d5bfc35 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -291,14 +291,13 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len) | |||
291 | { | 291 | { |
292 | struct omap_nand_info *info = mtd_to_omap(mtd); | 292 | struct omap_nand_info *info = mtd_to_omap(mtd); |
293 | u_char *p = (u_char *)buf; | 293 | u_char *p = (u_char *)buf; |
294 | u32 status = 0; | 294 | bool status; |
295 | 295 | ||
296 | while (len--) { | 296 | while (len--) { |
297 | iowrite8(*p++, info->nand.IO_ADDR_W); | 297 | iowrite8(*p++, info->nand.IO_ADDR_W); |
298 | /* wait until buffer is available for write */ | 298 | /* wait until buffer is available for write */ |
299 | do { | 299 | do { |
300 | status = readl(info->reg.gpmc_status) & | 300 | status = info->ops->nand_writebuffer_empty(); |
301 | STATUS_BUFF_EMPTY; | ||
302 | } while (!status); | 301 | } while (!status); |
303 | } | 302 | } |
304 | } | 303 | } |
@@ -326,7 +325,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) | |||
326 | { | 325 | { |
327 | struct omap_nand_info *info = mtd_to_omap(mtd); | 326 | struct omap_nand_info *info = mtd_to_omap(mtd); |
328 | u16 *p = (u16 *) buf; | 327 | u16 *p = (u16 *) buf; |
329 | u32 status = 0; | 328 | bool status; |
330 | /* FIXME try bursts of writesw() or DMA ... */ | 329 | /* FIXME try bursts of writesw() or DMA ... */ |
331 | len >>= 1; | 330 | len >>= 1; |
332 | 331 | ||
@@ -334,8 +333,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) | |||
334 | iowrite16(*p++, info->nand.IO_ADDR_W); | 333 | iowrite16(*p++, info->nand.IO_ADDR_W); |
335 | /* wait until buffer is available for write */ | 334 | /* wait until buffer is available for write */ |
336 | do { | 335 | do { |
337 | status = readl(info->reg.gpmc_status) & | 336 | status = info->ops->nand_writebuffer_empty(); |
338 | STATUS_BUFF_EMPTY; | ||
339 | } while (!status); | 337 | } while (!status); |
340 | } | 338 | } |
341 | } | 339 | } |