nand_scan identification problem
Artem B. Bityuckiy
dedekind at infradead.org
Thu Jan 27 09:06:32 EST 2005
Hi,
I wonder is it possible because of bad timings? spia does not define any
dev_ready function. I would try to play with this->chip_delay value
defined in spia.c as 15...
On Thu, 27 Jan 2005, Moises Beck - EDS Digicon wrote:
>
> Hello,
> I am using a smartmedia card on linux MTD. Everything runs very
> well. But just after power on, the first attempt to load the driver
> spia.o fails. The driver calls nand_scan(), that cannot identify the
> present card. On the second attempt to load the driver, the flash is
> correctly identified. I saw that in nand_scan(), the command
> NAND_CMD_READID return nand_maf_id=0 and nand_dev_id=0 on the first call
> to it. On the second call the IDs are returned correctly. I tried to
> solve this by putting the following code just before the command
> NAND_CMD_READID, on nand_base.c:
>
> /* Select the device */
> this->select_chip(mtd, 0);
>
>
> /* by momo - reset smartmedia e put it on mode READ */
> this->cmdfunc (mtd, NAND_CMD_RESET, -1, -1);
> this->cmdfunc (mtd, NAND_CMD_READ0, -1, -1);
>
>
> /* Send the command for reading device ID */
> this->cmdfunc (mtd, NAND_CMD_READID, 0x00, -1);
>
>
> /* Read manufacturer and device IDs */
> nand_maf_id = this->read_byte(mtd);
> nand_dev_id = this->read_byte(mtd);
>
> But this does not run, and to problem persists. If the funtion to
> NAND_CMD_READID is called twice, as in
>
> /* Select the device */
> this->select_chip(mtd, 0);
>
> /* Send the command for reading device ID */
> /* by momo - send the command twice !!! */
> this->cmdfunc (mtd, NAND_CMD_READID, 0x00, -1);
> this->cmdfunc (mtd, NAND_CMD_READID, 0x00, -1);
>
>
> /* Read manufacturer and device IDs */
> nand_maf_id = this->read_byte(mtd);
> nand_dev_id = this->read_byte(mtd);
>
> then it runs well, always identifying the flash on the first call to
> the funtion nand_scan !!!
> I am using mtd-snapshot-20050111.
>
> Anyone has some clue ?
>
> Thanks,
> Moises
>
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list