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.rey...@softathome.com>
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c 
b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index b156642..3f9d510 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -2650,6 +2650,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)
-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to