mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: nicolas.ferre@microchip.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, miquel.raynal@bootlin.com,
	richard@nod.at, vigneshr@ti.com
Cc: Varshini Rajendran <varshini.rajendran@microchip.com>,
	alexandre.belloni@bootlin.com, linux-mtd@lists.infradead.org,
	Guillaume Socquet <guillaume.socquet@microchip.com>
Subject: Re: [PATCH] mtd: spi-nor: sst: Unlock addition for sst26vf016
Date: Fri, 31 Mar 2023 11:25:48 +0100	[thread overview]
Message-ID: <6713b89a-a031-8f32-3de2-12643a8976e1@linaro.org> (raw)
In-Reply-To: <20230331095549.16393-1-nicolas.ferre@microchip.com>

Hi, Nicolas,

On 3/31/23 10:55, nicolas.ferre@microchip.com wrote:
> From: Guillaume Socquet <guillaume.socquet@microchip.com>
> 
> Modify sst26vf016 flash_info struct so when such device is detected by
> the driver it may be unlocked for write operation as sst26vf064.
> 
> Signed-off-by: Guillaume Socquet <guillaume.socquet@microchip.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
>  drivers/mtd/spi-nor/sst.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c
> index 63bcc97bf978..99c8a19493f5 100644
> --- a/drivers/mtd/spi-nor/sst.c
> +++ b/drivers/mtd/spi-nor/sst.c
> @@ -110,7 +110,9 @@ static const struct flash_info sst_nor_parts[] = {
>  		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
>  			      SPI_NOR_QUAD_READ) },
>  	{ "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32)
> -		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) },
> +		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
> +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ)

If I remember correctly this flash has SFDP support. If so, we may be
able to get rid of the "NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ)". You
can check whether the flash defines the SFDP tables or not by dumping
the sfdp sysfs entry. Check the link from below on how to do that.

Also the sector size and nsectors should be superfluous if the SFDP
tables are present.

> +		.fixups = &sst26vf_nor_fixups },
So I'd try:

{ "sst26vf016b", INFO(0xbf2641, 0, 0, 0)
		PARSE_SFDP
		FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
		.fixups = &sst26vf_nor_fixups },

We ask people that update or add new flash entries to do an erase,
verify erase, write, read back and compare test. Also to dump the sysfs
entries. Here's how to do that:

https://lore.kernel.org/lkml/97a3b023-b9bc-c34d-45a4-ddd56f47bd76@microchip.com/T/

Cheers,
ta

      reply	other threads:[~2023-03-31 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  9:55 nicolas.ferre
2023-03-31 10:25 ` Tudor Ambarus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6713b89a-a031-8f32-3de2-12643a8976e1@linaro.org \
    --to=tudor.ambarus@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=guillaume.socquet@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=richard@nod.at \
    --cc=varshini.rajendran@microchip.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®