1 --- linux-2.6.18-org/drivers/mtd/nand/dm8000_nand.c 2010-10-18 22:40:58.000000000 +0200
2 +++ linux-2.6.18/drivers/mtd/nand/dm8000_nand.c 2011-02-09 19:23:15.808489533 +0100
7 +#include <linux/delay.h>
8 #include <linux/jiffies.h>
9 #include <linux/slab.h>
10 #include <linux/module.h>
13 #define NUM_PARTITIONS 7
15 +static int dm8000_nand_dev_ready(struct mtd_info *mtd);
17 static void dm8000_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
19 - if (ctrl & NAND_CTRL_CHANGE) {
20 - if (!(ctrl & NAND_NCE))
21 - writeb(0, (void __iomem *)0xBF030003);
23 - // readb((void __iomem *)0xBF030002);
25 - if (cmd == NAND_CMD_NONE)
26 + if (ctrl & NAND_CTRL_CHANGE && !(ctrl & NAND_NCE))
27 + writeb(0, (void __iomem *)0xBF030003);
29 + if (cmd == NAND_CMD_NONE) {
31 + struct nand_chip *this = (struct nand_chip *)(dm8000_mtd+1);
33 + while (cnt < this->chip_delay && !dm8000_nand_dev_ready(mtd)) {
42 writeb(cmd, (void __iomem *)0xBF030000);