From patchwork Tue Apr 6 16:51:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laine Walker-Avina X-Patchwork-Id: 90810 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o36H2PRG022566 for ; Tue, 6 Apr 2010 17:02:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755737Ab0DFRCc (ORCPT ); Tue, 6 Apr 2010 13:02:32 -0400 Received: from exprod7og124.obsmtp.com ([64.18.2.26]:56497 "HELO exprod7og124.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754845Ab0DFRCc (ORCPT ); Tue, 6 Apr 2010 13:02:32 -0400 Received: from source ([204.130.249.21]) by exprod7ob124.postini.com ([64.18.6.12]) with SMTP ID DSNKS7tpJrFzVL+FGbpH1OkjpVSAS6FxHjqB@postini.com; Tue, 06 Apr 2010 10:02:31 PDT Received: from localhost.localdomain ([172.16.2.46]) by p21.roseville.pasco.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 6 Apr 2010 09:52:21 -0700 From: Laine Walker-Avina To: linux-omap@vger.kernel.org Cc: Laine Walker-Avina Subject: [PATCH 5/5] OMAP: Make set_gpmc_timing_reg aware of the TIMEPARAGRANULARITY flag Date: Tue, 6 Apr 2010 09:51:08 -0700 Message-Id: <1270572668-2336-6-git-send-email-lwalkera@ieee.org> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1270572668-2336-5-git-send-email-lwalkera@ieee.org> References: <1270572668-2336-1-git-send-email-lwalkera@ieee.org> <1270572668-2336-2-git-send-email-lwalkera@ieee.org> <1270572668-2336-3-git-send-email-lwalkera@ieee.org> <1270572668-2336-4-git-send-email-lwalkera@ieee.org> <1270572668-2336-5-git-send-email-lwalkera@ieee.org> X-OriginalArrivalTime: 06 Apr 2010 16:52:21.0531 (UTC) FILETIME=[867256B0:01CAD5A9] Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 06 Apr 2010 17:02:44 +0000 (UTC) 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)