Skip to contentSkip to conversation

ARM: BCM5301X: Specify NAND chip select and ECC in separated files

PATCH Applied Rafał Miłecki 2 participants 4 messages Jun 6, 2016 – Jul 7, 2016 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: BCM5301X: Specify NAND chip select and ECC in separated files

Using separated file with common chip select parameters will allow us adding other ECC setups without code duplication.

---
 arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi | 16 +++++-----------
 arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi      | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi
arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi +5 -11
index d10781e..9a9630d 100644
@@ -9,16 +9,10 @@
  * Licensed under the GNU/GPL. See COPYING for details.
  */
 
-/ {
-	nand at 18028000 {
-		nandcs at 0 {
-			compatible = "brcm,nandcs";
-			reg = <0>;
-			#address-cells = <1>;
-			#size-cells = <1>;
+#include "bcm5301x-nand-cs0.dtsi"
 
-			nand-ecc-strength = <8>;
-			nand-ecc-step-size = <512>;
-		};
-	};
+&nandcs {
+	nand-ecc-algo = "bch";
+	nand-ecc-strength = <8>;
+	nand-ecc-step-size = <512>;
 };
arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi new file +18 -0
new file mode 100644
index 0000000..1684951
@@ -0,0 +1,18 @@
+/*
+ * Broadcom Northstar NAND.
+ *
+ * Copyright (C) 2015 Hauke Mehrtens <[email protected]>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+/ {
+	nand at 18028000 {
+		nandcs: nandcs at 0 {
+			compatible = "brcm,nandcs";
+			reg = <0>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+		};
+	};
+};
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 2/2 ARM: BCM5301X: Fix NAND ECC parameters for D-Link DIR-885L

This device uses BCH-1 instead of BCH-8. This fixes ECC errors and makes NAND usable with brcmnand.

---
As suggested recently, the new file uses BSD-compatible license. I was considering BSD [23]-clause license and Hauke said he likes ISC which is even simpler, so I picked this one.

---
 arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts |  2 +-
 arch/arm/boot/dts/bcm5301x-nand-cs0-bch1.dtsi | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/bcm5301x-nand-cs0-bch1.dtsi
arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +1 -1
index 50cf804..c8c0b36 100644
@@ -10,7 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
-#include "bcm5301x-nand-cs0-bch8.dtsi"
+#include "bcm5301x-nand-cs0-bch1.dtsi"
 
 / {
 	compatible = "dlink,dir-885l", "brcm,bcm47094", "brcm,bcm4708";
arch/arm/boot/dts/bcm5301x-nand-cs0-bch1.dtsi new file +15 -0
new file mode 100644
index 0000000..24b099c
@@ -0,0 +1,15 @@
+/*
+ * Broadcom Northstar NAND.
+ *
+ * Copyright (C) 2016 Rafa? Mi?ecki <[email protected]>
+ *
+ * Licensed under the ISC license.
+ */
+
+#include "bcm5301x-nand-cs0.dtsi"
+
+&nandcs {
+	nand-ecc-algo = "bch";
+	nand-ecc-strength = <1>;
+	nand-ecc-step-size = <512>;
+};
Signature · 1 line
1.8.4.5
#2 lore raw

Re: [PATCH 2/2] ARM: BCM5301X: Fix NAND ECC parameters for D-Link DIR-885L

Le 06/06/2016 00:43, Rafa? Mi?ecki a ?crit :

Quoted 4 lines

This device uses BCH-1 instead of BCH-8. This fixes ECC errors and makes NAND usable with brcmnand.

And also applied, thanks!

Signature · 1 line
Florian