[PATCH] mtd: m25p80: add support for Spansion s25fl128s chip

Angus Clark angus.clark at st.com
Mon Dec 9 03:52:39 EST 2013


Hi Huang,

On 12/06/2013 10:02 AM, Huang Shijie wrote:
> On Thu, Dec 05, 2013 at 10:55:34AM +0000, Angus Clark wrote:
>> static struct flash_info *__devinit fsm_jedec_probe(struct stm_spi_fsm *fsm)
>> {
>> 	uint8_t	readid[MAX_READID_LEN];
> 
> How long is the MAX_READID_LEN? 5 or 8?

At the moment, I have it set to 6 (for the Spansion 'S' generation devices).  It
just needs to be set to the maximum READID length given in the table.

> Brian doubt that some NOR can not be read out more then 5 bytes.

I believe it is always safe to over-read the READID data.  I have found that
devices either repeat the READID, or start returning 0x00 bytes.

>> 	sort(flash_types, ARRAY_SIZE(flash_types) - 1,
>> 	     sizeof(struct flash_info), cmp_flash_info_readid_len, NULL);
>>
> If we keep the flash_types table be inserted by a specific order.
> We can remove this sort code.
> 

We could do, but that relies on people adding entries in the correct order, and
the correct order in terms of the search leads to a table that is not so easy to
read -- my first version required an ordered table!  I'm easy either way though,
there are clearly benefits to having an ordered table.

Cheers,

Angus



More information about the linux-mtd mailing list