All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laine Walker-Avina <lwalkera@ieee.org>
To: linux-omap@vger.kernel.org
Cc: Laine Walker-Avina <lwalkera@ieee.org>
Subject: [PATCH 5/5] OMAP: Make set_gpmc_timing_reg aware of the TIMEPARAGRANULARITY flag
Date: Tue,  6 Apr 2010 09:51:08 -0700	[thread overview]
Message-ID: <1270572668-2336-6-git-send-email-lwalkera@ieee.org> (raw)
In-Reply-To: <1270572668-2336-5-git-send-email-lwalkera@ieee.org>


Signed-off-by: Laine Walker-Avina <lwalkera@ieee.org>
---
 arch/arm/mach-omap2/gpmc.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 5bc3ca0..9fa80e3 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -171,12 +171,15 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
 #endif
 {
 	u32 l;
-	int ticks, mask, nr_bits;
+	int ticks, mask, nr_bits, para_gran;
+
+	para_gran = (gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1) &
+		GPMC_CONFIG1_TIME_PARA_GRAN ? 2 : 1);
 
 	if (time == 0)
 		ticks = 0;
 	else
-		ticks = gpmc_ns_to_ticks(time);
+		ticks = gpmc_ns_to_ticks(time/para_gran);
 	nr_bits = end_bit - st_bit + 1;
 	if (ticks >= 1 << nr_bits) {
 #ifdef DEBUG
@@ -191,8 +194,8 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
 #ifdef DEBUG
 	printk(KERN_INFO
 		"GPMC CS%d: %-10s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n",
-	       cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000,
-			(l >> st_bit) & mask, time);
+	       cs, name, ticks, gpmc_get_fclk_period() * para_gran *
+		   ticks / 1000, (l >> st_bit) & mask, time);
 #endif
 	l &= ~(mask << st_bit);
 	l |= ticks << st_bit;
@@ -231,6 +234,9 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
 {
 	int div;
 	u32 l;
+#ifdef DEBUG
+	printk(KERN_INFO "GPMC_FCLK: %ld\n", gpmc_get_fclk_period());
+#endif
 
 	div = gpmc_cs_calc_divider(cs, t->sync_clk);
 	if (div < 0)
-- 
1.6.3.3


  reply	other threads:[~2010-04-06 17:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 16:51 [PATCH 0/5] Initial change for merge of new board Laine Walker-Avina
2010-04-06 16:51 ` [PATCH 1/5] OMAP: Add in helper macros for the SDRAM timings Laine Walker-Avina
2010-04-06 16:51   ` [PATCH 2/5] OMAP: Convert the sdram-*.h timings to use the SDRAM timing macros Laine Walker-Avina
2010-04-06 16:51     ` [PATCH 3/5] OMAP: Add SDRAM timings for Micron mt46h16m32lf-6 Laine Walker-Avina
2010-04-06 16:51       ` [PATCH 4/5] OMAP: Add support for setting the divider for sys_clkout2 using clk_set_rate Laine Walker-Avina
2010-04-06 16:51         ` Laine Walker-Avina [this message]
2010-04-06 22:36           ` [PATCH 5/5] OMAP: Make set_gpmc_timing_reg aware of the TIMEPARAGRANULARITY flag Kevin Hilman
2010-07-29 21:44             ` [PATCH v2] " Laine Walker-Avina
2010-04-23  0:55         ` [PATCH 4/5] OMAP: Add support for setting the divider for sys_clkout2 using clk_set_rate Paul Walmsley
2010-05-18 22:04           ` Paul Walmsley
2010-04-06 17:17   ` [PATCH 1/5] OMAP: Add in helper macros for the SDRAM timings Felipe Balbi
2010-04-06 17:26     ` Laine Walker-Avina
2010-04-06 17:28       ` Felipe Balbi
2010-04-06 17:31     ` [PATCH v2 " Laine Walker-Avina
2010-04-23  0:48 ` [PATCH 0/5] Initial change for merge of new board Paul Walmsley

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=1270572668-2336-6-git-send-email-lwalkera@ieee.org \
    --to=lwalkera@ieee.org \
    --cc=linux-omap@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.