|
@@ -0,0 +1,36 @@
|
|
|
+From 8e7daa85641c9559c113f6b217bdc923397de77c Mon Sep 17 00:00:00 2001
|
|
|
+From: William Zhang <[email protected]>
|
|
|
+Date: Thu, 22 Feb 2024 19:47:58 -0800
|
|
|
+Subject: [PATCH] mtd: rawnand: brcmnand: Support write protection setting from
|
|
|
+ dts
|
|
|
+
|
|
|
+The write protection feature is controlled by the module parameter wp_on
|
|
|
+with default set to enabled. But not all the board use this feature
|
|
|
+especially in BCMBCA broadband board. And module parameter is not
|
|
|
+sufficient as different board can have different option. Add a device
|
|
|
+tree property and allow this feature to be configured through the board
|
|
|
+dts on per board basis.
|
|
|
+
|
|
|
+Signed-off-by: William Zhang <[email protected]>
|
|
|
+Reviewed-by: Florian Fainelli <[email protected]>
|
|
|
+Reviewed-by: Kamal Dasu <[email protected]>
|
|
|
+Reviewed-by: David Regan <[email protected]>
|
|
|
+Signed-off-by: Miquel Raynal <[email protected]>
|
|
|
+Link: https://lore.kernel.org/linux-mtd/[email protected]
|
|
|
+---
|
|
|
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 4 ++++
|
|
|
+ 1 file changed, 4 insertions(+)
|
|
|
+
|
|
|
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
|
|
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
|
|
|
+@@ -3184,6 +3184,10 @@ int brcmnand_probe(struct platform_devic
|
|
|
+ /* Disable XOR addressing */
|
|
|
+ brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0);
|
|
|
+
|
|
|
++ /* Check if the board connects the WP pin */
|
|
|
++ if (of_property_read_bool(dn, "brcm,wp-not-connected"))
|
|
|
++ wp_on = 0;
|
|
|
++
|
|
|
+ if (ctrl->features & BRCMNAND_HAS_WP) {
|
|
|
+ /* Permanently disable write protection */
|
|
|
+ if (wp_on == 2)
|