aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-01-21 13:26:17 +0100
committerRafał Miłecki <rafal@milecki.pl>2021-01-21 13:30:20 +0100
commit3bd8f660a4b967a25aa7b605f0ead44ddfab9ea4 (patch)
tree33e4e27e24d6f1030299c91eda2d7d1a3be6386c /target
parente78d3e44dddaaa89e101b42574f13bc6aeb6b6ae (diff)
downloadupstream-3bd8f660a4b967a25aa7b605f0ead44ddfab9ea4.tar.gz
upstream-3bd8f660a4b967a25aa7b605f0ead44ddfab9ea4.tar.bz2
upstream-3bd8f660a4b967a25aa7b605f0ead44ddfab9ea4.zip
bcm4908: workaround NAND controller #WP issue
There seems to be a problem with setting #WP. On the other hand ignoring the #WP seems to work. rootfs_data UBI volume seems to persist changes. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target')
-rw-r--r--target/linux/bcm4908/patches-5.4/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/bcm4908/patches-5.4/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch b/target/linux/bcm4908/patches-5.4/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch
new file mode 100644
index 00000000000..65066236db9
--- /dev/null
+++ b/target/linux/bcm4908/patches-5.4/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch
@@ -0,0 +1,34 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Thu, 21 Jan 2021 10:44:53 +0100
+Subject: [PATCH] mtd: rawnand: brcmnand: disable WP on BCM4908
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+BCM4908 contains NAND controller version 0x0701 (v7.1). It means that
+NAND_WP should be available.
+
+For some reason setting #WP on doesn't result in clearing NAND_STATUS_WP
+status bit:
+[ 1.077857] bcm63138_nand ff801800.nand: timeout on status poll (expected c0000040 got c00000c0)
+[ 1.086832] bcm63138_nand ff801800.nand: nand #WP expected on
+
+For now try working without touching #WP.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+---
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -38,7 +38,11 @@
+ * 1: NAND_WP is set by default, cleared for erase/write operations
+ * 2: NAND_WP is always cleared
+ */
++#if IS_ENABLED(CONFIG_ARCH_BCM4908)
++static int wp_on = 0;
++#else
+ static int wp_on = 1;
++#endif
+ module_param(wp_on, int, 0444);
+
+ /***********************************************************************
ghlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/dts-v1/;


#include "VGV7519.dtsi"

/ {
	model = "VGV7519BRN - KPN Experiabox V8";

	fpi@10000000 {
		localbus@0 {
			nor-boot@0 {
				partitions {
					partition@0 {
						label = "Boot";
						reg = <0x00000 0x40000>;
						read-only;
					};

					partition@50000 {
						label = "Certificate";
						reg = <0x50000 0x10000>;
						read-only;
					};
					partition@60000 {
						label = "Special_Area";
						reg = <0x60000 0x10000>;
						read-only;
					};

					partition@70000 {
						label = " Reserve_0";
						reg = <0x70000 0x10000>;
						read-only;
					};

					partition@80000 {
						label = "Code_Image_0";
						reg = <0x80000 0x780000>;
						brnboot,root-id = <0x00>;
						read-only;
					};

					partition@4000000 {
						compatible = "brnboot,root-selector";
						label = "Primary_Setting";
						reg = <0x4000000 0x10000>;
						read-only;
					};

					partition@4010000 {
						label = "Configuration";
						reg = <0x4010000 0x60000>;
						read-only;
					};

					partition@4070000 {
						label = " Reserve_1";
						reg = <0x4070000 0x10000>;
						read-only;
					};

					partition@4080000 {
						label = "Code_Image_1";
						reg = <0x4080000 0x780000>;
						brnboot,root-id = <0x01>;
						read-only;
					};
				};
			};
		};
	};
};