[PATCH v2 3/3] mtd: spi-nor: fujitsu: Add support for MB85RS4MTY chip
From: Ronan Dalton
Date: Thu Jun 25 2026 - 22:23:02 EST
The MB85RS4MTY chip is similar to the MB85RS1MT chip, but it has a
higher capacity and can handle higher temperatures. Compared to the
MB85RS1MT chip, this chip has an expanded set of opcodes which allow
control over power-saving modes, access to a special sector data area,
and reading of the unique ID and serial number. However, since the
spi-nor subsystem doesn't support these extended abilities, they are not
taken advantage of here.
Add support for this chip by adding an entry to the fujitsu_nor_parts
table.
Signed-off-by: Ronan Dalton <ronan.dalton@xxxxxxxxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-mtd@xxxxxxxxxxxxxxxxxxx
Cc: Pratyush Yadav <pratyush@xxxxxxxxxx>
Cc: Michael Walle <mwalle@xxxxxxxxxx>
Cc: Takahiro Kuwano <takahiro.kuwano@xxxxxxxxxxxx>
Cc: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Cc: Richard Weinberger <richard@xxxxxx>
Cc: Vignesh Raghavendra <vigneshr@xxxxxx>
Cc: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>
Cc: Aryan Srivastava <aryan.srivastava@xxxxxxxxxxxxxxxxxxx>
---
Changes in v2:
- Fix the debug information below missing some lines because of leading
'#' symbols in the original patch notes
This flash is populated on the Allied Telesis x950GEN2 board and was
tested at 40 MHz using the armada-380 (CN9130) SPI controller.
$ cat /sys/bus/spi/devices/spi1.2/spi-nor/partname
mb85rs4mty
$ cat /sys/bus/spi/devices/spi1.2/spi-nor/jedec_id
047f49
$ cat /sys/bus/spi/devices/spi1.2/spi-nor/manufacturer
fujitsu
$ xxd -p /sys/bus/spi/devices/spi1.2/spi-nor/sfdp
xxd: /sys/bus/spi/devices/spi1.2/spi-nor/sfdp: No such file or directory
^ Expected since SFDP isn't used (flash size is hard-coded)
$ cat /sys/kernel/debug/spi-nor/spi1.2/capabilities
Supported read modes by the flash
1S-1S-1S
opcode 0x03
mode cycles 0
dummy cycles 0
Supported page program modes by the flash
1S-1S-1S
opcode 0x02
$ cat /sys/kernel/debug/spi-nor/spi1.2/params
name mb85rs4mty
id 04 7f 49 0b ff ff
size 512 KiB
write size 1
page size 256
address nbytes 3
flags HAS_16BIT_SR
opcodes
read 0x03
dummy cycles 0
erase 0xd8
program 0x02
8D extension none
protocols
read 1S-1S-1S
write 1S-1S-1S
register 1S-1S-1S
erase commands
d8 (512 KiB) [0]
c7 (512 KiB)
sector map
region (in hex) | erase mask | overlaid
------------------+------------+----------
00000000-0007ffff | [0 ] | no
$ dd if=/dev/urandom of=./spi_test bs=1K count=512
512+0 records in
512+0 records out
524288 bytes (512.0KB) copied, 0.723481 seconds, 707.7KB/s
$ mtd_debug erase /dev/mtd5 0 524288
MEMERASE: Unknown error 524
^ 524 is ENOTSUPP which is expected because of SPI_NOR_NO_ERASE flag
$ mtd_debug read /dev/mtd5 0 524288 spi_read
Copied 524288 bytes from address 0x00000000 in flash to spi_read
$ hexdump spi_read | head
0000000 da13 14ec beac 3864 78cb a48b 29a7 1edc
0000010 446e 772a f20a bcd1 9edb 8b40 bcf5 544c
0000020 3152 63a1 3081 bcb6 852f 06da f19a 284d
0000030 1655 4d58 62d7 bd42 90fb 7921 0be8 3ee7
0000040 3e78 c995 ba19 4f10 09bc b67c d7da aff7
0000050 e6f9 0691 a5a8 a40e 9a5d bfef 652e ba36
0000060 60f6 3ecf dfdb 32cb b4b8 b7b4 a0f8 d307
0000070 19d7 456b 1f35 296c 7e85 7fbc d1ff b1cf
0000080 28f9 06dd 55df 1f7a 1309 50f3 e30b 14c2
0000090 3638 6c9b dee0 3101 9b11 e03c 9a01 c0bd
^ just leftover data
$ openssl dgst -sha256 -r spi_read
722489d44edaccfda786c82c63037ae90733998e02d81e985db54588b229ee83 *spi_read
$ mtd_debug write /dev/mtd5 0 524288 spi_test
Copied 524288 bytes from spi_test to address 0x00000000 in flash
$ mtd_debug read /dev/mtd5 0 524288 spi_read
Copied 524288 bytes from address 0x00000000 in flash to spi_read
$ openssl dgst -sha256 -r spi*
343037c927f0dcdf1ae42d51730d316103aca620e701ab9762440d403c057312 *spi_read
343037c927f0dcdf1ae42d51730d316103aca620e701ab9762440d403c057312 *spi_test
$ mtd_debug info /dev/mtd5
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_RAM
mtd.size = 524288 (512K)
mtd.erasesize = 524288 (512K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0
drivers/mtd/spi-nor/fujitsu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/mtd/spi-nor/fujitsu.c b/drivers/mtd/spi-nor/fujitsu.c
index 3777c80251c5..32d5404b7402 100644
--- a/drivers/mtd/spi-nor/fujitsu.c
+++ b/drivers/mtd/spi-nor/fujitsu.c
@@ -15,6 +15,12 @@ static const struct flash_info fujitsu_nor_parts[] = {
.size = SZ_128K,
.sector_size = SZ_128K,
.flags = SPI_NOR_NO_ERASE,
+ }, {
+ .id = SNOR_ID(0x04, 0x7f, 0x49),
+ .name = "mb85rs4mty",
+ .size = SZ_512K,
+ .sector_size = SZ_512K,
+ .flags = SPI_NOR_NO_ERASE
}
};
--
2.54.0