Re: [PATCH 08/56] microblaze_v2: Interrupt handling, timer support,supported function

From: Michal Simek
Date: Sun May 11 2008 - 17:54:49 EST


Hi Thomas,

> Michal,
>
> On Sun, 11 May 2008, Michal Simek wrote:
>>> Please split this modification code out into a separate function. The
>>> same code is used below.
>> Add Macro.
>
> Please use a (inline) function whenever possible. Macros are harder to
> read and not type safe.

I'll try it.

>>> Can you please move a new architecture to clockevents / clocksource
>>> right from the beginning ? No need to invent another incompatible set
>>> of time(r) related functions.
>> I move whole code to GENERIC_TIME. Did you meant any others changes?
>
> GENERIC_TIME and GENERIC_CLOCKEVENTS. You get high resolution timers
> and dynamic ticks for free when your timer hardware allows it.

About CLOCKEVENTS. I looked at arm/mach-versatile/

and I found I need implement:
loading current timer value - clocksource.read

clock_event_device.set_mode - set one from fourth modes
clock_event_device.set_next_event - the same mode with new init timer value
(this is little bit mess for me because arm do this that only change actual
counting value - I hope I do that too).

Supported modes are:
CLOCK_EVT_MODE_PERIODIC - reload and timer interrupt
CLOCK_EVT_MODE_ONESHOT - one interrupt at zero value and end - no others interrupts.
CLOCK_EVT_MODE_UNUSED: What is it?
CLOCK_EVT_MODE_SHUTDOWN: What is it?
CLOCK_EVT_MODE_RESUME: What is it?


I hope I can use only one timer(adding extra timers is not problem).
We have one timer with two timebase (that's one option in IP core).

And there is necessary to fill some value in timer initializing
timer0_clockevent.mult - nanosecond to cycles multiplier ?
timer0_clockevent.shift - nanoseconds to cycles divisor (power of two)?
timer0_clockevent.irq - irq from our intc.
timer0_clockevent.min_delta_ns - minimal timer resolution (I think this value
have to be sensible for system)
timer0_clockevent.max_delta_ns - maximal timer resolution
timer0_clockevent.cpumask = 0 for 1 cpu

I hope others is set by general code.

and change handler function to calling evt->enent_handler;

I found that archs use sys for showing values.

I hope I can see that this systems works via /proc/interrupts and from sysfs.

Am I right?

Thanks,
Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/