
zyliu@ingenic.cn wrote:
Hi, xiangfu
Maybe the drivers of mtd in linux-2.6.24.3 can be as reference.
Best Regards
thanks, now it's output : "nand_get_flash_type: second ID read did not match 43,20 against 84,84"
I will let you know the progress.
now the hwcontrol is -- static void jz_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct nand_chip *this = (struct nand_chip *)(mtd->priv); unsigned int nandaddr = (unsigned int)this->IO_ADDR_W; if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_CLE) nandaddr = nandaddr | 0x00008000; else nandaddr = nandaddr & ~0x00008000; if (ctrl & NAND_ALE) this->IO_ADDR_W = (void __iomem *)((unsigned long)(this->IO_ADDR_W) | 0x00010000); else this->IO_ADDR_W = (void __iomem *)((unsigned long)(this->IO_ADDR_W) & ~0x00010000); if (ctrl & NAND_NCE) { this->IO_ADDR_W = this->IO_ADDR_R = (void __iomem *)NAND_DATA_PORT1; REG_EMC_NFCSR |= EMC_NFCSR_NFCE1; } else { REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE1; REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE2; REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE3; REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE4; } }
this->IO_ADDR_W = (void __iomem *)nandaddr; if (cmd != NAND_CMD_NONE) writeb(cmd, this->IO_ADDR_W); }