NAND flash Write protection
Miquel Raynal
miquel.raynal at bootlin.com
Mon May 10 00:59:07 PDT 2021
Hi kasi,
kasi viswanathan <kviswanathan.83 at 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
More information about the linux-mtd
mailing list