Skip to content

Commit 8e7daa8

Browse files
William Zhangmiquelraynal
authored andcommitted
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]
1 parent 546e425 commit 8e7daa8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/mtd/nand/raw/brcmnand/brcmnand.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3152,6 +3152,10 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
31523152
/* Disable XOR addressing */
31533153
brcmnand_rmw_reg(ctrl, BRCMNAND_CS_XOR, 0xff, 0, 0);
31543154

3155+
/* Check if the board connects the WP pin */
3156+
if (of_property_read_bool(dn, "brcm,wp-not-connected"))
3157+
wp_on = 0;
3158+
31553159
if (ctrl->features & BRCMNAND_HAS_WP) {
31563160
/* Permanently disable write protection */
31573161
if (wp_on == 2)

0 commit comments

Comments
 (0)