[PATCH] spi-nor: sfdp: Allow configuring unknown flashes using SFDP

Petr Malat oss at malat.biz
Fri May 21 04:53:50 PDT 2021


Hi!
On Fri, May 21, 2021 at 03:25:05PM +0530, Pratyush Yadav wrote:
> On 20/05/21 06:07PM, Petr Malat wrote:
> > This change allows adding a support for flashes with correct SFDP
> > without recompilation of the kernel by setting sfdp-compatible property
> > in their node. Alternatively, sfdp_compatible module option can be used
> > to list JEDEC IDs of flashes, whose SFDP can be trusted. Star "*" can
> > be used to match all JEDEC IDs.
> 
> I have skimmed through the patch. Before I look at it more closely, I 
> want to understand the use case for this patch. Why would you not want 
> to recompile the kernel when adding support for new hardware? Do you 
> want the ability to support flashes on devices that have already been 
> deployed in the field? Is it something that comes up frequently?
In my case the kernel is loaded from a USB mass storage device, which
can be preproduced and on stock (with the kernel already on it). With
my patch I can change the flash vendor without the need of updating
the image on already existing USB mass storage devices.

The patch is also useful for people who use distribution kernel as they
will not have to wait until (and if) the distribution updates it.

> Then comes the question of how do you get the flash to probe if it is 
> not present in device tree? And if you are able to update the device 
> tree then you should also be able to update the kernel.
If one sets sfdp-compatible flag in the device tree and replaces one
flash with another, he doesn't need to update the device tree. It
extends what is already possible now - if I make "jedec,spi-nor" node
and the JEDEC ID is known to the driver I can replace the flash with
a different one whose JEDEC ID is known as well and it will work
without touching the device tree.

> Have you tested this with any flash? If so, with which one?
I have tested it with n25q128a11 by removing it from the driver.

> > 
> > Signed-off-by: Petr Malat <oss at malat.biz>
> > ---
> >  .../devicetree/bindings/mtd/jedec,spi-nor.txt |  3 +
> 
> This file has been converted to yaml since at least 5.12-rc1. Please 
> update your kernel sources and rebase your patches.
OK, I will rebase.
  Petr



More information about the linux-mtd mailing list