Skip to contentSkip to conversation

MTD: Add device-tree support to spear_smi

PATCH In review Stefan Roese 2 participants 3 messages Mar 16, 2012 – Mar 21, 2012 1 message not in the archive

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

PATCH 2/2 MTD: Add device-tree support to spear_smi

This patch adds support to configure the SPEAr SMI driver via device-tree instead of platform_data.

---
 .../devicetree/bindings/mtd/spear_smi.txt          |   31 ++++++
 drivers/mtd/devices/spear_smi.c                    |  111 +++++++++++++++++---
 include/linux/mtd/spear_smi.h                      |    5 +
 3 files changed, 135 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/spear_smi.txt
Documentation/devicetree/bindings/mtd/spear_smi.txt new file +31 -0
new file mode 100644
index 0000000..7248aad
@@ -0,0 +1,31 @@
+* SPEAr SMI
+
+Required properties:
+- compatible : "st,spear600-smi"
+- reg : Address range of the mtd chip
+- #address-cells, #size-cells : Must be present if the device has sub-nodes
+  representing partitions.
+- interrupt-parent: Should be the phandle for the interrupt controller
+  that services interrupts for this device
+- interrupts: Should contain the STMMAC interrupts
+- clock-rate : Functional clock rate of SMI in Hz
+
+Optional properties:
+- st,smi-fast-mode : Flash supports read in fast mode
+
+Example:
+
+	smi: flash@fc000000 {
+		compatible = "st,spear600-smi";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0xfc000000 0x1000>;
+		interrupt-parent = <&vic1>;
+		interrupts = <12>;
+		clock-rate = <50000000>;	/* 50MHz */
+
+		flash@f8000000 {
+			st,smi-fast-mode;
+			...
+		};
+	};
drivers/mtd/devices/spear_smi.c +99 -12

175 lines not on this page · raw message

include/linux/mtd/spear_smi.h +5 -0
index a2ed4be..447ff60 100644
@@ -16,6 +16,10 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
+
+/* max possible slots for serial-nor flash chip in the SMI controller */
+#define MAX_NUM_FLASH_CHIP	4
 
 /* macro to define partitions for flash devices */
 #define DEFINE_PARTS(n, of, s)		\
@@ -57,6 +61,7 @@ struct spear_smi_plat_data {
 	unsigned long clk_rate;
 	int num_flashes;
 	struct spear_smi_flash_info *board_flash_info;
+	struct device_node *np[MAX_NUM_FLASH_CHIP];
 };
 
 #endif /* __MTD_SPEAR_SMI_H */
Signature · 1 line
1.7.9.2

A message that is not in the archive (sent off-list or not yet received): 1331894531-21411-1-git-send-email-sr-ynQEQJNshbs@public.gmane.org

#2 lore raw

Hi Artem,

Quoted 2 lines · On Friday 16 March 2012 11:42:11 Stefan Roese wrote:

This patch adds support to configure the SPEAr SMI driver via device-tree instead of platform_data.

I noticed that you pushed the first part of this patch:

[PATCH 1/2] MTD: spear_smi: Remove default partition information from driver

into l2-mtd.git. What's do plan for this patch?

Thanks,
Stefan