public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: kasi viswanathan <kviswanathan.83@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: NAND flash Write protection
Date: Mon, 10 May 2021 09:59:07 +0200	[thread overview]
Message-ID: <20210510095907.0c4ae196@xps13> (raw)
In-Reply-To: <CAMmihzqVhm49oGCYbkFmCFaYAX57xU5yVZm6hn3OCmuk1jBSSg@mail.gmail.com>

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/

  reply	other threads:[~2021-05-10  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  4:19 NAND flash Write protection kasi viswanathan
2021-05-10  7:59 ` Miquel Raynal [this message]
2021-05-10 10:19   ` kasi viswanathan

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=20210510095907.0c4ae196@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=kviswanathan.83@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /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