@@ -165,6 +165,7 @@ enum {
};
struct pxa3xx_nand_timing {
+ uint32_t tADL; /* Adress to Write Data delay */
uint32_t tCH; /* Enable signal hold time */
uint32_t tCS; /* Enable signal setup time */
uint32_t tWH; /* ND_nWE high duration */
@@ -172,6 +173,7 @@ struct pxa3xx_nand_timing {
uint32_t tRH; /* ND_nRE high duration */
uint32_t tRP; /* ND_nRE pulse width */
uint32_t tR; /* ND_nWE high to ND_nRE low for read */
+ uint32_t tRHW; /* delay for next command issue */
uint32_t tWHR; /* ND_nWE high to ND_nRE low for status read */
uint32_t tAR; /* ND_ALE low to ND_nRE low delay */
};
@@ -287,13 +289,13 @@ const static struct pxa3xx_nand_cmdset cmdset = {
static struct pxa3xx_nand_timing __devinitdata timing[] = {
/* common timing used to detect flash id */
- { 40, 80, 60, 100, 80, 100, 90000, 400, 40, },
+ { 0, 40, 80, 60, 100, 80, 100, 90000, 0, 400, 40, },
/* Samsung NAND series */
- { 10, 0, 20, 40, 30, 40, 11123, 110, 10, },
+ { 200, 10, 15, 20, 40, 30, 40, 11123, 20, 110, 10, },
/* Micron NAND series */
- { 10, 25, 15, 25, 15, 30, 25000, 60, 10, },
+ { 0, 10, 25, 15, 25, 15, 30, 25000, 0, 60, 10, },
/* ST NAND series */
- { 10, 35, 15, 25, 15, 25, 25000, 60, 10, },
+ { 0, 10, 35, 15, 25, 15, 25, 25000, 0, 60, 10, },
};
static struct pxa3xx_nand_flash __devinitdata builtin_flash_types[] = {
@@ -312,16 +314,20 @@ static struct pxa3xx_nand_flash __devinitdata
builtin_flash_types[] = {
static const char *mtd_names[] = {"pxa3xx_nand-0", "pxa3xx_nand-1", NULL};
-#define NDTR0_tCH(c) (min((c), 7) << 19)
-#define NDTR0_tCS(c) (min((c), 7) << 16)
-#define NDTR0_tWH(c) (min((c), 7) << 11)
-#define NDTR0_tWP(c) (min((c), 7) << 8)
-#define NDTR0_tRH(c) (min((c), 7) << 3)
-#define NDTR0_tRP(c) (min((c), 7) << 0)
-
-#define NDTR1_tR(c) (min((c), 65535) << 16)
-#define NDTR1_tWHR(c) (min((c), 15) << 4)
-#define NDTR1_tAR(c) (min((c), 15) << 0)
+#define NDTR0_tADL(c) (min_t(uint32_t, (c), 31) << 27)
+#define NDTR0_tCH(c) (min_t(uint32_t, (c), 7) << 19)
+#define NDTR0_tCS(c) (min_t(uint32_t, (c), 7) << 16)
+#define NDTR0_tWH(c) (min_t(uint32_t, (c), 7) << 11)
+#define NDTR0_tWP(c) (min_t(uint32_t, (c), 7) << 8)
+#define NDTR0_ETRP (0x1 << 6)
+#define NDTR0_tRH(c) (min_t(uint32_t, (c), 7) << 3)
+#define NDTR0_tRP(c) (min_t(uint32_t, (c), 7) << 0)
+
+#define NDTR1_tR(c) (min_t(uint32_t, (c), 65535) << 16)
+#define NDTR1_PRESCALE (0x1 << 14)
+#define NDTR1_tRHW(c) (min_t(uint32_t, (c), 3) << 8)
+#define NDTR1_tWHR(c) (min_t(uint32_t, (c), 15) << 4)
+#define NDTR1_tAR(c) (min_t(uint32_t, (c), 15) << 0)
/* convert nano-seconds to nand flash controller clock cycles */