New flash type support questions.

Yuan, Cain cain.yuan at intel.com
Fri Oct 25 05:23:31 EDT 2002


Hi all,
	I am now work on a new flash. Normally   after reset  flash chips
will be in  "Read Array"  status but  this one is not. It is in  "Init
Status"  after powered on or reset, I must write an command to it  to let it
into "Read Array" status. unfortunatlly I can't find the support code in
MTD. 

In  function  static inline int do_read_onechip(struct map_info *map, struct
flchip *chip, loff_t adr, size_t len, u_char *buf)
{
    .......
    switch (chip->state) {
    case FL_ERASING:
      . . . . .
        cfi_write(map, CMD(0x70), cmd_addr);
        chip->oldstate = FL_ERASING;
        chip->state = FL_ERASE_SUSPENDING;

    case FL_READY:
        break;

    case FL_CFI_QUERY:
    case FL_JEDEC_QUERY:
        cfi_write(map, CMD(0x70), cmd_addr);
        chip->state = FL_STATUS;

  . . . . .
}

Since there is no   FL_INIT  status defined  and no code ready for this kind
of  status  I  think I  need to add an FL_INIT into
typedef enum {
    FL_READY,
    . . . . .
    FL_UNLOCKING,
    FL_UNKNOWN
} flstate_t;

Also I nned to add  some code like 

case   FL_INIT
	/*   procssing code */
	break;

to  those  functions such as do_read_onechip, do_write_oneword,etc.

Also I should  initially let  chip->state = FL_INIT  but I can't locate the
position where  chip->state are assigned.  would you please give me some
hints? 
Thanks a lot!


Best regards.

--Cain




More information about the linux-mtd mailing list