* struct dmtimer definition not available in header file
@ 2010-03-10 14:25 Gurav , Pramod
2010-03-10 17:00 ` Kevin Hilman
0 siblings, 1 reply; 6+ messages in thread
From: Gurav , Pramod @ 2010-03-10 14:25 UTC (permalink / raw)
To: linux-omap@vger.kernel.org
Hi All,
I am using dmtimer in my code. Code looks like this:
{
static struct omap_dm_timer *gpt;
void * __iomem gpt10_counter_reg;
unsigned long gpt_phys_base;
omap_dm_timer_init();
gpt = omap_dm_timer_request();
if (!gpt) {
pr_err("Could not get the gptimer\n");
return -1;
}
omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK);
gpt_phys_base = gpt->phys_base;
gpt10_counter_reg =
OMAP2_L4_IO_ADDRESS(gpt_phys_base +
OMAP_TIMER_COUNTER_OFFSET);
gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt));
omap_dm_timer_set_load_start(gpt, 0, 0);
.
.
.
}
I am not able to reference *gpt as the file does not know about struct omap_dm_timer. I have included plat/dmtimer.h.
Why doesn't the dmtimer struct definition appear in plat/dmtimer.h ?
Is there any reason for this?
-
Thanks and Best Regards
Pramod Gurav
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: struct dmtimer definition not available in header file 2010-03-10 14:25 struct dmtimer definition not available in header file Gurav , Pramod @ 2010-03-10 17:00 ` Kevin Hilman 2010-03-10 20:57 ` Cousson, Benoit 2010-03-10 22:37 ` Tony Lindgren 0 siblings, 2 replies; 6+ messages in thread From: Kevin Hilman @ 2010-03-10 17:00 UTC (permalink / raw) To: Gurav , Pramod; +Cc: linux-omap@vger.kernel.org "Gurav , Pramod" <pramod.gurav@ti.com> writes: > Hi All, > I am using dmtimer in my code. Code looks like this: > > { > static struct omap_dm_timer *gpt; > void * __iomem gpt10_counter_reg; > unsigned long gpt_phys_base; > > omap_dm_timer_init(); > gpt = omap_dm_timer_request(); > if (!gpt) { > pr_err("Could not get the gptimer\n"); > return -1; > } > omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK); > > gpt_phys_base = gpt->phys_base; > > gpt10_counter_reg = > OMAP2_L4_IO_ADDRESS(gpt_phys_base + > OMAP_TIMER_COUNTER_OFFSET); > > gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); > omap_dm_timer_set_load_start(gpt, 0, 0); > > . > . > . > } > > I am not able to reference *gpt as the file does not know about struct omap_dm_timer. I have included plat/dmtimer.h. > > Why doesn't the dmtimer struct definition appear in plat/dmtimer.h ? > Is there any reason for this? The declaration appears there, but the definition is hidden. In fact, it is is hidden to prevent exactly the type of thing you're trying to do, and to provide all access to DM timer details via the DM timer API. Looking at your example, I'm guessing you're trying to implement one of my ideas for the SDRC delay calculation by passing the base address to the assembly routine. As I suggested in my original patch, the better way to do this would be to extend the dmtimer API, and use C instead of assembly. Kevin ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: struct dmtimer definition not available in header file 2010-03-10 17:00 ` Kevin Hilman @ 2010-03-10 20:57 ` Cousson, Benoit 2010-03-11 4:57 ` Gurav , Pramod 2010-03-10 22:37 ` Tony Lindgren 1 sibling, 1 reply; 6+ messages in thread From: Cousson, Benoit @ 2010-03-10 20:57 UTC (permalink / raw) To: Kevin Hilman, Gurav , Pramod; +Cc: linux-omap@vger.kernel.org >From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- >owner@vger.kernel.org] On Behalf Of Kevin Hilman >Sent: Wednesday, March 10, 2010 6:01 PM > >"Gurav , Pramod" <pramod.gurav@ti.com> writes: > >> Hi All, >> I am using dmtimer in my code. Code looks like this: >> >> { >> static struct omap_dm_timer *gpt; >> void * __iomem gpt10_counter_reg; >> unsigned long gpt_phys_base; >> >> omap_dm_timer_init(); >> gpt = omap_dm_timer_request(); >> if (!gpt) { >> pr_err("Could not get the gptimer\n"); >> return -1; >> } >> omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK); >> >> gpt_phys_base = gpt->phys_base; >> >> gpt10_counter_reg = >> OMAP2_L4_IO_ADDRESS(gpt_phys_base + >> OMAP_TIMER_COUNTER_OFFSET); >> >> gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); >> omap_dm_timer_set_load_start(gpt, 0, 0); >> >> . >> . >> . >> } >> >> I am not able to reference *gpt as the file does not know about struct >omap_dm_timer. I have included plat/dmtimer.h. >> >> Why doesn't the dmtimer struct definition appear in plat/dmtimer.h ? >> Is there any reason for this? > >The declaration appears there, but the definition is hidden. > >In fact, it is is hidden to prevent exactly the type of thing you're >trying to do, and to provide all access to DM timer details via the DM >timer API. > >Looking at your example, I'm guessing you're trying to implement one >of my ideas for the SDRC delay calculation by passing the base address >to the assembly routine. > >As I suggested in my original patch, the better way to do this would >be to extend the dmtimer API, and use C instead of assembly. Considering the accuracy needed in that case and the number of iteration (10000), I clearly don't think we need to ack the dmtimer API to read the timer value in ASM. Using the regular omap_dm_timer_read_counter before and after calling the ASM function will be enough. Moreover the current ASM function can be simplify to reduce the overhead. Regards, Benoit Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920 ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: struct dmtimer definition not available in header file 2010-03-10 20:57 ` Cousson, Benoit @ 2010-03-11 4:57 ` Gurav , Pramod 2010-03-11 10:24 ` Cousson, Benoit 0 siblings, 1 reply; 6+ messages in thread From: Gurav , Pramod @ 2010-03-11 4:57 UTC (permalink / raw) To: Cousson, Benoit, Kevin Hilman; +Cc: linux-omap@vger.kernel.org Hi Benoit, Kelvin, > >> OMAP2_L4_IO_ADDRESS(gpt_phys_base + > >> OMAP_TIMER_COUNTER_OFFSET); > >> > >> gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); > >> omap_dm_timer_set_load_start(gpt, 0, 0); > >> > >> . > >> . > >> . > >> } > >> > >> I am not able to reference *gpt as the file does not know about struct > >omap_dm_timer. I have included plat/dmtimer.h. > >> > >> Why doesn't the dmtimer struct definition appear in plat/dmtimer.h ? > >> Is there any reason for this? > > > >The declaration appears there, but the definition is hidden. > > > >In fact, it is is hidden to prevent exactly the type of thing you're > >trying to do, and to provide all access to DM timer details via the DM > >timer API. > > > >Looking at your example, I'm guessing you're trying to implement one > >of my ideas for the SDRC delay calculation by passing the base address > >to the assembly routine. > > > >As I suggested in my original patch, the better way to do this would > >be to extend the dmtimer API, and use C instead of assembly. > > Considering the accuracy needed in that case and the number of iteration > (10000), I clearly don't think we need to ack the dmtimer API to read the > timer value in ASM. > Using the regular omap_dm_timer_read_counter before and after calling the > ASM function will be enough. > Moreover the current ASM function can be simplify to reduce the overhead. > Thank you. I am trying with DMtimer API. I will even reduce the dmtimer part of ASM code and run only the loop in ASM. Thanks and Regards Pramod ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: struct dmtimer definition not available in header file 2010-03-11 4:57 ` Gurav , Pramod @ 2010-03-11 10:24 ` Cousson, Benoit 0 siblings, 0 replies; 6+ messages in thread From: Cousson, Benoit @ 2010-03-11 10:24 UTC (permalink / raw) To: Gurav , Pramod, Kevin Hilman; +Cc: linux-omap@vger.kernel.org >From: Gurav , Pramod >Sent: Thursday, March 11, 2010 5:57 AM >To: Cousson, Benoit; Kevin Hilman >Cc: linux-omap@vger.kernel.org >Subject: RE: struct dmtimer definition not available in header file > >Hi Benoit, Kelvin, > >> >> OMAP2_L4_IO_ADDRESS(gpt_phys_base + >> >> OMAP_TIMER_COUNTER_OFFSET); >> >> >> >> gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); >> >> omap_dm_timer_set_load_start(gpt, 0, 0); >> >> >> >> . >> >> . >> >> . >> >> } >> >> >> >> I am not able to reference *gpt as the file does not know about struct >> >omap_dm_timer. I have included plat/dmtimer.h. >> >> >> >> Why doesn't the dmtimer struct definition appear in plat/dmtimer.h ? >> >> Is there any reason for this? >> > >> >The declaration appears there, but the definition is hidden. >> > >> >In fact, it is is hidden to prevent exactly the type of thing you're >> >trying to do, and to provide all access to DM timer details via the DM >> >timer API. >> > >> >Looking at your example, I'm guessing you're trying to implement one >> >of my ideas for the SDRC delay calculation by passing the base address >> >to the assembly routine. >> > >> >As I suggested in my original patch, the better way to do this would >> >be to extend the dmtimer API, and use C instead of assembly. >> >> Considering the accuracy needed in that case and the number of iteration >> (10000), I clearly don't think we need to ack the dmtimer API to read the >> timer value in ASM. >> Using the regular omap_dm_timer_read_counter before and after calling the >> ASM function will be enough. >> Moreover the current ASM function can be simplify to reduce the overhead. >> > >Thank you. >I am trying with DMtimer API. I will even reduce the dmtimer part of ASM >code and run only the loop in ASM. Yes, that was my point; without the timer access the asm function will have only 3 instructions. Regards, Benoit > >Thanks and Regards >Pramod Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: struct dmtimer definition not available in header file 2010-03-10 17:00 ` Kevin Hilman 2010-03-10 20:57 ` Cousson, Benoit @ 2010-03-10 22:37 ` Tony Lindgren 1 sibling, 0 replies; 6+ messages in thread From: Tony Lindgren @ 2010-03-10 22:37 UTC (permalink / raw) To: Kevin Hilman; +Cc: Gurav , Pramod, linux-omap@vger.kernel.org * Kevin Hilman <khilman@deeprootsystems.com> [100310 09:14]: > "Gurav , Pramod" <pramod.gurav@ti.com> writes: > > > Hi All, > > I am using dmtimer in my code. Code looks like this: > > > > { > > static struct omap_dm_timer *gpt; > > void * __iomem gpt10_counter_reg; > > unsigned long gpt_phys_base; > > > > omap_dm_timer_init(); > > gpt = omap_dm_timer_request(); > > if (!gpt) { > > pr_err("Could not get the gptimer\n"); > > return -1; > > } > > omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK); > > > > gpt_phys_base = gpt->phys_base; > > > > gpt10_counter_reg = > > OMAP2_L4_IO_ADDRESS(gpt_phys_base + > > OMAP_TIMER_COUNTER_OFFSET); We should use ioremap for allthings like this nowadays. There are static mappings in place for that. > > gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); > > omap_dm_timer_set_load_start(gpt, 0, 0); > > > > . > > . > > . > > } > > > > I am not able to reference *gpt as the file does not know about struct omap_dm_timer. I have included plat/dmtimer.h. > > > > Why doesn't the dmtimer struct definition appear in plat/dmtimer.h ? > > Is there any reason for this? > > The declaration appears there, but the definition is hidden. > > In fact, it is is hidden to prevent exactly the type of thing you're > trying to do, and to provide all access to DM timer details via the DM > timer API. > > Looking at your example, I'm guessing you're trying to implement one > of my ideas for the SDRC delay calculation by passing the base address > to the assembly routine. > > As I suggested in my original patch, the better way to do this would > be to extend the dmtimer API, and use C instead of assembly. And if it's generic code, you're better off using Linux hrtimers instead. Otherwise there's a good chance your timer won't wake up the system from the idle mode and you miss the timer events. Regards, Tony ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-11 10:24 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-03-10 14:25 struct dmtimer definition not available in header file Gurav , Pramod 2010-03-10 17:00 ` Kevin Hilman 2010-03-10 20:57 ` Cousson, Benoit 2010-03-11 4:57 ` Gurav , Pramod 2010-03-11 10:24 ` Cousson, Benoit 2010-03-10 22:37 ` Tony Lindgren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox