mbox series

[0/6] mtd: spi-nor: generic flash driver

Message ID 20220513133520.3945820-1-michael@walle.cc
Headers show
Series mtd: spi-nor: generic flash driver | expand

Message

Michael Walle May 13, 2022, 1:35 p.m. UTC
Add a generic flash driver, which is used when we don't find a matching
flash in our database. All the basic features of a flash can be discovered
by SFDP and most (if not all) newer flashes support it.

Michael Walle (6):
  mtd: spi-nor: hide jedec_id sysfs attribute if not present
  mtd: spi-nor: sysfs: hide manufacturer if it is not set
  mtd: spi-nor: remember full JEDEC flash ID
  mtd: spi-nor: move function declaration out of sfdp.h
  mtd: spi-nor: add generic flash driver
  mtd: spi-nor: sysfs: print JEDEC ID for generic flash driver

 .../ABI/testing/sysfs-bus-spi-devices-spi-nor |  6 +++++
 drivers/mtd/spi-nor/core.c                    | 18 +++++++++++++
 drivers/mtd/spi-nor/core.h                    |  3 +++
 drivers/mtd/spi-nor/debugfs.c                 |  2 +-
 drivers/mtd/spi-nor/sfdp.c                    | 27 +++++++++++++++++++
 drivers/mtd/spi-nor/sfdp.h                    |  2 --
 drivers/mtd/spi-nor/sysfs.c                   | 20 +++++++++++++-
 include/linux/mtd/spi-nor.h                   |  3 +++
 8 files changed, 77 insertions(+), 4 deletions(-)

Comments

Tudor Ambarus July 26, 2022, 8:06 a.m. UTC | #1
Hi, Takahiro,

Would you please review this patch set?

Thanks,
ta

On 5/13/22 16:35, Michael Walle wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Add a generic flash driver, which is used when we don't find a matching
> flash in our database. All the basic features of a flash can be discovered
> by SFDP and most (if not all) newer flashes support it.
> 
> Michael Walle (6):
>   mtd: spi-nor: hide jedec_id sysfs attribute if not present
>   mtd: spi-nor: sysfs: hide manufacturer if it is not set
>   mtd: spi-nor: remember full JEDEC flash ID
>   mtd: spi-nor: move function declaration out of sfdp.h
>   mtd: spi-nor: add generic flash driver
>   mtd: spi-nor: sysfs: print JEDEC ID for generic flash driver
> 
>  .../ABI/testing/sysfs-bus-spi-devices-spi-nor |  6 +++++
>  drivers/mtd/spi-nor/core.c                    | 18 +++++++++++++
>  drivers/mtd/spi-nor/core.h                    |  3 +++
>  drivers/mtd/spi-nor/debugfs.c                 |  2 +-
>  drivers/mtd/spi-nor/sfdp.c                    | 27 +++++++++++++++++++
>  drivers/mtd/spi-nor/sfdp.h                    |  2 --
>  drivers/mtd/spi-nor/sysfs.c                   | 20 +++++++++++++-
>  include/linux/mtd/spi-nor.h                   |  3 +++
>  8 files changed, 77 insertions(+), 4 deletions(-)
> 
> --
> 2.30.2
>
Takahiro Kuwano July 29, 2022, 1:52 a.m. UTC | #2
Hi Tudor and Michael,

On 7/26/2022 5:06 PM, Tudor.Ambarus@microchip.com wrote:
> Hi, Takahiro,
> 
> Would you please review this patch set?
> 
I tested a Flash device that is not yet in the database.
https://www.infineon.com/dgdl/Infineon-S25FS256T_256Mb_SEMPER_Nano_Flash_Quad_SPI_1.8V-DataSheet-v01_00-EN.pdf?fileId=8ac78c8c80027ecd0180740c5a46707a&da=t

And it works fine.


zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/partname
spi-nor-generic
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
342b190f0890
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer
spansion
zynq> xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
53464450080101ff00000114000100ff84000102500100ffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffe7ffe2ffffffff0f48eb086bffff
ffffeeffffffffff00ffffff00ff11d810d800ff00ff321cfeff71e9ffe1
ec031c607a757a75f766805c00d65dfff938c0a100000000000000000000
0000ffffffff710600fedcdcffff
zynq> md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
13ecce2f195c4c71648e90d4a7e4a0df  /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
zynq> test_qspi.sh
6+0 records in
6+0 records out
6291456 bytes (6.0MB) copied, 0.231887 seconds, 25.9MB/s
Copied 6291456 bytes from qspi_test to address 0x00000000 in flash
Erased 6291456 bytes from address 0x00000000 in flash
Copied 6291456 bytes from address 0x00000000 in flash to qspi_read
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0600000
Copied 6291456 bytes from qspi_test to address 0x00000000 in flash
Copied 6291456 bytes from address 0x00000000 in flash to qspi_read
20b1c32188a5e337ef7575ffb5e4fa424f6bf5a9  qspi_test
20b1c32188a5e337ef7575ffb5e4fa424f6bf5a9  qspi_read


Thanks,
Takahiro
Tudor Ambarus July 29, 2022, 5:34 a.m. UTC | #3
On 7/29/22 04:52, Takahiro Kuwano wrote:
> Hi Tudor and Michael,

Hi!

> 
> On 7/26/2022 5:06 PM, Tudor.Ambarus@microchip.com wrote:
>> Hi, Takahiro,
>>
>> Would you please review this patch set?
>>
> I tested a Flash device that is not yet in the database.
> https://www.infineon.com/dgdl/Infineon-S25FS256T_256Mb_SEMPER_Nano_Flash_Quad_SPI_1.8V-DataSheet-v01_00-EN.pdf?fileId=8ac78c8c80027ecd0180740c5a46707a&da=t
> 
> And it works fine.

Cool, thanks for the involvement!

Michael, I'll consider to include this once the merge window is open.
I'll stop queuing patches for now as we're late in the release cycle.