[PATCH V2] mtd: spi-nor: prefer more specific entries from chips database

Bean Huo 霍斌斌 (beanhuo) beanhuo at micron.com
Thu Nov 6 17:49:36 PST 2014


>> 2) n25q128a13 with ID 0x20bb181234
>> we should prefer entry with the longer ID.
>I perfer to make a limit before we add new item to the table:
>   Put the longest one in the first place.

>By this way, we can avoid the too much "for"s in the following code which makes the code a little complicated.
 
>So It should looks like this in the table.     
 > 1) n25q128a13 with ID 0x20bb181234
 > 2) n25q128a11 with ID 0x20bb18

>Hi Brian, what's your opinion?
  
>thanks
>Huang Shijie

In general,spi nor include three parts Id infor,

First,it is Manufacturer ID, size is 1 byte.

Second,it is Device ID,and size is 2 bytes,this sector will include memory
type and capacity information.

Third,it is unique ID,and size is 17 bytes(now only used 2 bytes in linux),first byte
will indicate length of data to follow,second byte is real Extended id,and
very important.Next 14 bytes is optional,it can be customized factory data. 

Now in our linux,former two parts all be used for Deivce Id ,ant its size
is 3 bytes.third part(extended id)be used 2 bytes,and called extended id.

In our Micron spi nor serials,there are some spi nor that the same Deivce id 
with different extended ID,so in order to distinguish this,you only add extended id
infor in struct spi_device_id spi_nor_ids,and don't let relevant spi nor Extended ID field
is NULL.just as Spansion:

{ "s25sl032p",  INFO(0x010215, 0x4d00,  64 * 1024,  64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "s25sl064p",  INFO(0x010216, 0x4d00,  64 * 1024, 128, 0) },
{ "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) },


BeanHuo


More information about the linux-mtd mailing list