[PATCH] mtd: spi-nor: allow NULL as chip name and try to auto detect it

Rafał Miłecki zajec5 at gmail.com
Mon Dec 1 01:49:28 PST 2014


On 1 December 2014 at 09:40, Brian Norris <computersforpeace at gmail.com> wrote:
> On Wed, Oct 22, 2014 at 06:05:00PM +0200, Rafał Miłecki wrote:
>> This will allow spi-nor users to plainly use JEDEC to detect flash chip.
>>
>> Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
>>
> I think this is a good time to consider this question: how do we
> *really* want a SPI NOR driver to interact with spi-nor.c, regarding
> device detection? I like how this patch removes the string-matching
> requirement, so we can just auto-detect by JEDEC RDID alone. But I don't
> like how it leaves around the function parameter 'name', which really
> we should really be moving to deprecate if possible.
>
> Anyway, I can take a rebased version of this patch. But I'd like to
> encourage more thought here for the future. I don't yet have a specific
> proposal, so any thoughts are welcome.

My purpose is to make use of auto-detect by RDID wherever possible. As
you noticed, it's the first step. Now we should modify m25p80 to use
it when possible.

The case with non-DT platforms is simple. There is
struct flash_platform_data
which contains "type". I was thinking about Introducing new type like
"m25p80-rdid". What do you think about this?

I'm not exactly sure how m25p80 is handled when used in DT. Does
anyone know that? m25p80 itself doesn't register as DT driver. So I
guess there is some code translating DT m25p80 entries into platform
data. Is that right? Where is this code located?

-- 
Rafał



More information about the linux-mtd mailing list