mtd: spi-nor: macronix: remove mx25u25635f from parts list to enable SFDP
Subsystems (2)
PATCH v2 1/1 mtd: spi-nor: macronix: remove mx25u25635f from parts list to enable SFDP
From: Parth Pancholi <[email protected]>
The Macronix mx25u25635f flash device supports SFDP initialization. This commit removes the specific mx25u25635f entry (NOR ID 0xc22539), along with its size and flags, from the NOR parts list. By removing this entry, both mx25u25635f and mx25u25645g (which share the same NOR ID) will utilize the generic flash driver configuration.
This change allows both devices (mx25u25635f and mx25u25645g) to leverage SFDP-defined parameters, enabling dual and quad read operations without the need for manual adjustment of no_sfdp_flags.
---
v2: enable SFDP for mx25u25635f(and mx25u25645g) by removing it's entry from parts list
mx25u25645g flash is populated on the Toradex Aquila development carrier board and was tested at 66 MHz frequency using the "ti,am654-ospi" SPI controller.
root@aquila-am69-02242602:~# cat /sys/bus/spi/devices/spi3.0/spi-nor/partname spi-nor-generic
root@aquila-am69-02242602:~# cat /sys/bus/spi/devices/spi3.0/spi-nor/jedec_id c22539c22539
root@aquila-am69-02242602:~# xxd -p /sys/bus/spi/devices/spi3.0/spi-nor/sfdp 53464450060102ff00060110300000ffc2000104100100ff84000102c000 00ffffffffffffffffffffffffffffffffffe520fbffffffff0f44eb086b 083b04bbfeffffffffff00ffffff44eb0c200f5210d800ff8749b50082d2 04d24403673830b030b0f7bdd55c4a9e29fff050f985ffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffff7f8fffff215cdcffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffff002050169df9c06485cbffffffffffff
root@aquila-am69-02242602:~# sha256sum /sys/bus/spi/devices/spi3.0/spi-nor/sfdp cc74a7490301b752a45fa147a860be43ed71a6f1cf598adae7ac38b19fb745f1 /sys/bus/spi/devices/spi3.0/spi-nor/sfdp
root@aquila-am69-02242602:~# cat /sys/kernel/debug/spi-nor/spi3.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4
Supported page program modes by the flash
1S-1S-1S
opcode 0x12
1S-4S-4S
opcode 0x3e
root@aquila-am69-02242602:~# cat /sys/kernel/debug/spi-nor/spi3.0/params name spi-nor-generic id c2 25 39 c2 25 39 size 32.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | SOFT_RESET
opcodes
read 0xec dummy cycles 6 erase 0x21 program 0x3e 8D extension none
protocols
read 1S-4S-4S write 1S-4S-4S register 1S-1S-1S
erase commands
21 (4.00 KiB) [1]
5c (32.0 KiB) [2]
dc (64.0 KiB) [3]
c7 (32.0 MiB)
sector map
region (in hex) | erase mask | flags
------------------+------------+----------
00000000-01ffffff | [ 123] |
root@aquila-am69-02242602:~# dd if=/dev/urandom of=./spi_test bs=1M count=2 2+0 records in 2+0 records out 2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.0147001 s, 143 MB/s
root@aquila-am69-02242602:~# mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash
root@aquila-am69-02242602:~# mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read
root@aquila-am69-02242602:~# hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000
root@aquila-am69-02242602:~# sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read
root@aquila-am69-02242602:~# mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash
root@aquila-am69-02242602:~# mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read
root@aquila-am69-02242602:~# sha256sum spi* 7156e42306db1fd79e6dfc22320adaa126b394361abde4777a679924cc9fc0fc spi_read 7156e42306db1fd79e6dfc22320adaa126b394361abde4777a679924cc9fc0fc spi_test
root@aquila-am69-02242602:~# mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash
root@aquila-am69-02242602:~# mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read
root@aquila-am69-02242602:~# sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 7156e42306db1fd79e6dfc22320adaa126b394361abde4777a679924cc9fc0fc spi_test
root@aquila-am69-02242602:~# mtd_debug info /dev/mtd0 mtd.type = MTD_NORFLASH mtd.flags = MTD_CAP_NORFLASH mtd.size = 33554432 (32M) mtd.erasesize = 4096 (4K) mtd.writesize = 1 mtd.oobsize = 0 regions = 0 --- drivers/mtd/spi-nor/macronix.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/mtd/spi-nor/macronix.c +0 -6
@@ -125,12 +125,6 @@ static const struct flash_info macronix_nor_parts[] = { .name = "mx25u12835f", .size = SZ_16M, .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - }, { - .id = SNOR_ID(0xc2, 0x25, 0x39), - .name = "mx25u25635f", - .size = SZ_32M, - .no_sfdp_flags = SECT_4K, - .fixup_flags = SPI_NOR_4B_OPCODES, }, { .id = SNOR_ID(0xc2, 0x25, 0x3a), .name = "mx25u51245g",
Signature · 1 line
2.34.1
Quoted 11 lines · Parth Pancholi
From: Parth Pancholi <[email protected]>
The Macronix mx25u25635f flash device supports SFDP initialization. This commit removes the specific mx25u25635f entry (NOR ID
0xc22539), along with its size and flags, from the NOR parts list. By removing this entry, both mx25u25635f and mx25u25645g (which share the same NOR ID) will utilize the generic flash driver configuration.This change allows both devices (mx25u25635f and mx25u25645g) to leverage SFDP-defined parameters, enabling dual and quad read operations without the need for manual adjustment of
no_sfdp_flags.
I'm fine with this. We may re-add an entry when BP is used or if someone reports there's a flash with this ID that doesn't support SFDP, which has a reasonable amount of probability for macronix flashes, but I'm ok taking the risk and fixing it afterwards if reported.
Waiting a bit more to get Michael's and Pratyush's opinions on this too.
Quoted 9 lines · Tudor Ambarus
Quoted 8 lines · Parth Pancholi
From: Parth Pancholi <[email protected]>
The Macronix mx25u25635f flash device supports SFDP initialization. This commit removes the specific mx25u25635f entry (NOR ID
0xc22539), along with its size and flags, from the NOR parts list. By removing this entry, both mx25u25635f and mx25u25645g (which share the same NOR ID) will utilize the generic flash driver configuration.
Quoted 8 lines
Quoted 3 lines
This change allows both devices (mx25u25635f and mx25u25645g) to leverage SFDP-defined parameters, enabling dual and quad read operations without the need for manual adjustment of
no_sfdp_flags.I'm fine with this. We may re-add an entry when BP is used or if someone reports there's a flash with this ID that doesn't support SFDP, which has a reasonable amount of probability for macronix flashes, but I'm ok taking the risk and fixing it afterwards if reported.
Sounds good. Would be a good idea to queue it early after -rc1 so it gets some time to bake in linux-next.
Signature · 2 lines
Regards, Pratyush Yadav
Quoted 8 lines · Parth Pancholi
From: Parth Pancholi <[email protected]>
The Macronix mx25u25635f flash device supports SFDP initialization. This commit removes the specific mx25u25635f entry (NOR ID
0xc22539), along with its size and flags, from the NOR parts list. By removing this entry, both mx25u25635f and mx25u25645g (which share the same NOR ID) will utilize the generic flash driver configuration.
Quoted 6 lines
This change allows both devices (mx25u25635f and mx25u25645g) to leverage SFDP-defined parameters, enabling dual and quad read operations without the need for manual adjustment of
no_sfdp_flags.
Applied to spi-nor/next. Thanks!
Signature · 2 lines
Regards, Pratyush Yadav