All of lore.kernel.org
 help / color / mirror / Atom feed
* NAND flash Write protection
@ 2021-05-08  4:19 kasi viswanathan
  2021-05-10  7:59 ` Miquel Raynal
  0 siblings, 1 reply; 3+ messages in thread
From: kasi viswanathan @ 2021-05-08  4:19 UTC (permalink / raw)
  To: linux-mtd

Hi all,

In one of our current boards we are using Micron NAND flash of Size 512MB.
Sometimes the first page (4k) gets corrupted and the board gets bricked.

We have stored the bootloader at this location.

As a preventive measure we have added read-only and lock flags in the dtb entry.

My query is, Is it possible to lock a particular block of NAND flash
memory in linux ?
I understood after googling that a specific H/W pin support is needed
to achieve this "Power-Up  Read  Enable,  Lock/Unlock  Enable(PRL)"

If so can you pls let me know the pointers which i can check to work on this.

Thanks in advance,

Thanks,
Kasiviswanathan.V

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: NAND flash Write protection
  2021-05-08  4:19 NAND flash Write protection kasi viswanathan
@ 2021-05-10  7:59 ` Miquel Raynal
  2021-05-10 10:19   ` kasi viswanathan
  0 siblings, 1 reply; 3+ messages in thread
From: Miquel Raynal @ 2021-05-10  7:59 UTC (permalink / raw)
  To: kasi viswanathan; +Cc: linux-mtd

Hi kasi,

kasi viswanathan <kviswanathan.83@gmail.com> wrote on Sat, 8 May 2021
09:49:58 +0530:

> Hi all,
> 
> In one of our current boards we are using Micron NAND flash of Size 512MB.
> Sometimes the first page (4k) gets corrupted and the board gets bricked.

I think this is your real issue. I am not sure trying to lock the flash
is the right thing to focus on, understanding why it gets bricked seems
more legitimate to me.

> We have stored the bootloader at this location.
> 
> As a preventive measure we have added read-only and lock flags in the dtb entry.
> 
> My query is, Is it possible to lock a particular block of NAND flash
> memory in linux ?

I don't think this capability really belongs to Linux. The right
question is, is your NAND flash capable of that? I know that Macronix
flashes have a specific additional lock/unlock feature that is
upstream, but there is no Micron support for that yet. You can add it
though if it exists with Micron's devices through the
->{lock,unlock}_area() hooks.

> I understood after googling that a specific H/W pin support is needed
> to achieve this "Power-Up  Read  Enable,  Lock/Unlock  Enable(PRL)"

There is indeed a WP (Write Protect) pin which prevents writes and
erasures over the entire chip that you can use to protect the content
of your chip. But that won't work if you use eg. UBIFS on top of it as
it will need write access at some point.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: NAND flash Write protection
  2021-05-10  7:59 ` Miquel Raynal
@ 2021-05-10 10:19   ` kasi viswanathan
  0 siblings, 0 replies; 3+ messages in thread
From: kasi viswanathan @ 2021-05-10 10:19 UTC (permalink / raw)
  To: Miquel Raynal; +Cc: linux-mtd

Hi Miquel Raynal,

Thanks for sharing the information. It is very useful.


On Mon, May 10, 2021 at 1:29 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi kasi,
>
> kasi viswanathan <kviswanathan.83@gmail.com> wrote on Sat, 8 May 2021
> 09:49:58 +0530:
>
> > Hi all,
> >
> > In one of our current boards we are using Micron NAND flash of Size 512MB.
> > Sometimes the first page (4k) gets corrupted and the board gets bricked.
>
> I think this is your real issue. I am not sure trying to lock the flash
> is the right thing to focus on, understanding why it gets bricked seems
> more legitimate to me.
>
> > We have stored the bootloader at this location.
> >
> > As a preventive measure we have added read-only and lock flags in the dtb entry.
> >
> > My query is, Is it possible to lock a particular block of NAND flash
> > memory in linux ?
>
> I don't think this capability really belongs to Linux. The right
> question is, is your NAND flash capable of that? I know that Macronix
> flashes have a specific additional lock/unlock feature that is
> upstream, but there is no Micron support for that yet. You can add it
> though if it exists with Micron's devices through the
> ->{lock,unlock}_area() hooks.
>
> > I understood after googling that a specific H/W pin support is needed
> > to achieve this "Power-Up  Read  Enable,  Lock/Unlock  Enable(PRL)"
>
> There is indeed a WP (Write Protect) pin which prevents writes and
> erasures over the entire chip that you can use to protect the content
> of your chip. But that won't work if you use eg. UBIFS on top of it as
> it will need write access at some point.
>
> Thanks,
> Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2021-05-10 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08  4:19 NAND flash Write protection kasi viswanathan
2021-05-10  7:59 ` Miquel Raynal
2021-05-10 10:19   ` kasi viswanathan

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.