2006-10-14 20:02:41 Question about bfin_simple_timer.
Eduardo Bonilla (MEXICO)
Message: 14895 Hello everybody,
I am trying to create a code to generate a clock signal 50% duty with the timer0 with a frequency close to 12MHz.
I have seen in the CVS source a driver for bfin_simple_timer, and I am trying to compile it. For BF537-STAMP
But I get the following error, when I enable the configuration to include the driver on the image:
drivers/char/bfin_simple_timer.c:70: error: `IRQ_TIMER0' undeclared here (not in a function)
make: *** [drivers/char/bfin_simple_timer.o] Error 1
make: *** [drivers/char] Error 2
make: *** [drivers] Error 2
make: Leaving directory .../blackfin-cvs/uclinux533/uClinux-dist/linux-2.6.x'
make: *** [linux] Error 1
Does anybode has used this simple_timer driver for BF537? Is it still on development or it is a problem with my configuration?
I have seen the assignment for this value in
./linux-2.6.x/include/asm-blackfin/mach-bf561/irq.h:196:#define IRQ_TIMER0 (IVG_BASE + 35) /* TIMER 0 Interrupt */
But there is no assignation for bf537.
So I believe I need to modify the IRQ_TIMER0 assignment in the mach-bf537/irq.h file.
Am I in the correct aproach?
Will it be possible to generate this clock signal using this driver?
Can anyone help me or show me where can I find an expample of an implementation with this driver?
I will really apreciate some help.
2006-10-15 12:06:39 RE: Question about bfin_simple_timer.
Axel Weiss (GERMANY)
Message: 14905 Eduardo:
> I have seen the assignment for this value in
> #define IRQ_TIMER0 (IVG_BASE + 35) /* TIMER 0 Interrupt */
> But there is no assignation for bf537.
> So I believe I need to modify the IRQ_TIMER0 assignment in the mach-bf537/irq.h file.
> Am I in the correct aproach?
Yes, you are. IRQ_TIMER0 represents the irq-number of the first timer (BF537 has eight of them). They seem to be missing.
> Will it be possible to generate this clock signal using this driver?
Yes, in principle, but you'll need some modification. bfin_simple_timer is meant as a simple example code to demonstrate the use of the bf5xx_timers backend. It is simple in
- not having any signal output
- only producing expire count information.
Maybe you want to write your own little driver, using bfin_simple_timer as the starting point. You'll need to additionally configure the right pflag and modify the settings in the gptimers_config register (line 144, bfin_simple_timer.c) to enable signal output via pflags (remove the OUT_DIS from config register). If you only want to generate some external clock signal, you could remove the procfs-code, and maybe the ioctl-code, too. And, finally, you should remove the isr-code, if you don't need interrupts every clock cycle (remove the request_irq/free_irq calls, IRQ_ENA from timer-config register and the whole timer_isr function).
Please also refer to hrm, especially on how to use pflags output with gptimers.
2006-10-16 16:05:15 RE: Question about bfin_simple_timer.
Michael Hennerich (GERMANY)
Message: 15012 Hi Eduardo,
the driver needs some bug fixes when used with BF537/BF533. I will fix it and implement PWM output mode - maybe tomorrow.