Inside SW,FW and HW R&D

C/C++ | Visual C++ | 嵌入式系统 | 硬件设计 | 通信与网络

My Links

Blog统计

公告


  ----Counters-----
     Welcome to Inside SW,FW and HW R&D.
   Developer:宋宝华
21cnbao@21cn.com

文章

收藏

相册

技术网站

存档


正在读取评论……
Subject:   bug report about nand flash id table and the way to identify chips
From:   song baohua
Date:   Thu, April 10, 2008 1:13 pm
To:   linux-mtd@lists.infradead.org;"Thomas Gleixner" <tglx@linutronix.de>
Cc:    
Priority:   Normal
Options:    
 

Dear all&Thomas,
There is a bug in the way to identify nand chips.
At the array nand_flash_ids[] of nand_ids.c, there is a line like that:
{"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, 0},
There is another line like that:
{"NAND 2GiB 3,3V 8-bit", 0xD5, 0, 2048, 0, LP_OPTIONS},
Both Id is 0xd5.
So for those chip with chip id=0xd5, for example K9LAG08U0,it will be
identified as an old chip with page size=512 by the nand_get_flash_type()
in nand_base.c like:
/* Lookup the flash id */
for (i = 0; nand_flash_ids[i].name != NULL; i++) {
if (dev_id == nand_flash_ids[i].id) {
type = &nand_flash_ids[i];
break;
}
}

/* Newer devices have all the information in additional id bytes */
if (!type->pagesize) {
...

} else {
/*
* Old devices have chip data hardcoded in the device id
table
*/
mtd->erasesize = type->erasesize;
mtd->writesize = type->pagesize;
mtd->oobsize = mtd->writesize / 32;
busw = type->options & NAND_BUSWIDTH_16;
}
We should change the way to get page size, block size and so on. For the
beginning some chips in nand_flash_ids[], it is not always reliable for
us to get all information through only one ID byte.

Thanks
Barry Song



 

 

Subject:   Re: bug report about nand flash id table and the way to identify chips
From:   "Thomas Gleixner" <tglx@linutronix.de>
Date:   Thu, April 10, 2008 1:48 pm
To:   song baohua
Cc:   linux-mtd@lists.infradead.org
Priority:   Normal
Options:    
 

On Thu, 10 Apr 2008, songbaohua wrote:
> Dear all&Thomas,
> There is a bug in the way to identify nand chips.
> At the array nand_flash_ids[] of nand_ids.c, there is a line like that:
> {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, 0},

and the line above is guarded by:

#ifdef CONFIG_MTD_NAND_MUSEUM_IDS

which is default off.

From Kconfig:

config MTD_NAND_MUSEUM_IDS
bool "Enable chip ids for obsolete ancient NAND devices"
depends on MTD_NAND
default n
help
Enable this option only when your board has first generation
NAND chips (page size 256 byte, erase size 4-8KiB). The IDs
of these chips were reused by later, larger chips.

So there is no bug at all.

Thanks,
tglx




Subject:   Re: bug report about nand flash id table and the way to identify chips
From:   song baohua
Date:   Thu, April 10, 2008 3:33 pm
To:   "Thomas Gleixner" <tglx@linutronix.de>
Cc:    
Priority:   Normal
Options:    
 

Thomas,
Thanks for your reply! We are using a little old kernel version. We find
there is really CONFIG_MTD_NAND_MUSEUM_IDS in the newest linux kernel.
Best regards
Baohua


> On Thu, 10 Apr 2008, songbaohua wrote:
>> Dear all&Thomas,
>> There is a bug in the way to identify nand chips.
>> At the array nand_flash_ids[] of nand_ids.c, there is a line like that:
>> {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, 0},
>
> and the line above is guarded by:
>
> #ifdef CONFIG_MTD_NAND_MUSEUM_IDS
>
> which is default off.
>
> From Kconfig:
>
> config MTD_NAND_MUSEUM_IDS
> bool "Enable chip ids for obsolete ancient NAND devices"
> depends on MTD_NAND
> default n
> help
> Enable this option only when your board has first generation
> NAND chips (page size 256 byte, erase size 4-8KiB). The IDs
> of these chips were reused by later, larger chips.
>
> So there is no bug at all.
>
> Thanks,
> tglx
>
>




Trackback: http://tb.donews.net/TrackBack.aspx?PostId=1281917


[点击此处收藏本文]  发表于2008年04月21日 11:28 PM




正在读取评论……
大名
网址
验证码
评论