public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] OMAP3:NAND: Change the NAND timing assignment
Date: Mon, 13 Apr 2009 15:48:01 -0500	[thread overview]
Message-ID: <1239655683-16490-2-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1239655683-16490-1-git-send-email-nm@ti.com>

NAND timing is defaulted to Micron NAND. To support
varied boards, this is not scalable.
This patch introduces compile time option to select
the timing to select at the same time allows
platforms to build with custom timing params

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 cpu/arm_cortexa8/omap3/mem.c     |   12 ++++++------
 include/asm-arm/arch-omap3/mem.h |   38 +++++++++++++++++++++++---------------
 include/configs/omap3_beagle.h   |    1 +
 include/configs/omap3_overo.h    |    1 +
 include/configs/omap3_pandora.h  |    1 +
 include/configs/omap3_zoom1.h    |    1 +
 6 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/cpu/arm_cortexa8/omap3/mem.c b/cpu/arm_cortexa8/omap3/mem.c
index 3cc22c4..14cd87d 100644
--- a/cpu/arm_cortexa8/omap3/mem.c
+++ b/cpu/arm_cortexa8/omap3/mem.c
@@ -43,12 +43,12 @@ volatile unsigned int boot_flash_env_addr;
 
 #if defined(CONFIG_CMD_NAND)
 static u32 gpmc_m_nand[GPMC_MAX_REG] = {
-	M_NAND_GPMC_CONFIG1,
-	M_NAND_GPMC_CONFIG2,
-	M_NAND_GPMC_CONFIG3,
-	M_NAND_GPMC_CONFIG4,
-	M_NAND_GPMC_CONFIG5,
-	M_NAND_GPMC_CONFIG6, 0
+	NAND_GPMC_CONFIG1,
+	NAND_GPMC_CONFIG2,
+	NAND_GPMC_CONFIG3,
+	NAND_GPMC_CONFIG4,
+	NAND_GPMC_CONFIG5,
+	NAND_GPMC_CONFIG6, 0
 };
 
 gpmc_csx_t *nand_cs_base;
diff --git a/include/asm-arm/arch-omap3/mem.h b/include/asm-arm/arch-omap3/mem.h
index 6f0f90b..622578e 100644
--- a/include/asm-arm/arch-omap3/mem.h
+++ b/include/asm-arm/arch-omap3/mem.h
@@ -137,21 +137,29 @@ typedef enum {
 #define GPMC_SIZE_32M	0xE
 #define GPMC_SIZE_16M	0xF
 
-#define SMNAND_GPMC_CONFIG1	0x00000800
-#define SMNAND_GPMC_CONFIG2	0x00141400
-#define SMNAND_GPMC_CONFIG3	0x00141400
-#define SMNAND_GPMC_CONFIG4	0x0F010F01
-#define SMNAND_GPMC_CONFIG5	0x010C1414
-#define SMNAND_GPMC_CONFIG6	0x1F0F0A80
-#define SMNAND_GPMC_CONFIG7	0x00000C44
-
-#define M_NAND_GPMC_CONFIG1	0x00001800
-#define M_NAND_GPMC_CONFIG2	0x00141400
-#define M_NAND_GPMC_CONFIG3	0x00141400
-#define M_NAND_GPMC_CONFIG4	0x0F010F01
-#define M_NAND_GPMC_CONFIG5	0x010C1414
-#define M_NAND_GPMC_CONFIG6	0x1f0f0A80
-#define M_NAND_GPMC_CONFIG7	0x00000C44
+/*
+ * Standard OMAP3 NAND device definitions
+ * Define SMNAND_GPMC or M_NAND_GPMC to use the defaults
+ * if your board has a specific timing (such as optimized timing),
+ * define NAND_GPMC_CONFIG1 to 7
+ */
+#ifdef SMNAND_GPMC
+#define NAND_GPMC_CONFIG1	0x00000800
+#define NAND_GPMC_CONFIG2	0x00141400
+#define NAND_GPMC_CONFIG3	0x00141400
+#define NAND_GPMC_CONFIG4	0x0F010F01
+#define NAND_GPMC_CONFIG5	0x010C1414
+#define NAND_GPMC_CONFIG6	0x1F0F0A80
+#define NAND_GPMC_CONFIG7	0x00000C44
+#elif defined(M_NAND_GPMC)
+#define NAND_GPMC_CONFIG1	0x00001800
+#define NAND_GPMC_CONFIG2	0x00141400
+#define NAND_GPMC_CONFIG3	0x00141400
+#define NAND_GPMC_CONFIG4	0x0F010F01
+#define NAND_GPMC_CONFIG5	0x010C1414
+#define NAND_GPMC_CONFIG6	0x1f0f0A80
+#define NAND_GPMC_CONFIG7	0x00000C44
+#endif
 
 #define STNOR_GPMC_CONFIG1	0x3
 #define STNOR_GPMC_CONFIG2	0x00151501
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 5a948e4..3f47b7a 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -126,6 +126,7 @@
  * Board NAND Info.
  */
 #define CONFIG_NAND_OMAP_GPMC
+#define M_NAND_GPMC
 #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
 							/* to access nand */
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 51b04b6..093f922 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -113,6 +113,7 @@
  * Board NAND Info.
  */
 #define CONFIG_NAND_OMAP_GPMC
+#define M_NAND_GPMC
 #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
 							/* to access nand */
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 40107a6..7c3d2f0 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -116,6 +116,7 @@
  * Board NAND Info.
  */
 #define CONFIG_NAND_OMAP_GPMC
+#define M_NAND_GPMC
 #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
 							/* to access nand */
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index 8e984b4..794ad96 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -123,6 +123,7 @@
  * Board NAND Info.
  */
 #define CONFIG_NAND_OMAP_GPMC
+#define M_NAND_GPMC
 #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
 							/* to access nand */
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
-- 
1.5.4.3

  reply	other threads:[~2009-04-13 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13 20:48 [U-Boot] [PATCH 0/3] OMAP3:NAND: Cleanup patchset Nishanth Menon
2009-04-13 20:48 ` Nishanth Menon [this message]
2009-04-13 20:48   ` [U-Boot] [PATCH 2/3] OMAP3:NAND: Change the NAND CS handling Nishanth Menon
2009-04-13 20:48     ` [U-Boot] [PATCH 3/3] OMAP3:NAND: rename SMNAND_ENV_OFFSET Nishanth Menon
2009-04-17  5:36       ` Jean-Christophe PLAGNIOL-VILLARD
2009-04-17  5:34     ` [U-Boot] [PATCH 2/3] OMAP3:NAND: Change the NAND CS handling Jean-Christophe PLAGNIOL-VILLARD
2009-04-17  5:33   ` [U-Boot] [PATCH 1/3] OMAP3:NAND: Change the NAND timing assignment Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1239655683-16490-2-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox