From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 01/14] omap3: mem: Comment enable_gpmc_cs_config more
Date: Fri, 18 Nov 2011 15:47:58 -0700 [thread overview]
Message-ID: <1321656491-19874-2-git-send-email-trini@ti.com> (raw)
In-Reply-To: <1321656491-19874-1-git-send-email-trini@ti.com>
Expand the "enable the config" comment to explain what the bit shifts
are and define out two of the magic numbers.
Signed-off-by: Tom Rini <trini@ti.com>
---
arch/arm/cpu/armv7/omap3/mem.c | 12 +++++++++---
arch/arm/include/asm/arch-omap3/mem.h | 4 ++++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap3/mem.c b/arch/arm/cpu/armv7/omap3/mem.c
index a01c303..2f1efea 100644
--- a/arch/arm/cpu/armv7/omap3/mem.c
+++ b/arch/arm/cpu/armv7/omap3/mem.c
@@ -105,9 +105,15 @@ void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
writel(gpmc_config[3], &cs->config4);
writel(gpmc_config[4], &cs->config5);
writel(gpmc_config[5], &cs->config6);
- /* Enable the config */
- writel((((size & 0xF) << 8) | ((base >> 24) & 0x3F) |
- (1 << 6)), &cs->config7);
+
+ /*
+ * Enable the config. size is the CS size and goes in
+ * bits 11:8. We set bit 6 to enable this CS and the base
+ * address goes into bits 5:0.
+ */
+ writel((size << 8) | (GPMC_CS_ENABLE << 6) |
+ ((base >> 24) & GPMC_BASEADDR_MASK),
+ &cs->config7);
sdelay(2000);
}
diff --git a/arch/arm/include/asm/arch-omap3/mem.h b/arch/arm/include/asm/arch-omap3/mem.h
index db6a696..abf4e82 100644
--- a/arch/arm/include/asm/arch-omap3/mem.h
+++ b/arch/arm/include/asm/arch-omap3/mem.h
@@ -259,6 +259,10 @@ enum {
#define GPMC_SIZE_32M 0xE
#define GPMC_SIZE_16M 0xF
+#define GPMC_BASEADDR_MASK 0x3F
+
+#define GPMC_CS_ENABLE 0x1
+
#define SMNAND_GPMC_CONFIG1 0x00000800
#define SMNAND_GPMC_CONFIG2 0x00141400
#define SMNAND_GPMC_CONFIG3 0x00141400
--
1.7.0.4
next prev parent reply other threads:[~2011-11-18 22:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 22:47 [U-Boot] [PATCH v4 0/14] Add more framework to OMAP3 SPL, port more boards Tom Rini
2011-11-18 22:47 ` Tom Rini [this message]
2011-11-18 22:47 ` [U-Boot] [PATCH v4 02/14] OMAP3: Update SDRC dram_init to always call make_cs1_contiguous() Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 03/14] OMAP3: Add a helper function to set timings in SDRC Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 04/14] OMAP3: Change mem_ok to clear again after reading back Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 05/14] OMAP3: Remove get_mem_type prototype Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 06/14] omap3: mem: Add MCFG helper macro Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 07/14] OMAP3: Add optimal SDRC autorefresh control values Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 08/14] OMAP3: Suffix all Micron memory timing parts with their speed Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 09/14] OMAP3 SPL: Rework memory initalization and devkit8000 support Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 10/14] OMAP3 SPL: Add identify_nand_chip function Tom Rini
2011-11-20 7:36 ` Igor Grinberg
2011-11-20 14:26 ` Tom Rini
2011-11-21 7:04 ` Igor Grinberg
2011-11-21 14:12 ` Tom Rini
2011-11-21 14:41 ` Igor Grinberg
2011-11-21 15:33 ` Tom Rini
2011-11-22 14:33 ` Igor Grinberg
2011-11-22 14:51 ` Tom Rini
2011-11-22 15:39 ` Tom Rini
2011-11-23 7:39 ` Igor Grinberg
2011-11-23 14:48 ` Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 11/14] OMAP3: Add SPL support to Beagleboard Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 12/14] OMAP3: Add SPL support to omap3_evm Tom Rini
2011-11-29 22:20 ` Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 13/14] AM3517: Add SPL support Tom Rini
2011-11-18 22:48 ` [U-Boot] [PATCH v4 14/14] AM3517 CraneBoard: " Tom Rini
2011-11-29 21:55 ` [U-Boot] [PATCH v4 0/14] Add more framework to OMAP3 SPL, port more boards Tom Rini
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=1321656491-19874-2-git-send-email-trini@ti.com \
--to=trini@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