summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVipin Kumar <vipin.kumar@st.com>2012-03-14 11:47:14 +0530
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-27 00:59:34 +0100
commite2f6bce8d94d2c82d4f7ae9d94743963a3b10136 (patch)
treeed6cdc5023282b4322d5490fd579105f7483ab0b /include
parentf63acb75c5d8a9eb7cc5548e3e778d2a00bf3bae (diff)
downloadlinux-stable-e2f6bce8d94d2c82d4f7ae9d94743963a3b10136.tar.gz
linux-stable-e2f6bce8d94d2c82d4f7ae9d94743963a3b10136.tar.bz2
linux-stable-e2f6bce8d94d2c82d4f7ae9d94743963a3b10136.zip
mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform
FSMC controllers provide registers to program the required timing values for attached NAND device. The timing values used until now are relaxed and should work for all devices. Although, for read/write performance improvements, the fsmc nand driver should accept nand timings as a platform data and program the timing parameters into fsmc registers accordingly. This patch implements this modification. Additionally, it programs the default timing parameters if these are not passed via platform data. Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/fsmc.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h
index e877325d9c51..c4ac07a19691 100644
--- a/include/linux/mtd/fsmc.h
+++ b/include/linux/mtd/fsmc.h
@@ -90,17 +90,29 @@ struct fsmc_regs {
#define FSMC_ECCEN (1 << 6)
#define FSMC_ECCPLEN_512 (0 << 7)
#define FSMC_ECCPLEN_256 (1 << 7)
-#define FSMC_TCLR_1 (1 << 9)
-#define FSMC_TAR_1 (1 << 13)
+#define FSMC_TCLR_1 (1)
+#define FSMC_TCLR_SHIFT (9)
+#define FSMC_TCLR_MASK (0xF)
+#define FSMC_TAR_1 (1)
+#define FSMC_TAR_SHIFT (13)
+#define FSMC_TAR_MASK (0xF)
/* sts register definitions */
#define FSMC_CODE_RDY (1 << 15)
/* comm register definitions */
-#define FSMC_TSET_0 (0 << 0)
-#define FSMC_TWAIT_6 (6 << 8)
-#define FSMC_THOLD_4 (4 << 16)
-#define FSMC_THIZ_1 (1 << 24)
+#define FSMC_TSET_0 0
+#define FSMC_TSET_SHIFT 0
+#define FSMC_TSET_MASK 0xFF
+#define FSMC_TWAIT_6 6
+#define FSMC_TWAIT_SHIFT 8
+#define FSMC_TWAIT_MASK 0xFF
+#define FSMC_THOLD_4 4
+#define FSMC_THOLD_SHIFT 16
+#define FSMC_THOLD_MASK 0xFF
+#define FSMC_THIZ_1 1
+#define FSMC_THIZ_SHIFT 24
+#define FSMC_THIZ_MASK 0xFF
/*
* There are 13 bytes of ecc for every 512 byte block in FSMC version 8
@@ -120,6 +132,15 @@ struct fsmc_eccplace {
struct fsmc_nand_eccplace eccplace[MAX_ECCPLACE_ENTRIES];
};
+struct fsmc_nand_timings {
+ uint8_t tclr;
+ uint8_t tar;
+ uint8_t thiz;
+ uint8_t thold;
+ uint8_t twait;
+ uint8_t tset;
+};
+
/**
* fsmc_nand_platform_data - platform specific NAND controller config
* @partitions: partition table for the platform, use a default fallback
@@ -133,6 +154,7 @@ struct fsmc_eccplace {
* this may be set to NULL
*/
struct fsmc_nand_platform_data {
+ struct fsmc_nand_timings *nand_timings;
struct mtd_partition *partitions;
unsigned int nr_partitions;
unsigned int options;