summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPhilippe Reynes <philippe.reynes@softathome.com>2019-03-15 15:14:38 +0100
committerTom Rini <trini@konsulko.com>2019-04-22 11:55:58 -0400
commitf917438772c7c7da7f30e9209d9f100edac0255e (patch)
tree9a01670820c75ac8ef70c73c547961b0aefddbed /drivers/mtd
parent317d40eb01a8e194e6e321e71e811d6da03b8365 (diff)
drivers: nand: brcmnand: add an option to read the write-protect from device tree
The option write-protect may only change on the kernel command line, we add a property in the device tree to be more flexible. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/brcmnand/brcmnand.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index e333320808..faa6da42d5 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -2671,6 +2671,9 @@ int brcmnand_probe(struct udevice *dev, struct brcmnand_soc *soc)
/* Disable XOR addressing */
brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0);
+ /* Read the write-protect configuration in the device tree */
+ wp_on = dev_read_u32_default(dev, "write-protect", wp_on);
+
if (ctrl->features & BRCMNAND_HAS_WP) {
/* Permanently disable write protection */
if (wp_on == 2)