[PATCH 1/2] mtd: spi-nor: spansion: Add support for S28HL256T

tkuw584924 at gmail.com tkuw584924 at gmail.com
Wed Dec 18 23:06:15 PST 2024


From: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>

Infineon S28HL256T is 3.0V, 256Mb Flash device with Octal interface.
It has the same functionalities with S28HS256T(1.8V).

Link: https://www.infineon.com/dgdl/Infineon-S28HS256T_S28HL256T_256Mb_SEMPER_Flash_Octal_interface_1_8V_3-DataSheet-v02_00-EN.pdf?fileId=8ac78c8c8fc2dd9c018fc66787aa0657
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
---

Tested on Xilinx Zynq-7000 board and Infineon internal SPI controller.

zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
345a19

zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer
spansion

zynq> xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
53464450080105fe00000114000100ff84000102500100ff050001055801
00ff8700011c6c0100ff0a000104dc0100ff81000116ec0100ffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffff7218affffffff0f000000000000
0000eeffffffffff0000ffff00000c2100ff00ff12dc23faff8b82e7ffe1
ec2319497ab07ab0f766805c000000fff910f8a10000087c0000bc020000
0000ffff7e7e41129fff21ffffdc00ee800b7171656500b0ff96a80b0000
0c551ca20000800000000000c0ccffeb88fbffeb00650090060500a10065
009600650095716503d0716503d0a46bfb0290a579a20040288e0000ff00
0000ff0071650690716506900000000000000000716506d1716506d17165
0691716506910000ff000000ff00716505d5716505d50000a01500000601
000000000080710500004306fc65ff0804008000fc65ff4002008000fd65
ff0402008000fe0002fff1ff0100f8ff0100f8fffb01fe0102fff8fffb01
f8ff0100f1ff0100fe0204fff1ff0000f8ff0200f8fff701f8ff0200f1ff
0000ff0400fff8ffff01

zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
c6192565cabd0fdf52af924e204ed18b5bd2dc5f129a680da8cb0bda34d5464b  /sys/bus/spi/devices/spi0.0/spi-nor/sfdp

zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities
Supported read modes by the flash
 1S-1S-1S
  opcode        0x13
  mode cycles   0
  dummy cycles  0
 1S-1S-8S
  opcode        0x7c
  mode cycles   0
  dummy cycles  8
 8D-8D-8D
  opcode        0xee
  mode cycles   0
  dummy cycles  24

Supported page program modes by the flash
 1S-1S-1S
  opcode        0x12
 8D-8D-8D
  opcode        0x12


zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params
name            (null)
id              34 5a 19 0f 03 90
size            32.0 MiB
write size      16
page size       256
address nbytes  4
flags           4B_OPCODES | HAS_4BAIT | HAS_16BIT_SR | IO_MODE_EN_VOLATILE | SOFT_RESET | ECC

opcodes
 read           0xee
  dummy cycles  24
 erase          0xdc
 program        0x12
 8D extension   repeat

protocols
 read           8D-8D-8D
 write          8D-8D-8D
 register       8D-8D-8D

erase commands
 21 (4.00 KiB) [2]
 dc (256 KiB) [3]
 c7 (32.0 MiB)

sector map
 region (in hex)   | erase mask | overlaid
 ------------------+------------+----------
 00000000-0001ffff |     [  2 ] | no
 00020000-0003ffff |     [   3] | yes
 00040000-01ffffff |     [   3] | no


zynq> mtd_debug info /dev/mtd0
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NANDFLASH
mtd.size = 33554432 (32M)
mtd.erasesize = 262144 (256K)
mtd.writesize = 16
mtd.oobsize = 0
regions = 3

region[0].offset = 0x00000000
region[0].erasesize = 4096 (4K)
region[0].numblocks = 32
region[0].regionindex = 0
region[1].offset = 0x00020000
region[1].erasesize = 131072 (128K)
region[1].numblocks = 1
region[1].regionindex = 1
region[2].offset = 0x00040000
region[2].erasesize = 262144 (256K)
region[2].numblocks = 127
region[2].regionindex = 2

zynq> ./test_spi.sh
random: crng init done
2+0 records in
2+0 records out
2097152 bytes (2.0MB) copied, 3.049923 seconds, 671.5KB/s

Erased 2097152 bytes from address 0x00000000 in flash
Copied 2097152 bytes from address 0x00000000 in flash to spi_read
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0200000
4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5  spi_read

Copied 2097152 bytes from spi_test to address 0x00000000 in flash
Copied 2097152 bytes from address 0x00000000 in flash to spi_read
d97ac743a6fa312253c374d13a6b61f8f6a11c6cb34f37e7449de93f404383bb  spi_read
d97ac743a6fa312253c374d13a6b61f8f6a11c6cb34f37e7449de93f404383bb  spi_test

Erased 2097152 bytes from address 0x00000000 in flash
Copied 2097152 bytes from address 0x00000000 in flash to spi_read
4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5  spi_read
d97ac743a6fa312253c374d13a6b61f8f6a11c6cb34f37e7449de93f404383bb  spi_test


 drivers/mtd/spi-nor/spansion.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index 5a88a6096ca8..f8d8a908c92e 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -957,6 +957,10 @@ static const struct flash_info spansion_nor_parts[] = {
 		.name = "s25hs02gt",
 		.mfr_flags = USE_CLPEF,
 		.fixups = &s25hx_t_fixups
+	}, {
+		.id = SNOR_ID(0x34, 0x5a, 0x19),
+		.mfr_flags = USE_CLPEF,
+		.fixups = &s28hx_t_fixups,
 	}, {
 		.id = SNOR_ID(0x34, 0x5a, 0x1a),
 		.name = "s28hl512t",
-- 
2.34.1




More information about the linux-mtd mailing list