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 2/3] OMAP3:NAND: Change the NAND CS handling
Date: Mon, 13 Apr 2009 15:48:02 -0500	[thread overview]
Message-ID: <1239655683-16490-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1239655683-16490-2-git-send-email-nm@ti.com>

NAND CS is assumed to be CS0 while we could have
choice b/w 0 to 7. This patch enables board files
to handle varied CS on a need basis.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 cpu/arm_cortexa8/omap3/mem.c     |    8 +-------
 include/asm-arm/arch-omap3/mem.h |    8 ++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/cpu/arm_cortexa8/omap3/mem.c b/cpu/arm_cortexa8/omap3/mem.c
index 14cd87d..9c90f32 100644
--- a/cpu/arm_cortexa8/omap3/mem.c
+++ b/cpu/arm_cortexa8/omap3/mem.c
@@ -54,12 +54,6 @@ static u32 gpmc_m_nand[GPMC_MAX_REG] = {
 gpmc_csx_t *nand_cs_base;
 gpmc_t *gpmc_cfg_base;
 
-#if defined(CONFIG_ENV_IS_IN_NAND)
-#define GPMC_CS 0
-#else
-#define GPMC_CS 1
-#endif
-
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
@@ -249,7 +243,7 @@ void gpmc_init(void)
 	gpmc_config = gpmc_m_nand;
 	gpmc_cfg_base = gpmc_base;
 	nand_cs_base = (gpmc_csx_t *)(GPMC_CONFIG_CS0_BASE +
-					(GPMC_CS * GPMC_CONFIG_WIDTH));
+					(NAND_GPMC_CS * GPMC_CONFIG_WIDTH));
 	base = PISMO1_NAND_BASE;
 	size = PISMO1_NAND_SIZE;
 	enable_gpmc_config(gpmc_config, nand_cs_base, base, size);
diff --git a/include/asm-arm/arch-omap3/mem.h b/include/asm-arm/arch-omap3/mem.h
index 622578e..1c4abe7 100644
--- a/include/asm-arm/arch-omap3/mem.h
+++ b/include/asm-arm/arch-omap3/mem.h
@@ -216,6 +216,14 @@ typedef enum {
 /* max number of GPMC regs */
 #define GPMC_MAX_REG	7
 
+#if defined(CONFIG_ENV_IS_IN_NAND)
+#define NAND_GPMC_CS 0
+#else
+#ifndef NAND_GPMC_CS
+#define NAND_GPMC_CS 1
+#endif		/* NAND_GPMC_CS */
+#endif		/* CONFIG_ENV_IS_IN_NAND */
+
 #define PISMO1_NOR	1
 #define PISMO1_NAND	2
 #define PISMO2_CS0	3
-- 
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 ` [U-Boot] [PATCH 1/3] OMAP3:NAND: Change the NAND timing assignment Nishanth Menon
2009-04-13 20:48   ` Nishanth Menon [this message]
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-3-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