[PATCH v8 3/3] mtd: spi-nor: spansion: Add s25hl-t/s25hs-t IDs and fixups
Takahiro Kuwano
tkuw584924 at gmail.com
Fri Feb 25 01:14:36 PST 2022
On 2/25/2022 4:26 PM, Pratyush Yadav wrote:
> On 21/02/22 04:14PM, tkuw584924 at gmail.com wrote:
>> From: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
>>
>> The S25HL-T/S25HS-T family is the Infineon SEMPER Flash with Quad SPI.
>>
>> For the single-die package parts (512Mb and 1Gb), only bottom 4KB and
>> uniform sector sizes are supported. This is due to missing or incorrect
>> entries in SMPT. Fixup for other sector sizes configurations will be
>> followed up as needed.
>>
>> Tested on Xilinx Zynq-7000 FPGA board.
>>
>> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
>> ---
>> Changes in v8:
>> - Call write_disable in error case only
>> - Use spi_nor_read_reg() helper
>> - Use nor->bouncebuf instead of variable on stack
>> - Update ID table to use FLAGS macro
>>
>> Changes in v7:
>> - Add missing device info table in v6
>>
>> Changes in v6:
>> - Remove 2Gb multi die pacakge support
>>
>> Changes in v5:
>> - Add NO_CHIP_ERASE flag to S25HL02GT and S25HS02GT
>>
>> Changes in v4:
>> - Merge block comments about SMPT in s25hx_t_post_sfdp_fixups()
>> - Remove USE_CLSR flags from S25HL02GT and S25HS02GT
>>
>> Changes in v3:
>> - Remove S25HL256T and S25HS256T
>> - Add S25HL02GT and S25HS02GT
>> - Add support for multi-die package parts support
>> - Remove erase_map fix for top/split sector layout
>> - Set ECC data unit size (16B) to writesize
>>
>> drivers/mtd/spi-nor/spansion.c | 103 +++++++++++++++++++++++++++++++++
>> 1 file changed, 103 insertions(+)
>>
>> diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
>> index 5453b89a1c22..4511c0cfd090 100644
>> --- a/drivers/mtd/spi-nor/spansion.c
>> +++ b/drivers/mtd/spi-nor/spansion.c
>> @@ -166,6 +166,93 @@ static int spansion_quad_enable_volatile(struct spi_nor *nor, u8 reg_dummy)
>> return 0;
>> }
>>
>> +static int s25hx_t_quad_enable(struct spi_nor *nor)
>> +{
>> + int ret = spansion_quad_enable_volatile(nor, 0);
>> +
>> + /* Reset WEL bit in any error cases */
>> + if (ret)
>> + spi_nor_write_disable(nor);
>> +
>> + return ret;
>> +}
>> +
>> +static int
>> +s25hx_t_post_bfpt_fixups(struct spi_nor *nor,
>> + const struct sfdp_parameter_header *bfpt_header,
>> + const struct sfdp_bfpt *bfpt)
>> +{
>> + struct spi_mem_op op;
>> + int ret;
>> +
>> + ret = spi_nor_set_4byte_addr_mode(nor, true);
>> + if (ret)
>> + return ret;
>> + nor->addr_width = 4;
>
> Why do you enable 4 byte address mode here? Why not set
> nor->params->set_4byte_addr_mode and let spi_nor_init() do it?
>
The addr_width is used by Read Any Register op that called in SMPT parse
and in this hook. I would like to sync device's addr mode and addr_width
to a known state here.
nor->params->set_4byte_addr_mode is not called due to SNOR_F_4B_OPCODES
flag set in spansion_late_init().
Thanks,
Takahiro
More information about the linux-mtd
mailing list