mtd: spi-nor: atmel: add at25ff321a entry
[email protected]
maintainerPATCH v2 1/1 mtd: spi-nor: atmel: add at25ff321a entry
From: Nicolas Ferre <[email protected]>
Add the at25ff321a 4MB SPI flash which is able to provide
SFDP informations.
Datasheet: https://www.renesas.com/us/en/document/dst/at25ff321a-datasheet
---
v1 -> v2: - adapt to new struct flash_info atmel_nor_parts init
- don't set the no_sfdp_flags property
Hi,
This flash is present on the MikoE flash 10 Click board and was tested on sama7g5-ek at spi frequency of 80 MHz:
Here are the tests that I ran:
root@sama5d27-wlsom1-ek-sd:~# dd if=/dev/urandom of=./spi_test bs=1M count=3 3+0 records in 3+0 records out 3145728 bytes (3.1 MB, 3.0 MiB) copied, 0.285407 s, 11.0 MB/s root@sama5d27-wlsom1-ek-sd:~# mtd_debug write /dev/mtd0 0 3145728 spi_test Copied 3145728 bytes from spi_test to address 0x00000000 in flash root@sama5d27-wlsom1-ek-sd:~# mtd_debug erase /dev/mtd0 0 3145728 Erased 3145728 bytes from address 0x00000000 in flash root@sama5d27-wlsom1-ek-sd:~# mtd_debug read /dev/mtd0 0 3145728 spi_read Copied 3145728 bytes from address 0x00000000 in flash to spi_read root@sama5d27-wlsom1-ek-sd:~# hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0300000 root@sama5d27-wlsom1-ek-sd:~# mtd_debug write /dev/mtd0 0 3145728 spi_test Copied 3145728 bytes from spi_test to address 0x00000000 in flash root@sama5d27-wlsom1-ek-sd:~# mtd_debug read /dev/mtd0 0 3145728 spi_read Copied 3145728 bytes from address 0x00000000 in flash to spi_read root@sama5d27-wlsom1-ek-sd:~# sha1sum spi_test spi_read 4de5dbe39ab24b169e9dad01a8cc12c4756270a2 spi_test 4de5dbe39ab24b169e9dad01a8cc12c4756270a2 spi_read
root@sama5d27-wlsom1-ek-sd:~# cat /sys/bus/spi/devices/spi0.1/spi-nor/partname at25ff321a root@sama5d27-wlsom1-ek-sd:~# cat /sys/bus/spi/devices/spi0.1/spi-nor/jedec_id 1f4708 root@sama5d27-wlsom1-ek-sd:~# cat /sys/bus/spi/devices/spi0.1/spi-nor/manufacturer atmel root@sama5d27-wlsom1-ek-sd:~# hexdump -C /sys/bus/spi/devices/spi0.1/spi-nor/sfdp 00000000 53 46 44 50 06 01 00 ff 00 06 01 10 10 00 00 ff |SFDP............| 00000010 e5 20 e1 ff ff ff ff 01 40 eb 08 6b 08 3b 00 ff |. [email protected].;..| 00000020 ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 |............. .R| 00000030 10 d8 00 ff 50 2a 2a 01 82 ff 9c d2 64 c1 08 46 |....P**.....d..F| 00000040 7a 75 7a 75 f7 c4 d5 5c 00 06 51 ff 88 30 00 00 |zuzu...\..Q..0..| 00000050 root@sama5d27-wlsom1-ek-sd:~# md5sum /sys/bus/spi/devices/spi0.1/spi-nor/sfdp d540f07cbfb7c9c19654c453b561b311 /sys/bus/spi/devices/spi0.1/spi-nor/sfdp
# # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
root@sama5d27-wlsom1-ek-sd:~# mtdinfo /dev/mtd0 mtd0 Name: spi0.1 Type: nor Eraseblock size: 65536 bytes, 64.0 KiB Amount of eraseblocks: 64 (4194304 bytes, 4.0 MiB) Minimum input/output unit size: 1 byte Sub-page size: 1 byte Character device major/minor: 90:0 Bad blocks are allowed: false Device is writable: true
Best regards,
Nicolas
drivers/mtd/spi-nor/atmel.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/mtd/spi-nor/atmel.c +5 -0
@@ -213,6 +213,11 @@ static const struct flash_info atmel_nor_parts[] = { .flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags = SECT_4K, .fixups = &atmel_nor_global_protection_fixups + }, { + .id = SNOR_ID(0x1f, 0x47, 0x08), + .name = "at25ff321a", + .flags = SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .fixups = &atmel_nor_global_protection_fixups }, { .id = SNOR_ID(0x1f, 0x48, 0x00), .name = "at25df641",
Signature · 1 line
2.39.2
Tudor Ambarus
AppliedQuoted 2 lines · On Tue, 26 Sep 2023 15:16:55 +0200, [email protected] wrote:
Add the at25ff321a 4MB SPI flash which is able to provide SFDP informations.
s/informations/information
Quoted 1 line
Datasheet: https://www.renesas.com/us/en/document/dst/at25ff321a-datasheet
s/Datasheet/Link
Quoted 2 lines
Applied to git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git,
spi-nor/next branch. Thanks!
[1/1] mtd: spi-nor: atmel: add at25ff321a entry
https://git.kernel.org/mtd/c/8f407eda173f
Cheers,
Signature · 1 line
Tudor Ambarus <[email protected]>