mtd: spi-nor: spansion: Add support for s28hl512t, s28hl01gt, and s28hs01gt
Subsystems (2)
cover mtd: spi-nor: spansion: Add support for s28hl512t, s28hl01gt, and s28hs01gt
From: Takahiro Kuwano <[email protected]>
These devices are variants of s28hs512t(1.8V 512Mb) with different density(1Gb) and power supply voltage(3V).
Tested on Zynq-7000 platform with Infineon SPI controller
ID, SFDP, Test logs:
-------------------------------------------------------------------------
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/partname s28hl512t
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
345a1a
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 ffffffffffffffffffffffffffffffffe7218affffffff1f000000000000 0000eeffffffffff0000ffff00000c2100ff00ff12dc23faff8b91e8ffe3 ec031c6030b030b0f766805c000000fff9f810a000000000000084020000 0000ffff7e7e43120ffe21ffffdc00ee809b0000000000b08c95a80b0000 0c551ca20000800000000000c0ccffeb88fbffeb00650090060500a10065 009600650095716503d0716503d0a46bfb0290a579a20040288e0000ff00 0000ff0071650690716506900000000000000000716506d1716506d17165 0691716506910000ff000000ff00716505d5716505d50000ee7200000601 000000008000710600030600fc65ff0804008000fc65ff4002008000fd65 ff0402008000fe0002fff1ff0100f8ff0100f8fffb03fe0302fff8fffb03 f8ff0100f1ff0100fe0104fff1ff0100f8ff0200f8fff703f8ff0200f1ff 0100ff0400fff8ffff03
zynq> md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp b7661a9fd55106d44f80f06e5b38f592 /sys/bus/spi/devices/spi0.0/spi-nor/sfdp zynq> test_qspi.sh
6+0 records in
6+0 records out
6291456 bytes (6.0MB) copied, 0.231607 seconds, 25.9MB/s Copied 6291456 bytes from qspi_test to address 0x00000000 in flash Erased 6291456 bytes from address 0x00000000 in flash
Copied 6291456 bytes from address 0x00000000 in flash to qspi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0600000
Copied 6291456 bytes from qspi_test to address 0x00000000 in flash Copied 6291456 bytes from address 0x00000000 in flash to qspi_read 7ca01dfbd718151b749ab6ac05f316d199bbda25 qspi_test 7ca01dfbd718151b749ab6ac05f316d199bbda25 qspi_read
-------------------------------------------------------------------------
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/partname s28hl01gt
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
345a1b
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 fffffffffffffffffffffffffffffffff7218affffffff3f000000000000 0000eeffffffffff0000ffff00000c2100ff00ff12dc23faff8b82e7ffe6 ec031c607ab07ab0f766805c000000fff910f8a0000000000000bc020000 0000ffff7e7e41120ffe21ffffdc00ee800b7171656500b0ff96a80b0000 0c551ca20000800000000000c0ccffeb88fbffeb00650090060500a10065 009600650095716503d0716503d0a46bfb0290a579a20040288e0000ff00 0000ff0071650690716506900000000000000000716506d1716506d17165 0691716506910000ff000000ff00716505d5716505d50000a01500000601 000000000080710500004306fc65ff0804008000fc65ff4002008000fd65 ff0402008000fe0002fff1ff0100f8ff0100f8fffb07fe0302fff8fffb07 f8ff0100f1ff0100fe0104fff1ff0000f8ff0200f8fff707f8ff0200f1ff 0000ff0400fff8ffff07
zynq> md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 0fbb3fac2bc788513976d01840fd598f /sys/bus/spi/devices/spi0.0/spi-nor/sfdp zynq> test_qspi.sh
6+0 records in
6+0 records out
6291456 bytes (6.0MB) copied, 0.231796 seconds, 25.9MB/s Copied 6291456 bytes from qspi_test to address 0x00000000 in flash Erased 6291456 bytes from address 0x00000000 in flash
Copied 6291456 bytes from address 0x00000000 in flash to qspi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0600000
Copied 6291456 bytes from qspi_test to address 0x00000000 in flash Copied 6291456 bytes from address 0x00000000 in flash to qspi_read 296c691a4653e0f5c334e1a9953d8cb4b1038d47 qspi_test 296c691a4653e0f5c334e1a9953d8cb4b1038d47 qspi_read
-------------------------------------------------------------------------
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/partname s28hs01gt
zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
345b1b
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 fffffffffffffffffffffffffffffffff7218affffffff3f000000000000 0000eeffffffffff0000ffff00000c2100ff00ff12dc23faff8b82e7ffe6 ec031c607ab07ab0f766805c000000fff910f8a0000000000000bc020000 0000ffff8e8e41120ffe21ffffdc00ee800b7171656500b0ff96a80b0000 0c551ca20000800000000000c0ccffeb88fbffeb00650090060500a10065 009600650095716503d0716503d0a46bfb0290a579a20040288e0000ff00 0000ff0071650690716506900000000000000000716506d1716506d17165 0691716506910000ff000000ff00716505d5716505d50000a01500000601 000000000080710500004306fc65ff0804008000fc65ff4002008000fd65 ff0402008000fe0002fff1ff0100f8ff0100f8fffb07fe0302fff8fffb07 f8ff0100f1ff0100fe0104fff1ff0000f8ff0200f8fff707f8ff0200f1ff 0000ff0400fff8ffff07
zynq> md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 08db437d1890431e1d35284579100222 /sys/bus/spi/devices/spi0.0/spi-nor/sfdp zynq> test_qspi.sh
6+0 records in
6+0 records out
6291456 bytes (6.0MB) copied, 0.232206 seconds, 25.8MB/s Copied 6291456 bytes from qspi_test to address 0x00000000 in flash Erased 6291456 bytes from address 0x00000000 in flash
Copied 6291456 bytes from address 0x00000000 in flash to qspi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0600000
Copied 6291456 bytes from qspi_test to address 0x00000000 in flash Copied 6291456 bytes from address 0x00000000 in flash to qspi_read 1af7d491e78b33caa6c72d2f0062658dafe52451 qspi_test 1af7d491e78b33caa6c72d2f0062658dafe52451 qspi_read
-------------------------------------------------------------------------
Takahiro Kuwano (2):
mtd: spi-nor: spansion: Rename s28hs512t prefix
mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt info
drivers/mtd/spi-nor/spansion.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-)
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH 1/2 mtd: spi-nor: spansion: Rename s28hs512t prefix
From: Takahiro Kuwano <[email protected]>
Change prefix to support all other devices in SEMPER S28 family.
--- drivers/mtd/spi-nor/spansion.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/mtd/spi-nor/spansion.c +8 -8
@@ -281,13 +281,13 @@ static int cypress_nor_octal_dtr_enable(struct spi_nor *nor, bool enable)cypress_nor_octal_dtr_dis (nor); } -static void s28hs512t_default_init (struct spi_nor *nor) +static void s28hx_t_default_init (struct spi_nor *nor) { nor->params->octal_dtr_enable = cypress_nor_octal_dtr_enable; nor->params->writesize =16 ; } -static void s28hs512t_post_sfdp_fixup (struct spi_nor *nor) +static void s28hx_t_post_sfdp_fixup (struct spi_nor *nor) {/* * On older versions of the flash the xSPI Profile 1.0 table has the
@@ -315,17 +315,17 @@ static void s28hs512t_post_sfdp_fixup(struct spi_nor *nor) nor->params->rdsr_addr_nbytes =4 ; } -static int s28hs512t_post_bfpt_fixup (struct spi_nor *nor, +static int s28hx_t_post_bfpt_fixup (struct spi_nor *nor,const struct sfdp_parameter_header *bfpt_header,const struct sfdp_bfpt *bfpt) {return cypress_nor_set_page_size (nor); } -static const struct spi_nor_fixups s28hs512t_fixups = { - .default_init = s28hs512t_default_init, - .post_sfdp = s28hs512t_post_sfdp_fixup, - .post_bfpt = s28hs512t_post_bfpt_fixup, +static const struct spi_nor_fixups s28hx_t_fixups = { + .default_init = s28hx_t_default_init, + .post_sfdp = s28hx_t_post_sfdp_fixup, + .post_bfpt = s28hx_t_post_bfpt_fixup, }; static int
@@ -462,7 +462,7 @@ static const struct flash_info spansion_nor_parts[] = { { "s28hs512t", INFO(0x345b1a, 0, 256 * 1024, 256) NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | SPI_NOR_OCTAL_DTR_PP) - .fixups = &s28hs512t_fixups, + .fixups = &s28hx_t_fixups, }, };
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH 1/2] mtd: spi-nor: spansion: Rename s28hs512t prefix
Am 2022-08-25 04:20, schrieb [email protected]:
Quoted 5 lines
From: Takahiro Kuwano <[email protected]>
Change prefix to support all other devices in SEMPER S28 family.
Signed-off-by Takahiro Kuwano <[email protected]>
I'm still no fan of all the renames. But I don't think this will do any more harm than what there already is :)
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH 2/2 mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt info
In reply to [email protected]From: Takahiro Kuwano <[email protected]>
Add flash info table entries for s28hl512gt, s28hl01gt, and s28hs01gt. These devices have the same functionality as s28hs512t.
--- drivers/mtd/spi-nor/spansion.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/mtd/spi-nor/spansion.c +15 -0
@@ -459,11 +459,26 @@ static const struct flash_info spansion_nor_parts[] = { .fixups = &s25hx_t_fixups }, { "cy15x104q", INFO6(0x042cc2, 0x7f7f7f, 512 * 1024, 1) FLAGS(SPI_NOR_NO_ERASE) }, + { "s28hl512t", INFO(0x345a1a, 0, 256 * 1024, 256) + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | + SPI_NOR_OCTAL_DTR_PP) + .fixups = &s28hx_t_fixups, + }, + { "s28hl01gt", INFO(0x345a1b, 0, 256 * 1024, 512) + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | + SPI_NOR_OCTAL_DTR_PP) + .fixups = &s28hx_t_fixups, + }, { "s28hs512t", INFO(0x345b1a, 0, 256 * 1024, 256) NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | SPI_NOR_OCTAL_DTR_PP) .fixups = &s28hx_t_fixups, }, + { "s28hs01gt", INFO(0x345b1b, 0, 256 * 1024, 512) + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | + SPI_NOR_OCTAL_DTR_PP) + .fixups = &s28hx_t_fixups, + }, }; /**
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH 2/2] mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt info
Am 2022-08-25 04:20, schrieb [email protected]:
Quoted 15 lines
From: Takahiro Kuwano <[email protected]>
Add flash info table entries for s28hl512gt, s28hl01gt, and s28hs01gt. These devices have the same functionality as s28hs512t.
Signed-off-by Takahiro Kuwano <[email protected]>--- drivers/mtd/spi-nor/spansion.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)drivers/mtd/spi-nor/spansion.c +0
-0
drivers/mtd/spi-nor/spansion.c static const struct flash_info · line 465
Quoted 7 lines
drivers/mtd/spi-nor/spansion.c +3
-0@@ -459,11 +459,26 @@ static const struct flash_info spansion_nor_parts[] = { .fixups = &s25hx_t_fixups }, { "cy15x104q", INFO6(0x042cc2, 0x7f7f7f, 512 * 1024, 1) FLAGS(SPI_NOR_NO_ERASE) }, + { "s28hl512t", INFO(0x345a1a, 0, 256 * 1024, 256) +NO_SFDP_FLAGS (SECT_4K |SPI_NOR_OCTAL_DTR_READ | +SPI_NOR_OCTAL_DTR_PP )
Do you really need the NO_SFDP_FLAGS here? And then the usual:
could you test with
{ "s28hl512t", INFO(0x345a1a, 0, 0, 0)
.fixups = &s28hx_t_fixups,
},You might need
https://lore.kernel.org/linux-mtd/[email protected]/
-michael
Quoted 19 lines
drivers/mtd/spi-nor/spansion.c +12
-0+ .fixups = &s28hx_t_fixups, + }, + { "s28hl01gt", INFO(0x345a1b, 0, 256 * 1024, 512) +NO_SFDP_FLAGS (SECT_4K |SPI_NOR_OCTAL_DTR_READ | +SPI_NOR_OCTAL_DTR_PP ) + .fixups = &s28hx_t_fixups, + }, { "s28hs512t", INFO(0x345b1a, 0, 256 * 1024, 256)NO_SFDP_FLAGS (SECT_4K |SPI_NOR_OCTAL_DTR_READ |SPI_NOR_OCTAL_DTR_PP ) .fixups = &s28hx_t_fixups, }, + { "s28hs01gt", INFO(0x345b1b, 0, 256 * 1024, 512) + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | + SPI_NOR_OCTAL_DTR_PP) + .fixups = &s28hx_t_fixups, + }, };
Quoted 1 line
/**
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Re: [PATCH 2/2] mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt info
Quoted 11 lines · Michael Walle
Am 2022-08-25 04:20, schrieb [email protected]:
Quoted 10 lines
From: Takahiro Kuwano <[email protected]>
Add flash info table entries for s28hl512gt, s28hl01gt, and s28hs01gt. These devices have the same functionality as s28hs512t.
Signed-off-by Takahiro Kuwano <[email protected]>---
drivers/mtd/spi-nor/spansion.c | 15 +++++++++++++++1 file changed, 15 insertions(+)
Quoted 15 lines
drivers/mtd/spi-nor/spansion.c static const struct flash_info spansion_nor_parts[] = { · line 464
Quoted 11 lines
drivers/mtd/spi-nor/spansion.c +3
-0@@ -459,11 +459,26 @@ static const struct flash_info spansion_nor_parts[] = { .fixups = &s25hx_t_fixups }, { "cy15x104q", INFO6(0x042cc2, 0x7f7f7f, 512 * 1024, 1) FLAGS(SPI_NOR_NO_ERASE) }, + { "s28hl512t", INFO(0x345a1a, 0, 256 * 1024, 256) + NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | + SPI_NOR_OCTAL_DTR_PP)Do you really need the
NO_SFDP_FLAGShere? And then the usual:
could you test with
{ "s28hl512t",INFO(0x345a1a, 0, 0, 0)
PARSE_SFDP?
Quoted 3 lines
.fixups =
&s28hx_t_fixups,
},
With some minor changes in sfdp.c and spansion.c, it's working. I will do more tests then revise the series.
Thank you!
Takahiro
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/