[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240207202257.271784-11-william.zhang@broadcom.com>
Date: Wed, 7 Feb 2024 12:22:55 -0800
From: William Zhang <william.zhang@...adcom.com>
To: Linux MTD List <linux-mtd@...ts.infradead.org>,
Linux ARM List <linux-arm-kernel@...ts.infradead.org>,
Broadcom Kernel List <bcm-kernel-feedback-list@...adcom.com>
Cc: f.fainelli@...il.com,
kursad.oney@...adcom.com,
joel.peshkin@...adcom.com,
anand.gore@...adcom.com,
dregan@...l.com,
kamal.dasu@...adcom.com,
tomer.yacoby@...adcom.com,
dan.beygelman@...adcom.com,
William Zhang <william.zhang@...adcom.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
David Regan <dregan@...adcom.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
linux-kernel@...r.kernel.org,
Vignesh Raghavendra <vigneshr@...com>,
Brian Norris <computersforpeace@...il.com>,
Richard Weinberger <richard@....at>
Subject: [PATCH v5 10/12] 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 <william.zhang@...adcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
Reviewed-by: Kamal Dasu <kamal.dasu@...adcom.com>
Reviewed-by: David Regan <dregan@...adcom.com>
---
Changes in v5: None
Changes in v4:
- Use the new brcm,wp-not-connected property based on the dts binding
change
Changes in v3: None
Changes in v2: None
drivers/mtd/nand/raw/brcmnand/brcmnand.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index efeee9e80213..8c1489ff7bd6 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -3218,6 +3218,10 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
/* 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)
--
2.37.3
Powered by blists - more mailing lists