[PATCH] mtd: spi-nor: spansion: Add SMPT fixup for S25FS512S

Marek Vasut marek.vasut at mailbox.org
Fri Oct 17 09:04:16 PDT 2025


On 10/13/25 5:41 PM, Tudor Ambarus wrote:

Hello Tudor,

>>> The "Index Value" shall be the map_id that you passed in the code:
>>> spi_nor_post_smpt_fixups(nor, &map_id);
>>>
>>> Can you please print the map_id value that you obtain without updating it?
>>
>> 0x4
> 
> This translates to CR3NV[3] = 1, CR1NV[2] = 0,  CR3NV[1] = 0.
>>
>>> Let's also print the values of CR3NV and CR1NV.
>>
>> Both 0x0 and 0x0 .
> 
> But here CR3NV is 0, it contradicts the result from above.

Maybe I messed up and was reading it the wrong way ?

> Maybe it's the same problem that Takahiro identified: the flash needs
> 8 dummy cycles, but the code uses zero dummy cycles, resulting in
> reading garbage data, depending on whether your IO lines are pulled up/down
> or floating.
> 
> Can you redo the test with the following please?

Sure, although I saw some further discussion between you and Kuwano-san 
, is this still applicable ?

> diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c
> index 21727f9a4ac6..85443c903e59 100644
> --- a/drivers/mtd/spi-nor/sfdp.c
> +++ b/drivers/mtd/spi-nor/sfdp.c
> @@ -752,7 +752,7 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt,
>   
>                  read_data_mask = SMPT_CMD_READ_DATA(smpt[i]);
>                  nor->addr_nbytes = spi_nor_smpt_addr_nbytes(nor, smpt[i]);
> -               nor->read_dummy = spi_nor_smpt_read_dummy(nor, smpt[i]);
> +               nor->read_dummy = 8;
>                  nor->read_opcode = SMPT_CMD_OPCODE(smpt[i]);
>                  addr = smpt[i + 1];
>   
> @@ -767,6 +767,8 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt,
>                   * Configuration that is currently in use.
>                   */
>                  map_id = map_id << 1 | !!(*buf & read_data_mask);
> +               dev_err(nor->dev, "i = %d, buf = %02x, map_id = %02x\n",
> +                       i, buf[0], map_id);
>          }
Sorry for the late reply.



More information about the linux-mtd mailing list