mtd: rawnand: Add support for secure regions in NAND memory
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 2 Apr 2021 15:01:27 +0000 (20:31 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 7 Apr 2021 08:06:24 +0000 (10:06 +0200)
commit13b89768275d6ca9764bf91449e4cafe46ba706b
treea2acd9ff585acbd4c6b10064f140284e23bcf03a
parentee590106c331ad54df9da3052b5c52014b2edb0b
mtd: rawnand: Add support for secure regions in NAND memory

On a typical end product, a vendor may choose to secure some regions in
the NAND memory which are supposed to stay intact between FW upgrades.
The access to those regions will be blocked by a secure element like
Trustzone. So the normal world software like Linux kernel should not
touch these regions (including reading).

The regions are declared using a NAND chip DT property,
"secure-regions". So let's make use of this property in the raw NAND
core and skip access to the secure regions present in a system.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210402150128.29128-4-manivannan.sadhasivam@linaro.org
drivers/mtd/nand/raw/nand_base.c
include/linux/mtd/rawnand.h