aboutsummaryrefslogtreecommitdiff
path: root/target/linux/generic/backport-5.15
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2024-03-28 08:41:51 +0100
committerRafał Miłecki <rafal@milecki.pl>2024-03-28 08:52:23 +0100
commit6ddc9fc4b55345ad6cdfca7542a4987433e7f35d (patch)
treef623a91e26b5e75626483209faae2e355c7d8758 /target/linux/generic/backport-5.15
parent2feedab8054766010c12d129ed5650bbd57ea2ee (diff)
kernel: backport brcmnand support for "brcm,wp-not-connected"
It's required to support NAND controllers with WP pin on boards that don't have it connected to NAND chip. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/backport-5.15')
-rw-r--r--target/linux/generic/backport-5.15/411-v6.9-mtd-rawnand-brcmnand-Support-write-protection-settin.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/411-v6.9-mtd-rawnand-brcmnand-Support-write-protection-settin.patch b/target/linux/generic/backport-5.15/411-v6.9-mtd-rawnand-brcmnand-Support-write-protection-settin.patch
new file mode 100644
index 0000000000..dce2c91fd3
--- /dev/null
+++ b/target/linux/generic/backport-5.15/411-v6.9-mtd-rawnand-brcmnand-Support-write-protection-settin.patch
@@ -0,0 +1,36 @@
+From 8e7daa85641c9559c113f6b217bdc923397de77c Mon Sep 17 00:00:00 2001
+From: William Zhang <william.zhang@broadcom.com>
+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 <william.zhang@broadcom.com>
+Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
+Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com>
+Reviewed-by: David Regan <dregan@broadcom.com>
+Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/linux-mtd/20240223034758.13753-14-william.zhang@broadcom.com
+---
+ 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)