[PATCH v4 2/6] mtd: spi-nor: core: Handle ID collisions between SFDP & non-SFDP flashes

Michael Walle michael at walle.cc
Thu Mar 3 08:39:02 PST 2022


Am 2022-03-03 17:03, schrieb Tudor.Ambarus at microchip.com:
..
>>>>> So when one
>>>>> declares a flash like:
>>>>> +      { "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64)
>>>>> +             /* ID collision with mx25l3233f. */
>>>>> +             PARSE_SFDP
>>>>> +             NO_SFDP_FLAGS(SECT_4K)
>>>> 
>>>> But what about
>>>> +      { "differentflash",  INFO(0xc22016, 0, 64 * 1024,  64)
>>>> +             /* ID collision with mx25l3233f. */
>>>> +             PARSE_SFDP
>>>> 
>>>> Thats also valid, no? Why is having 4k sectors special? FWIW, the
>>> 
>>> no, because just the first entry with the 0xc22016 ID will be hit, 
>>> the
>>> second one will be ignored. We use a single flash entry for all the
>>> flashes that collide.
>> 
>> Not in addition but instead of yours, of course.
>> 
>>> PARSE_SFDP together with any of the:
>>> #define SECT_4K                         BIT(1)
>>> #define SECT_4K_PMC                     BIT(2)
>>> #define SPI_NOR_DUAL_READ               BIT(3)
>>> #define SPI_NOR_QUAD_READ               BIT(4)
>>> #define SPI_NOR_OCTAL_READ              BIT(5)
>>> #define SPI_NOR_OCTAL_DTR_READ          BIT(6)
>>> #define SPI_NOR_OCTAL_DTR_PP            BIT(7)
>>> 
>>> suggests that we'd like to differentiate between a flash that 
>>> supports
>>> SFDP and can discover its params via SFDP (no_sfdp_flags will be
>>> ignored),
>>> and a flash that doesn't support SFDP and it's forced to initialize 
>>> the
>>> params via the no_sfdp_flags.
>> 
>> I get that, but what if I have a flash, which doesn't have 4k
>> sectors but ordinary 64k sectors (to stick to your example). In
>> general, what if I have a flash where none of the above flags
>> are set. You only call that function if there are any no_sfdp flags
>> set, but they are all optional, no? Who is setting the erase opcode
>> for flashes with that ID but without SFDP, then?
> 
> this use case is not handled in this proposal, indeed. I'm not sure
> if there are such flashes though. Can't think of an example. We search
> for a flash that operates only in 1-1-1 and can't do 4k erase.
> Is that a NOR? But if you feel we should care about this case too,
> I'll address it, probably I will be forced to introduce a new flag or
> a bool, meh.

1-1-1 with 64k sectors would be the very basic spi nor flash no?
In any case, no I don't care that much about this, it was just not
that easy to understand why you did it this way. So we should
really add a comment that we assume here that at least one
nosfdp flag is set.

-michael



More information about the linux-mtd mailing list