[PATCH v3 20/41] mtd: spi-nor: everspin: convert flash_info to new format

Tudor Ambarus tudor.ambarus at linaro.org
Tue Sep 19 08:57:30 PDT 2023



On 19.09.2023 14:33, Michael Walle wrote:
> Am 2023-09-19 11:24, schrieb Tudor Ambarus:
>> On 08.09.2023 13:16, Michael Walle wrote:
>>> The INFOx() macros are going away. Convert the flash_info database to
>>> the new format.
>>>
>>> Signed-off-by: Michael Walle <mwalle at kernel.org>
>>> ---
>>>  drivers/mtd/spi-nor/everspin.c | 33 +++++++++++++++++++++++++++++----
>>>  1 file changed, 29 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/mtd/spi-nor/everspin.c
>>> b/drivers/mtd/spi-nor/everspin.c
>>> index d02c32f2f7ad..46776bc10b27 100644
>>> --- a/drivers/mtd/spi-nor/everspin.c
>>> +++ b/drivers/mtd/spi-nor/everspin.c
>>> @@ -9,10 +9,35 @@
>>>  #include "core.h"
>>>
>>>  static const struct flash_info everspin_nor_parts[] = {
>>> -    { "mr25h128", CAT25_INFO(16 * 1024, 1, 256, 2) },
>>> -    { "mr25h256", CAT25_INFO(32 * 1024, 1, 256, 2) },
>>> -    { "mr25h10",  CAT25_INFO(128 * 1024, 1, 256, 3) },
>>> -    { "mr25h40",  CAT25_INFO(512 * 1024, 1, 256, 3) },
>>> +    {
>>> +        .name = "mr25h128",
>>> +        .size = SZ_16K,
>>> +        .sector_size = SZ_16K,
>>> +        .page_size = 256,
>>
>> page size defaults to 256, isn't it? Can we get rid of the page_size
>> assignments?
> 
> Yes!
> 
>>
>>> +        .addr_nbytes = 2,
>>> +        .flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR,
>>> +    }, {
>>> +        .name = "mr25h256",
>>> +        .size = SZ_32K,
>>> +        .sector_size = SZ_32K,
>>> +        .page_size = 256,
>>> +        .addr_nbytes = 2,
>>> +        .flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR,
>>> +    }, {
>>> +        .name = "mr25h10",
>>> +        .size = SZ_128K,
>>> +        .sector_size = SZ_128K,
>>> +        .page_size = 256,
>>> +        .addr_nbytes = 3,
> 
> also "addr_nbytes = 3" is the default.

ok, updating now.

> 
> -michael
> 
>>> +        .flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR,
>>> +    }, {
>>> +        .name = "mr25h40",
>>> +        .size = SZ_512K,
>>> +        .sector_size = SZ_512K,
>>> +        .page_size = 256,
>>> +        .addr_nbytes = 3,
>>> +        .flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR,
>>> +    }
>>>  };
>>>
>>>  const struct spi_nor_manufacturer spi_nor_everspin = {
>>>



More information about the linux-mtd mailing list