* [PATCH] ARM: OMAP: Fix gpmc.c compilation
@ 2006-06-16 11:35 Komal Shah
2006-06-16 12:03 ` Juha Yrjölä
0 siblings, 1 reply; 2+ messages in thread
From: Komal Shah @ 2006-06-16 11:35 UTC (permalink / raw)
To: linux-omap-open-source
[-- Attachment #1: Type: text/plain, Size: 191 bytes --]
This patch is compile tested only.
--Komal Shah
http://komalshah.blogspot.com
--
http://www.fastmail.fm - Or how I learned to stop worrying and
love email again
[-- Attachment #2: 0001-fix-gpmc.patch --]
[-- Type: application/octet-stream, Size: 2092 bytes --]
From nobody Mon Sep 17 00:00:00 2001
From: Komal Shah <komal_shah802003@yahoo.com>
Date: Fri, 16 Jun 2006 22:30:10 +0530
Subject: [PATCH] ARM: OMAP: Fix gpmc.c compilation when DEBUG is
enabled and add gpmc_get_clk_period.
Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
---
arch/arm/mach-omap2/gpmc.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
02c467de7150113d6c84cb8d6b21ad6c63f272a1
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 4aeaa4e..34cdaf8 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -71,6 +71,12 @@ u32 gpmc_cs_read_reg(int cs, int idx)
return __raw_readl(gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx);
}
+static unsigned long gpmc_get_clk_period(int div)
+{
+ /* In picoseconds */
+ return 1000000000 / ((clk_get_rate(gpmc_l3_clk)/div) / 1000);
+}
+
/* TODO: Add support for gpmc_fck to clock framework and use it */
static unsigned long gpmc_get_fclk_period(void)
{
@@ -93,7 +99,7 @@ static int set_gpmc_timing_reg(int cs, i
int time, int div, const char *name)
#else
static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
- int time)
+ int time, int div)
#endif
{
u32 l;
@@ -124,11 +130,11 @@ #endif
#ifdef DEBUG
#define GPMC_SET_ONE(reg, st, end, field) \
if (set_gpmc_timing_reg(cs, (reg), (st), (end), \
- t->field, #field) < 0) \
+ t->field, div, #field) < 0) \
return -1
#else
#define GPMC_SET_ONE(reg, st, end, field) \
- if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field) < 0) \
+ if (set_gpmc_timing_reg(cs, (reg), (st), (end), t->field, div) < 0) \
return -1
#endif
@@ -176,8 +182,8 @@ int gpmc_cs_set_timings(int cs, const st
GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
#ifdef DEBUG
- printk(KERN_INFO "GPMC CLK period is %d (div %d)\n",
- cs, get_gpmc_clk_period(div), div);
+ printk(KERN_INFO "GPMC CS%d: CLK period is %3lu (div %d)\n",
+ cs, gpmc_get_clk_period(div), div);
#endif
l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
--
1.3.3
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: OMAP: Fix gpmc.c compilation
2006-06-16 11:35 [PATCH] ARM: OMAP: Fix gpmc.c compilation Komal Shah
@ 2006-06-16 12:03 ` Juha Yrjölä
0 siblings, 0 replies; 2+ messages in thread
From: Juha Yrjölä @ 2006-06-16 12:03 UTC (permalink / raw)
To: Komal Shah; +Cc: linux-omap-open-source
Hi,
Komal Shah wrote:
> This patch is compile tested only.
The patch wasn't entirely correct, but thanks for reporting it. I now
fixed the compilation problems when DEBUG is defined.
Cheers,
Juha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-16 12:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-16 11:35 [PATCH] ARM: OMAP: Fix gpmc.c compilation Komal Shah
2006-06-16 12:03 ` Juha Yrjölä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox