mbox series

[v2,0/6] mtd: spi-nor: introduce die erase

Message ID 20231101145853.524045-1-tudor.ambarus@linaro.org
Headers show
Series mtd: spi-nor: introduce die erase | expand

Message

Tudor Ambarus Nov. 1, 2023, 2:58 p.m. UTC
The patch set is just compiled tested as I don't have a multi die flash
at hand. Takahiro and Fabio, please test the series and let me know if
it works on your side.

This will be followed by the removal of SNOR_F_NO_OP_CHIP_ERASE and
implicitly of the old xilinx SPI NOR driver, but let's take it all in
small bites.

v2:
- iterate over all dices instead of erasing just one
- consider address of die erase command
- fix default value of nor->params->die_erase_opcode
- introduce spi_nor_erase_dice

Fabio Estevam (1):
  mtd: spi-nor: micron-st: Add support for mt25qu01g

Tudor Ambarus (5):
  mtd: spi-nor: use kernel sized types instead of c99 types
  mtd: spi-nor: add erase die (chip) capability
  mtd: spi-nor: spansion: enable die erase for multi die flashes
  mtd: spi-nor: micron-st: enable die erase for multi die flashes
  mtd: spi-nor: remove NO_CHIP_ERASE flag

 drivers/mtd/spi-nor/atmel.c     |  16 ++---
 drivers/mtd/spi-nor/core.c      | 112 +++++++++++++++++++++-----------
 drivers/mtd/spi-nor/core.h      |  22 +++----
 drivers/mtd/spi-nor/debugfs.c   |   2 +-
 drivers/mtd/spi-nor/micron-st.c |  47 ++++++++++++--
 drivers/mtd/spi-nor/spansion.c  |   4 +-
 drivers/mtd/spi-nor/sst.c       |   6 +-
 drivers/mtd/spi-nor/swp.c       |  25 ++++---
 8 files changed, 153 insertions(+), 81 deletions(-)

Comments

Fabio Estevam Nov. 1, 2023, 3:54 p.m. UTC | #1
Hi Tudor,

On 01/11/2023 11:58, Tudor Ambarus wrote:
> The patch set is just compiled tested as I don't have a multi die flash
> at hand. Takahiro and Fabio, please test the series and let me know if
> it works on your side.
> 
> This will be followed by the removal of SNOR_F_NO_OP_CHIP_ERASE and
> implicitly of the old xilinx SPI NOR driver, but let's take it all in
> small bites.

I tested v2, but erase did not work:

~# time flash_erase /dev/mtd0 0 0
Erasing 131072 Kibyte @ 0 -- 100 % complete

real	0m0.007s
user	0m0.001s
sys	0m0.006s

~# hexdump -C /dev/mtd0
00000000  d4 a1 8c 16 ad 4d b2 df  3d 2a af c2 ae 0a 8a c1  
|.....M..=*......|
00000010  5f 2d 7a 17 9f c3 a4 46  cd f9 80 b8 1e 33 43 25  
|_-z....F.....3C%|
00000020  47 dd 81 89 aa 1e b4 aa  26 96 6c 33 74 4f 22 2b  
|G.......&.l3tO"+|
....

If you have some debug patch, I can apply it so we can understand the 
issue.

Thanks
Tudor Ambarus Nov. 15, 2023, 6:10 a.m. UTC | #2
On Wed, 01 Nov 2023 14:58:47 +0000, Tudor Ambarus wrote:
> The patch set is just compiled tested as I don't have a multi die flash
> at hand. Takahiro and Fabio, please test the series and let me know if
> it works on your side.
> 
> This will be followed by the removal of SNOR_F_NO_OP_CHIP_ERASE and
> implicitly of the old xilinx SPI NOR driver, but let's take it all in
> small bites.
> 
> [...]

Applied to git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git,
spi-nor/next branch. Thanks!

[1/6] mtd: spi-nor: use kernel sized types instead of c99 types
      https://git.kernel.org/mtd/c/075ede8d20f8

Cheers,