lkml.org 
[lkml]   [2009]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH 1/1] [ARM] ep93xx clockevent support
Date
From
On Thursday, July 30, 2009 3:18 PM, H Hartley Sweeten wrote:
>> From: Ahmed Ammar <aammar@edge-techno.com>
>>
>> Based on previous work by Thomas Gleixner.
>>
>> Signed-off-by: Ahmed Ammar <aammar@edge-techno.com>
>
> Hmm.. With kernel 2.6.30.2 this does not build. See below.

Oops.. My bad. One of the issues was my fault...

[snip]

>> static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
>> {
>> - __raw_writel(1, EP93XX_TIMER1_CLEAR);
>> - while ((signed long)
>> - (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
>> - >= TIMER4_TICKS_PER_JIFFY) {
>> - last_jiffy_time += TIMER4_TICKS_PER_JIFFY;
>> - timer_tick();
>> - }
>> -
>> + struct clock_event_device *evt = dev_id;
>> + __raw_writel(EP93XX_TC_CLEAR, EP93XX_TIMER1_CLEAR);
>> + evt->event_handler(evt);
>
> Here I get "error: dereferencing pointer to incomplete type"

I added a typo that caused this... ;-)

[snip]

>> - setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
>> +cycle_t ep93xx_get_cycles(void)
>> +{
>> + return __raw_readl(EP93XX_TIMER4_VALUE_LOW);
>> }
>>
>> -static unsigned long ep93xx_gettimeoffset(void)
>> +static struct clocksource clocksource_ep93xx = {
>> + .name = "ep93xx_timer4",
>> + .rating = 200,
>> + .read = ep93xx_get_cycles,
>
> Here I get "warning: initialization from incompatible pointer type"

This one is real.

The read callback is supposed to be:

cycle_t (*read)(struct clocksource *cs);

You need to fix the ep93xx_get_cycles() function and the call below.

>> + .mask = 0xFFFFFFFF,
>> + .shift = 20,
>> + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
>> +};
>> +
>> +/*
>> + * Returns current time from boot in nsecs. It's OK for this to wrap
>> + * around for now, as it's just a relative time stamp.
>> + */
>> +unsigned long long sched_clock(void)
>> {
>> - int offset;
>> + return cyc2ns(&clocksource_ep93xx, ep93xx_get_cycles());

Here.

Regards,
Hartley


\
 
 \ /
  Last update: 2009-07-31 00:51    [W:0.071 / U:40.748 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site