[PATCH v2 2/6] mtd: spi-nor: add erase die (chip) capability

Fabio Estevam festevam at denx.de
Fri Nov 3 05:30:27 PDT 2023


Hi Tudor,

On 03/11/2023 08:47, Tudor Ambarus wrote:

> I think I know what happens with your flash. Please try the debug patch
> from https://github.com/ambarus/linux-0day.git
> spi-nor/next-die-erase-v2-debug.
> 
> I assume your flash works in 3-byte mode. The die erase cmd needs an
> extended register in 3-byte mode otherwise is ignored. Please try the
> patch and let me know if it works.

Progress: with this one, I see that the whole flash was erased:

~# flash_erase /dev/mtd0 0 0
Erasing 131072 Kibyte @ 0 --  0 [   39.865773] spi-nor spi0.0: ***** 
nor->reg_proto = 0x00010101
% complete [   39.874441] spi-nor spi0.0: *****
[   39.878712] spi-nor spi0.0: ***** op.cmd.nbytes = 0x01
[   39.883983] spi-nor spi0.0: ***** op.cmd.buswidth = 0x01
[   39.889402] spi-nor spi0.0: ***** op.cmd.opcode = 0xc4
[   39.894648] spi-nor spi0.0: *****
[   39.897979] spi-nor spi0.0: ***** op.addr.nbytes = 0x04
[   39.903309] spi-nor spi0.0: ***** op.addr.buswidth = 0x01
[   39.908810] spi-nor spi0.0: ***** op.addr.buswidth = 0x0
[   39.914226] spi-nor spi0.0: *****
[   39.917558] spi-nor spi0.0: ***** op.dummy.nbytes = 0x00
[   39.922981] spi-nor spi0.0: ***** op.dummy.buswidth = 0x00
[   39.928570] spi-nor spi0.0: *****
[   39.931905] spi-nor spi0.0: ***** op.data.buswidth = 0x00
[   39.937403] spi-nor spi0.0: ***** op.data.nbytes = 0

[  157.398677] spi-nor spi0.0: ***** nor->reg_proto = 0x00010101
[  157.404543] spi-nor spi0.0: *****
[  157.407878] spi-nor spi0.0: ***** op.cmd.nbytes = 0x01
[  157.413133] spi-nor spi0.0: ***** op.cmd.buswidth = 0x01
[  157.418549] spi-nor spi0.0: ***** op.cmd.opcode = 0xc4
[  157.423799] spi-nor spi0.0: *****
[  157.427130] spi-nor spi0.0: ***** op.addr.nbytes = 0x04
[  157.432461] spi-nor spi0.0: ***** op.addr.buswidth = 0x01
[  157.437963] spi-nor spi0.0: ***** op.addr.buswidth = 0x4000000
[  157.443900] spi-nor spi0.0: *****
[  157.447229] spi-nor spi0.0: ***** op.dummy.nbytes = 0x00
[  157.452648] spi-nor spi0.0: ***** op.dummy.buswidth = 0x00
[  157.458239] spi-nor spi0.0: *****
[  157.461558] spi-nor spi0.0: ***** op.data.buswidth = 0x00
[  157.467066] spi-nor spi0.0: ***** op.data.nbytes = 0
Erasing 131072 Kibyte @ 0 -- 100 % complete

~# hexdump /dev/mtd0
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
8000000

The problem I see is that the erase operation was super slow.

Please see the timestamps to get an idea.

Is this slow-erase behavior expected? Please note that the
SPI controller on the i.MX8MP does not have DMA support at the moment.

Thanks!



More information about the linux-arm-kernel mailing list