All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi: update spi-nor protected property for some flash types
@ 2026-09-14 20:51 Tony Dinh
  2026-09-16  1:08 ` Takahiro.Kuwano
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Dinh @ 2026-09-14 20:51 UTC (permalink / raw)
  To: Takahiro Kuwano, u-boot
  Cc: Vignesh R, Tom Rini, Ssunk, Flaviu Nistor, Jeffrey Yu,
	David Lechner, Tony Dinh

Add protected property for SPI flash mx25l4005a, mx25l3205d, mx25l6405d,
and  m25p32.
This will enable spi_nor_init() to unlock these SPI flash automatically.

---
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
---
 drivers/mtd/spi/spi-nor-ids.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
index 31a2ba49a87..5821ea07d22 100644
--- a/drivers/mtd/spi/spi-nor-ids.c
+++ b/drivers/mtd/spi/spi-nor-ids.c
@@ -309,11 +309,11 @@ const struct flash_info spi_nor_ids[] = {
 #ifdef CONFIG_SPI_FLASH_MACRONIX	/* MACRONIX */
 	/* Macronix */
 	{ INFO("mx25l2005a",  0xc22012, 0, 64 * 1024,   4, SECT_4K) },
-	{ INFO("mx25l4005a",  0xc22013, 0, 64 * 1024,   8, SECT_4K) },
+	{ INFO("mx25l4005a",  0xc22013, 0, 64 * 1024,   8, SECT_4K | SPI_NOR_HAS_LOCK) },
 	{ INFO("mx25l8005",   0xc22014, 0, 64 * 1024,  16, 0) },
 	{ INFO("mx25l1606e",  0xc22015, 0, 64 * 1024,  32, SECT_4K) },
-	{ INFO("mx25l3205d",  0xc22016, 0, 64 * 1024,  64, SECT_4K) },
-	{ INFO("mx25l6405d",  0xc22017, 0, 64 * 1024, 128, SECT_4K) },
+	{ INFO("mx25l3205d",  0xc22016, 0, 64 * 1024,  64, SECT_4K | SPI_NOR_HAS_LOCK) },
+	{ INFO("mx25l6405d",  0xc22017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_HAS_LOCK) },
 	{ INFO("mx25u2033e",  0xc22532, 0, 64 * 1024,   4, SECT_4K) },
 	{ INFO("mx25u1635e",  0xc22535, 0, 64 * 1024,  32, SECT_4K) },
 	{ INFO("mx25u3235f",  0xc22536, 0, 4 * 1024,  1024, SECT_4K) },
@@ -529,7 +529,7 @@ const struct flash_info spi_nor_ids[] = {
 	{ INFO("m25p40",  0x202013,  0,  64 * 1024,   8, 0) },
 	{ INFO("m25p80",  0x202014,  0,  64 * 1024,  16, 0) },
 	{ INFO("m25p16",  0x202015,  0,  64 * 1024,  32, 0) },
-	{ INFO("m25p32",  0x202016,  0,  64 * 1024,  64, 0) },
+	{ INFO("m25p32",  0x202016,  0,  64 * 1024,  64, SECT_4K | SPI_NOR_HAS_LOCK) },
 	{ INFO("m25p64",  0x202017,  0,  64 * 1024, 128, 0) },
 	{ INFO("m25p128", 0x202018,  0, 256 * 1024,  64, 0) },
 	{ INFO("m25pe16", 0x208015,  0, 64 * 1024, 32, SECT_4K) },

---
base-commit: a44f46af0aa17e48572e0d46c0d082886ee353c3
change-id: 20260914-spi_nor_protected-1c7a59ac0648

Best regards,
--  
Tony Dinh <mibodhi@gmail.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] mtd: spi: update spi-nor protected property for some flash types
  2026-09-14 20:51 [PATCH] mtd: spi: update spi-nor protected property for some flash types Tony Dinh
@ 2026-09-16  1:08 ` Takahiro.Kuwano
  2026-09-17  3:01   ` Tony Dinh
  0 siblings, 1 reply; 3+ messages in thread
From: Takahiro.Kuwano @ 2026-09-16  1:08 UTC (permalink / raw)
  To: mibodhi, u-boot; +Cc: vigneshr, trini, ssunkkan, flaviu.nistor, jeyu, dlechner

Hi,
 
> Add protected property for SPI flash mx25l4005a, mx25l3205d, mx25l6405d,
> and  m25p32.
> This will enable spi_nor_init() to unlock these SPI flash automatically.

Please make sure the locking feature works properly with the HAS_LOCK flag
enabled. The HAS_LOCK flag should not be added just to support startup
unlocking.

Thanks,
Takahiro


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: spi: update spi-nor protected property for some flash types
  2026-09-16  1:08 ` Takahiro.Kuwano
@ 2026-09-17  3:01   ` Tony Dinh
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Dinh @ 2026-09-17  3:01 UTC (permalink / raw)
  To: Takahiro.Kuwano
  Cc: u-boot, vigneshr, trini, ssunkkan, flaviu.nistor, jeyu, dlechner

Hi Takahiro,

On Tue, Sep 15, 2026 at 6:08 PM <Takahiro.Kuwano@infineon.com> wrote:
>
> Hi,
>
> > Add protected property for SPI flash mx25l4005a, mx25l3205d, mx25l6405d,
> > and  m25p32.
> > This will enable spi_nor_init() to unlock these SPI flash automatically.
>
> Please make sure the locking feature works properly with the HAS_LOCK flag
> enabled. The HAS_LOCK flag should not be added just to support startup
> unlocking.

Of course you're right. My patch description should have mentioned the
datasheets and the tests that I've done to verify the locking feature
is working. I was about to send in a V2 patch, but realized that we
have a related issue in the saveenv command. If the SPI flash is
*locked*, the user can change envs and saveenv behaves like the flash
was updated and saved, but in reality it was not saved.  I think I
will track that down before sending the V2 version of this patch.

Thanks,
Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-17  3:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 20:51 [PATCH] mtd: spi: update spi-nor protected property for some flash types Tony Dinh
2026-09-16  1:08 ` Takahiro.Kuwano
2026-09-17  3:01   ` Tony Dinh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.