On Mon, 2004-12-06 at 02:25, Aras Vaichas wrote:
> > It's quite easy, if the timing is wrong or if the rdy/busy check is not
> > reliable.
>
> Is there a utility that writes to every single page, reads back the data and
> then marks the pages correctly?
No.
> Or are those "bad eraseblocks" permanently lost?
You can hack nand_base.c to allow the erasing of the blocks which are
marked bad.
> static void at91_nand_command (struct mtd_info *mtd, unsigned command, int column, int page_addr)
my_nand->cmdfunc = at91_nand_command; /* we need our own */
You don't need your own command function. There is no reason for it. It
is just duplicated code.
> /* Scan to find existance of the device */
> // ARASV
> #define CHIPS_TO_SCAN 1
> if (nand_scan (at91_mtd, CHIPS_TO_SCAN)) {
> err = -ENXIO;
> goto out_ior;
> }
>
> /* Allocate memory for internal data buffer */
> my_nand->data_buf = kmalloc (sizeof(u_char) * (at91_mtd->oobblock + at91_mtd->oobsize), GFP_KERNEL);
> if (!my_nand->data_buf) {
> printk ("Unable to allocate AT91 NAND data buffer.\n");
> err = -ENOMEM;
> goto out_ior;
> }
The data buffer is already allocated inside nand_scan.
tglx