Skip to contentSkip to conversation

MTD: Add device-tree support to fsmc_nand

PATCH Applied Stefan Roese 2 participants 2 messages Mar 16, 2012 – Mar 19, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: Add device-tree support to fsmc_nand

This patch adds support to configure the FSMC NAND driver (used amongst others on SPEAr platforms) via device-tree instead of platform_data.

---
 .../devicetree/bindings/mtd/fsmc-nand.txt          |   33 ++++++++++++
 drivers/mtd/nand/fsmc_nand.c                       |   57 +++++++++++++++++++-
 include/linux/mtd/fsmc.h                           |    4 +-
 3 files changed, 91 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/fsmc-nand.txt
Documentation/devicetree/bindings/mtd/fsmc-nand.txt new file +33 -0
new file mode 100644
index 0000000..e2c663b
@@ -0,0 +1,33 @@
+* FSMC NAND
+
+Required properties:
+- compatible : "st,spear600-fsmc-nand"
+- reg : Address range of the mtd chip
+- reg-names: Should contain the reg names "fsmc_regs" and "nand_data"
+- st,ale-off : Chip specific offset to ALE
+- st,cle-off : Chip specific offset to CLE
+
+Optional properties:
+- bank-width : Width (in bytes) of the device.  If not present, the width
+  defaults to 1 byte
+- nand-skip-bbtscan: Indicates the the BBT scanning should be skipped
+
+Example:
+
+	fsmc: flash@d1800000 {
+		compatible = "st,spear600-fsmc-nand";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0xd1800000 0x1000	/* FSMC Register */
+		       0xd2000000 0x4000>;	/* NAND Base */
+		reg-names = "fsmc_regs", "nand_data";
+		st,ale-off = <0x20000>;
+		st,cle-off = <0x10000>;
+
+		bank-width = <1>;
+		nand-skip-bbtscan;
+
+		partition@0 {
+			...
+		};
+	};
drivers/mtd/nand/fsmc_nand.c +56 -1

98 lines not on this page · raw message

include/linux/mtd/fsmc.h +2 -2
index 823359c..b200292 100644
@@ -156,8 +156,8 @@ struct fsmc_nand_platform_data {
 	unsigned int		bank;
 
 	/* CLE, ALE offsets */
-	unsigned long           cle_off;
-	unsigned long           ale_off;
+	unsigned int		cle_off;
+	unsigned int		ale_off;
 	enum access_mode	mode;
 
 	void			(*select_bank)(uint32_t bank, uint32_t busw);
Signature · 1 line
1.7.9.2
#1 lore raw
Quoted 4 lines · Stefan Roese

This patch adds support to configure the FSMC NAND driver (used amongst others on SPEAr platforms) via device-tree instead of platform_data.

Pushed to l2-mtd.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy