* [PATCH v2 0/3] mtd: spi-nor: Add support for S25FS-S family
@ 2024-04-09 6:20 tkuw584924
2024-04-09 6:20 ` [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s tkuw584924
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: tkuw584924 @ 2024-04-09 6:20 UTC (permalink / raw)
To: u-boot
Cc: jagan, vigneshr, tudor.ambarus, pratyush, d-gole, tkuw584924,
Bacem.Daassi, Takahiro Kuwano
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
Flash devices with S25FS512S.
Datasheets:
https://www.infineon.com/dgdl/Infineon-S25FS064S_64_Mb_8_MB_FS-S_Flash_SPI_Multi-I_O_1-DataSheet-v10_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed526b25412
https://www.infineon.com/dgdl/Infineon-S25FS128S_S25FS256S_1.8_V_Serial_Peripheral_Interface_with_Multi-I_O_MirrorBit(R)_Non-Volatile_Flash-DataSheet-v15_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed6b5ab5758
Takahiro Kuwano (3):
mtd: spi-nore-core: Fix 4KB erase opcode in s25fs-s
mtd: spi-nor-id: Use INFO6 for S25FL-S
mtd: spi-nor: Add support for Infineon S25FS-S family
drivers/mtd/spi/spi-nor-core.c | 28 +++++++++++++++++++++-------
drivers/mtd/spi/spi-nor-ids.c | 7 +++++--
2 files changed, 26 insertions(+), 9 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s
2024-04-09 6:20 [PATCH v2 0/3] mtd: spi-nor: Add support for S25FS-S family tkuw584924
@ 2024-04-09 6:20 ` tkuw584924
2024-04-09 9:46 ` Pratyush Yadav
2024-04-10 18:16 ` Dhruva Gole
2024-04-09 6:20 ` [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S tkuw584924
2024-04-09 6:20 ` [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs tkuw584924
2 siblings, 2 replies; 10+ messages in thread
From: tkuw584924 @ 2024-04-09 6:20 UTC (permalink / raw)
To: u-boot
Cc: jagan, vigneshr, tudor.ambarus, pratyush, d-gole, tkuw584924,
Bacem.Daassi, Takahiro Kuwano
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
The correct 4KB erase opcode should be selected based on the address width
currently used.
Fixes: 562d166a13 ("mtd: spi-nor-core: Add fixups for s25fs512s")
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
drivers/mtd/spi/spi-nor-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index f86003ca8c..9620852817 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -3299,8 +3299,10 @@ static int s25fs_s_quad_enable(struct spi_nor *nor)
static int s25fs_s_erase_non_uniform(struct spi_nor *nor, loff_t addr)
{
+ u8 opcode = nor->addr_width == 4 ? SPINOR_OP_BE_4K_4B : SPINOR_OP_BE_4K;
+
/* Support 8 x 4KB sectors at bottom */
- return spansion_erase_non_uniform(nor, addr, SPINOR_OP_BE_4K_4B, 0, SZ_32K);
+ return spansion_erase_non_uniform(nor, addr, opcode, 0, SZ_32K);
}
static int s25fs_s_setup(struct spi_nor *nor, const struct flash_info *info,
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S
2024-04-09 6:20 [PATCH v2 0/3] mtd: spi-nor: Add support for S25FS-S family tkuw584924
2024-04-09 6:20 ` [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s tkuw584924
@ 2024-04-09 6:20 ` tkuw584924
2024-04-09 10:03 ` Pratyush Yadav
2024-04-10 18:13 ` Dhruva Gole
2024-04-09 6:20 ` [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs tkuw584924
2 siblings, 2 replies; 10+ messages in thread
From: tkuw584924 @ 2024-04-09 6:20 UTC (permalink / raw)
To: u-boot
Cc: jagan, vigneshr, tudor.ambarus, pratyush, d-gole, tkuw584924,
Bacem.Daassi, Takahiro Kuwano
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
The 6th ID byte is needed to distiguish S25FL-S and S25FS-S families.
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
drivers/mtd/spi/spi-nor-ids.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
index 4e83b8c94c..a3dca506a3 100644
--- a/drivers/mtd/spi/spi-nor-ids.c
+++ b/drivers/mtd/spi/spi-nor-ids.c
@@ -338,8 +338,8 @@ const struct flash_info spi_nor_ids[] = {
*/
{ INFO("s25sl032p", 0x010215, 0x4d00, 64 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ INFO("s25sl064p", 0x010216, 0x4d00, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
- { INFO("s25fl256s0", 0x010219, 0x4d00, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
- { INFO("s25fl256s1", 0x010219, 0x4d01, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+ { INFO6("s25fl256s0", 0x010219, 0x4d0080, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+ { INFO6("s25fl256s1", 0x010219, 0x4d0180, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO6("s25fl512s", 0x010220, 0x4d0080, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO6("s25fs512s", 0x010220, 0x4d0081, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO("s25fl512s_256k", 0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs
2024-04-09 6:20 [PATCH v2 0/3] mtd: spi-nor: Add support for S25FS-S family tkuw584924
2024-04-09 6:20 ` [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s tkuw584924
2024-04-09 6:20 ` [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S tkuw584924
@ 2024-04-09 6:20 ` tkuw584924
2024-04-09 11:54 ` Pratyush Yadav
2 siblings, 1 reply; 10+ messages in thread
From: tkuw584924 @ 2024-04-09 6:20 UTC (permalink / raw)
To: u-boot
Cc: jagan, vigneshr, tudor.ambarus, pratyush, d-gole, tkuw584924,
Bacem.Daassi, Takahiro Kuwano
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
Flash devices with S25FS512S. Some difference depending on the device
densities are taken care in post SFDP fixup.
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
drivers/mtd/spi/spi-nor-core.c | 24 ++++++++++++++++++------
drivers/mtd/spi/spi-nor-ids.c | 3 +++
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 9620852817..9b81b31e8e 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -3356,12 +3356,24 @@ static int s25fs_s_post_bfpt_fixup(struct spi_nor *nor,
static void s25fs_s_post_sfdp_fixup(struct spi_nor *nor,
struct spi_nor_flash_parameter *params)
{
- /* READ_1_1_2 is not supported */
- params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
- /* READ_1_1_4 is not supported */
- params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
- /* PP_1_1_4 is not supported */
- params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
+ /*
+ * The S25FS064S(8MB) supports 1-1-2 and 1-1-4 commands, but params for
+ * read ops in SFDP are wrong. The other density parts do not support
+ * 1-1-2 and 1-1-4 commands.
+ */
+ if (params->size == SZ_8M) {
+ spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_2],
+ 0, 8, SPINOR_OP_READ_1_1_2,
+ SNOR_PROTO_1_1_2);
+ spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_4],
+ 0, 8, SPINOR_OP_READ_1_1_4,
+ SNOR_PROTO_1_1_4);
+ } else {
+ params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
+ params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
+ params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
+ }
+
/* Use volatile register to enable quad */
params->quad_enable = s25fs_s_quad_enable;
}
diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
index a3dca506a3..9ca1f244f0 100644
--- a/drivers/mtd/spi/spi-nor-ids.c
+++ b/drivers/mtd/spi/spi-nor-ids.c
@@ -341,6 +341,9 @@ const struct flash_info spi_nor_ids[] = {
{ INFO6("s25fl256s0", 0x010219, 0x4d0080, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO6("s25fl256s1", 0x010219, 0x4d0180, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO6("s25fl512s", 0x010220, 0x4d0080, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+ { INFO6("s25fs064s", 0x010217, 0x4d0181, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+ { INFO6("s25fs128s", 0x012018, 0x4d0181, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+ { INFO6("s25fs256s", 0x010219, 0x4d0181, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO6("s25fs512s", 0x010220, 0x4d0081, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO("s25fl512s_256k", 0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
{ INFO("s25fl512s_64k", 0x010220, 0x4d01, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s
2024-04-09 6:20 ` [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s tkuw584924
@ 2024-04-09 9:46 ` Pratyush Yadav
2024-04-10 18:16 ` Dhruva Gole
1 sibling, 0 replies; 10+ messages in thread
From: Pratyush Yadav @ 2024-04-09 9:46 UTC (permalink / raw)
To: tkuw584924
Cc: u-boot, jagan, vigneshr, tudor.ambarus, pratyush, d-gole,
Bacem.Daassi, Takahiro Kuwano
On Tue, Apr 09 2024, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>
> The correct 4KB erase opcode should be selected based on the address width
> currently used.
>
> Fixes: 562d166a13 ("mtd: spi-nor-core: Add fixups for s25fs512s")
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S
2024-04-09 6:20 ` [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S tkuw584924
@ 2024-04-09 10:03 ` Pratyush Yadav
2024-04-10 18:13 ` Dhruva Gole
1 sibling, 0 replies; 10+ messages in thread
From: Pratyush Yadav @ 2024-04-09 10:03 UTC (permalink / raw)
To: tkuw584924
Cc: u-boot, jagan, vigneshr, tudor.ambarus, pratyush, d-gole,
Bacem.Daassi, Takahiro Kuwano
On Tue, Apr 09 2024, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>
> The 6th ID byte is needed to distiguish S25FL-S and S25FS-S families.
>
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs
2024-04-09 6:20 ` [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs tkuw584924
@ 2024-04-09 11:54 ` Pratyush Yadav
2024-04-10 2:22 ` Takahiro Kuwano
0 siblings, 1 reply; 10+ messages in thread
From: Pratyush Yadav @ 2024-04-09 11:54 UTC (permalink / raw)
To: tkuw584924
Cc: u-boot, jagan, vigneshr, tudor.ambarus, pratyush, d-gole,
Bacem.Daassi, Takahiro Kuwano
On Tue, Apr 09 2024, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>
> The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
> Flash devices with S25FS512S. Some difference depending on the device
> densities are taken care in post SFDP fixup.
>
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> ---
> drivers/mtd/spi/spi-nor-core.c | 24 ++++++++++++++++++------
> drivers/mtd/spi/spi-nor-ids.c | 3 +++
> 2 files changed, 21 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
> index 9620852817..9b81b31e8e 100644
> --- a/drivers/mtd/spi/spi-nor-core.c
> +++ b/drivers/mtd/spi/spi-nor-core.c
> @@ -3356,12 +3356,24 @@ static int s25fs_s_post_bfpt_fixup(struct spi_nor *nor,
> static void s25fs_s_post_sfdp_fixup(struct spi_nor *nor,
> struct spi_nor_flash_parameter *params)
> {
> - /* READ_1_1_2 is not supported */
> - params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
> - /* READ_1_1_4 is not supported */
> - params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
> - /* PP_1_1_4 is not supported */
> - params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
> + /*
> + * The S25FS064S(8MB) supports 1-1-2 and 1-1-4 commands, but params for
> + * read ops in SFDP are wrong. The other density parts do not support
> + * 1-1-2 and 1-1-4 commands.
> + */
> + if (params->size == SZ_8M) {
> + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_2],
> + 0, 8, SPINOR_OP_READ_1_1_2,
> + SNOR_PROTO_1_1_2);
> + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_4],
> + 0, 8, SPINOR_OP_READ_1_1_4,
> + SNOR_PROTO_1_1_4);
> + } else {
> + params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
> + params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
> + params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
> + }
> +
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
BTW (not directly related to this patch), I looked at the datasheet you
provided in the cover letter and it says dual and quad I/O is supported
for the 16 MB and 32 MB parts as well. Why do you mask them out here
then?
> /* Use volatile register to enable quad */
> params->quad_enable = s25fs_s_quad_enable;
> }
> diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
> index a3dca506a3..9ca1f244f0 100644
> --- a/drivers/mtd/spi/spi-nor-ids.c
> +++ b/drivers/mtd/spi/spi-nor-ids.c
> @@ -341,6 +341,9 @@ const struct flash_info spi_nor_ids[] = {
> { INFO6("s25fl256s0", 0x010219, 0x4d0080, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> { INFO6("s25fl256s1", 0x010219, 0x4d0180, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> { INFO6("s25fl512s", 0x010220, 0x4d0080, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> + { INFO6("s25fs064s", 0x010217, 0x4d0181, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> + { INFO6("s25fs128s", 0x012018, 0x4d0181, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> + { INFO6("s25fs256s", 0x010219, 0x4d0181, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> { INFO6("s25fs512s", 0x010220, 0x4d0081, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> { INFO("s25fl512s_256k", 0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> { INFO("s25fl512s_64k", 0x010220, 0x4d01, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
--
Regards,
Pratyush Yadav
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs
2024-04-09 11:54 ` Pratyush Yadav
@ 2024-04-10 2:22 ` Takahiro Kuwano
0 siblings, 0 replies; 10+ messages in thread
From: Takahiro Kuwano @ 2024-04-10 2:22 UTC (permalink / raw)
To: Pratyush Yadav
Cc: u-boot, jagan, vigneshr, tudor.ambarus, d-gole, Bacem.Daassi,
Takahiro Kuwano
On 4/9/2024 8:54 PM, Pratyush Yadav wrote:
> On Tue, Apr 09 2024, tkuw584924@gmail.com wrote:
>
>> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>>
>> The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
>> Flash devices with S25FS512S. Some difference depending on the device
>> densities are taken care in post SFDP fixup.
>>
>> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>> ---
>> drivers/mtd/spi/spi-nor-core.c | 24 ++++++++++++++++++------
>> drivers/mtd/spi/spi-nor-ids.c | 3 +++
>> 2 files changed, 21 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
>> index 9620852817..9b81b31e8e 100644
>> --- a/drivers/mtd/spi/spi-nor-core.c
>> +++ b/drivers/mtd/spi/spi-nor-core.c
>> @@ -3356,12 +3356,24 @@ static int s25fs_s_post_bfpt_fixup(struct spi_nor *nor,
>> static void s25fs_s_post_sfdp_fixup(struct spi_nor *nor,
>> struct spi_nor_flash_parameter *params)
>> {
>> - /* READ_1_1_2 is not supported */
>> - params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
>> - /* READ_1_1_4 is not supported */
>> - params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
>> - /* PP_1_1_4 is not supported */
>> - params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
>> + /*
>> + * The S25FS064S(8MB) supports 1-1-2 and 1-1-4 commands, but params for
>> + * read ops in SFDP are wrong. The other density parts do not support
>> + * 1-1-2 and 1-1-4 commands.
>> + */
>> + if (params->size == SZ_8M) {
>> + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_2],
>> + 0, 8, SPINOR_OP_READ_1_1_2,
>> + SNOR_PROTO_1_1_2);
>> + spi_nor_set_read_settings(¶ms->reads[SNOR_CMD_READ_1_1_4],
>> + 0, 8, SPINOR_OP_READ_1_1_4,
>> + SNOR_PROTO_1_1_4);
>> + } else {
>> + params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
>> + params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
>> + params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
>> + }
>> +
>
> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
>
> BTW (not directly related to this patch), I looked at the datasheet you
> provided in the cover letter and it says dual and quad I/O is supported
> for the 16 MB and 32 MB parts as well. Why do you mask them out here
> then?
>
In the datasheet,
1-2-2 and 1-4-4 read are named as dual and quad I/O read.
1-1-2 and 1-1-4 read are named as dual and quad output read.
Dual and quad I/O read (1-2-2 and 1-4-4) is supported in all S25FS-S parts.
Dual and quad output read (1-1-2 and 1-1-4) is only supported in S25FS064S.
Thank you for reviewing!
Takahiro
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S
2024-04-09 6:20 ` [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S tkuw584924
2024-04-09 10:03 ` Pratyush Yadav
@ 2024-04-10 18:13 ` Dhruva Gole
1 sibling, 0 replies; 10+ messages in thread
From: Dhruva Gole @ 2024-04-10 18:13 UTC (permalink / raw)
To: tkuw584924
Cc: u-boot, jagan, vigneshr, tudor.ambarus, pratyush, Bacem.Daassi,
Takahiro Kuwano
On Apr 09, 2024 at 15:20:21 +0900, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>
> The 6th ID byte is needed to distiguish S25FL-S and S25FS-S families.
>
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> ---
> drivers/mtd/spi/spi-nor-ids.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
> index 4e83b8c94c..a3dca506a3 100644
> --- a/drivers/mtd/spi/spi-nor-ids.c
> +++ b/drivers/mtd/spi/spi-nor-ids.c
> @@ -338,8 +338,8 @@ const struct flash_info spi_nor_ids[] = {
> */
> { INFO("s25sl032p", 0x010215, 0x4d00, 64 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> { INFO("s25sl064p", 0x010216, 0x4d00, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> - { INFO("s25fl256s0", 0x010219, 0x4d00, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> - { INFO("s25fl256s1", 0x010219, 0x4d01, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> + { INFO6("s25fl256s0", 0x010219, 0x4d0080, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> + { INFO6("s25fl256s1", 0x010219, 0x4d0180, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
Reviewed-by: Dhruva Gole <d-gole@ti.com>
--
Best regards,
Dhruva
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s
2024-04-09 6:20 ` [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s tkuw584924
2024-04-09 9:46 ` Pratyush Yadav
@ 2024-04-10 18:16 ` Dhruva Gole
1 sibling, 0 replies; 10+ messages in thread
From: Dhruva Gole @ 2024-04-10 18:16 UTC (permalink / raw)
To: tkuw584924
Cc: u-boot, jagan, vigneshr, tudor.ambarus, pratyush, Bacem.Daassi,
Takahiro Kuwano
On Apr 09, 2024 at 15:20:20 +0900, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>
> The correct 4KB erase opcode should be selected based on the address width
> currently used.
>
> Fixes: 562d166a13 ("mtd: spi-nor-core: Add fixups for s25fs512s")
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> ---
> drivers/mtd/spi/spi-nor-core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
> index f86003ca8c..9620852817 100644
> --- a/drivers/mtd/spi/spi-nor-core.c
> +++ b/drivers/mtd/spi/spi-nor-core.c
> @@ -3299,8 +3299,10 @@ static int s25fs_s_quad_enable(struct spi_nor *nor)
>
> static int s25fs_s_erase_non_uniform(struct spi_nor *nor, loff_t addr)
> {
> + u8 opcode = nor->addr_width == 4 ? SPINOR_OP_BE_4K_4B : SPINOR_OP_BE_4K;
> +
> /* Support 8 x 4KB sectors at bottom */
> - return spansion_erase_non_uniform(nor, addr, SPINOR_OP_BE_4K_4B, 0, SZ_32K);
> + return spansion_erase_non_uniform(nor, addr, opcode, 0, SZ_32K);
Reviewed-by: Dhruva Gole <d-gole@ti.com>
--
Best regards,
Dhruva
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-04-10 18:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 6:20 [PATCH v2 0/3] mtd: spi-nor: Add support for S25FS-S family tkuw584924
2024-04-09 6:20 ` [PATCH v2 1/3] mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s tkuw584924
2024-04-09 9:46 ` Pratyush Yadav
2024-04-10 18:16 ` Dhruva Gole
2024-04-09 6:20 ` [PATCH v2 2/3] mtd: spi-nor-id: Use INFO6 macro for S25FL-S tkuw584924
2024-04-09 10:03 ` Pratyush Yadav
2024-04-10 18:13 ` Dhruva Gole
2024-04-09 6:20 ` [PATCH v2 3/3] mtd: spi-nor-id: Add S25FS064S, S25FS128S, S25FS256S IDs tkuw584924
2024-04-09 11:54 ` Pratyush Yadav
2024-04-10 2:22 ` Takahiro Kuwano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox