mtd: spi-nor: spansion: Add support for s28hl512t, s28hl01gt, and s28hs01gt
Subsystems (2)
v2 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).
v2 removes NO_SFDP_FLAGS by adding read and page program settings in xSPI profile 1.0 parse.
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 (4):
mtd: spi-nor: sfdp: Update params->hwcaps.mask at xSPI profile 1.0
table parse
mtd: spi-nor: spansion: Remove NO_SFDP_FLAGS from s28hs512t info
mtd: spi-nor: spansion: Rename s28hs512t prefix
mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt info
drivers/mtd/spi-nor/sfdp.c | 7 ++++++ drivers/mtd/spi-nor/spansion.c | 45 +++++++++++++++++++++------------- 2 files changed, 35 insertions(+), 17 deletions(-)
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v2 1/4 mtd: spi-nor: sfdp: Update params->hwcaps.mask at xSPI profile 1.0 table parse
From: Takahiro Kuwano <[email protected]>
Existece of xSPI profile 1.0 table implies that the flash supports read and program in 8D-8D-8D mode. Update the params->hwcaps.mask in spi_nor_parase_profile1().
--- drivers/mtd/spi-nor/sfdp.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mtd/spi-nor/sfdp.c +7 -0
@@ -1183,10 +1183,17 @@ static int spi_nor_parse_profile1(struct spi_nor *nor, dummy =round_up (dummy,2 );/* Update the fast read settings. */ + nor->params->hwcaps.mask |=SNOR_HWCAPS_READ_8_8_8_DTR ;spi_nor_set_read_settings (&nor->params->reads[SNOR_CMD_READ_8_8_8_DTR ],0 , dummy, opcode,SNOR_PROTO_8_8_8_DTR ); +/* +* Page Program is "Required Command" in the xSPI Profile 1.0. Update +* the params->hwcaps.mask here. +*/ + nor->params->hwcaps.mask |=SNOR_HWCAPS_PP_8_8_8_DTR ; + out:kfree (dwords);return ret;
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v2 2/4 mtd: spi-nor: spansion: Remove NO_SFDP_FLAGS from s28hs512t info
In reply to [email protected]From: Takahiro Kuwano <[email protected]>
Read, Page Program, and Sector Erase settings are done in SFDP so we can remove NO_SFDP_FLAGS from s28hs512t info. Since the default_init() is no longer called after removing NO_SFDP_FLAGS, the initialization in the default_init() is moved to late_init().
--- drivers/mtd/spi-nor/spansion.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/mtd/spi-nor/spansion.c +8 -9
@@ -281,12 +281,6 @@ 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) -{ - nor->params->octal_dtr_enable = cypress_nor_octal_dtr_enable; - nor->params->writesize =16 ; -} -static void s28hs512t_post_sfdp_fixup (struct spi_nor *nor) {/*
@@ -322,10 +316,16 @@ static int s28hs512t_post_bfpt_fixup(struct spi_nor *nor,return cypress_nor_set_page_size (nor); } +static void s28hs512t_late_init (struct spi_nor *nor) +{ + nor->params->octal_dtr_enable = cypress_nor_octal_dtr_enable; + nor->params->writesize =16 ; +} +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, + .late_init = s28hs512t_late_init, }; static int
@@ -460,8 +460,7 @@ static const struct flash_info spansion_nor_parts[] = { { "cy15x104q", INFO6(0x042cc2, 0x7f7f7f, 512 * 1024, 1) FLAGS(SPI_NOR_NO_ERASE) }, { "s28hs512t", INFO(0x345b1a, 0, 256 * 1024, 256) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_OCTAL_DTR_READ | - SPI_NOR_OCTAL_DTR_PP) + PARSE_SFDP .fixups = &s28hs512t_fixups, }, };
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v2 3/4 mtd: spi-nor: spansion: Rename s28hs512t prefix
In reply to [email protected]From: Takahiro Kuwano <[email protected]>
Change prefix to support all other devices in SEMPER S28 family.
---
Changes in v2:
- Fix wrong indentation
drivers/mtd/spi-nor/spansion.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/mtd/spi-nor/spansion.c +10 -10
@@ -281,7 +281,7 @@ static int cypress_nor_octal_dtr_enable(struct spi_nor *nor, bool enable)cypress_nor_octal_dtr_dis (nor); } -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
@@ -309,23 +309,23 @@ 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, -const struct sfdp_parameter_header *bfpt_header, -const struct sfdp_bfpt *bfpt) +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 void s28hs512t_late_init (struct spi_nor *nor) +static void s28hx_t_late_init (struct spi_nor *nor) { nor->params->octal_dtr_enable = cypress_nor_octal_dtr_enable; nor->params->writesize =16 ; } -static const struct spi_nor_fixups s28hs512t_fixups = { - .post_sfdp = s28hs512t_post_sfdp_fixup, - .post_bfpt = s28hs512t_post_bfpt_fixup, - .late_init = s28hs512t_late_init, +static const struct spi_nor_fixups s28hx_t_fixups = { + .post_sfdp = s28hx_t_post_sfdp_fixup, + .post_bfpt = s28hx_t_post_bfpt_fixup, + .late_init = s28hx_t_late_init, }; static int
@@ -461,7 +461,7 @@ static const struct flash_info spansion_nor_parts[] = { FLAGS(SPI_NOR_NO_ERASE) }, { "s28hs512t", INFO(0x345b1a, 0, 256 * 1024, 256) PARSE_SFDP - .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/
PATCH v2 4/4 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/mtd/spi-nor/spansion.c +12 -0
@@ -459,10 +459,22 @@ 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) + PARSE_SFDP + .fixups = &s28hx_t_fixups, + }, + { "s28hl01gt", INFO(0x345a1b, 0, 256 * 1024, 512) + PARSE_SFDP + .fixups = &s28hx_t_fixups, + }, { "s28hs512t", INFO(0x345b1a, 0, 256 * 1024, 256) PARSE_SFDP .fixups = &s28hx_t_fixups, }, + { "s28hs01gt", INFO(0x345b1b, 0, 256 * 1024, 512) + PARSE_SFDP + .fixups = &s28hx_t_fixups, + }, }; /**
Signature · 6 lines
2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Tudor Ambarus
AppliedQuoted 9 lines · On Wed, 31 Aug 2022 13:59:02 +0900, [email protected] wrote:
From: Takahiro Kuwano <[email protected]>
These devices are variants of s28hs512t(1.8V 512Mb) with different density(1Gb) and power supply voltage(3V).
[...]
Applied to spi-nor/next, thanks!
[1/4] mtd: spi-nor: sfdp: Update params->hwcaps.mask at xSPI profile 1.0 table parse
https://git.kernel.org/mtd/c/d189614f2479 [2/4] mtd: spi-nor: spansion: Remove NO_SFDP_FLAGS from s28hs512t info https://git.kernel.org/mtd/c/db391efe765c [3/4] mtd: spi-nor: spansion: Rename s28hs512t prefix https://git.kernel.org/mtd/c/06051322704b [4/4] mtd: spi-nor: spansion: Add s28hl512t, s28hl01gt, and s28hs01gt info https://git.kernel.org/mtd/c/aff1fa414a85
Best regards,
Signature · 5 lines
Tudor Ambarus <[email protected]> ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/