Skip to contentSkip to conversation

How to add Timer Interrupt to u-boot?

U-Boot-Users Robert 3 participants 3 messages Jul 27, 2007 – Jul 30, 2007

lore
Share & tools
lore

Robert

author
#0 lore raw

Hello all:

Everybody knows how to add Timer Interrupt to the u-boot?
I wrote a fuction called timer0_isr(), and wanted to add it to Uboot, but I didn't know what to do, Does the uboot has a funciton like function request_irq() in linux kernel?
Thanks in advance!

With kind regards,

Robert Xia

#1 lore raw
Quoted 11 lines · Robert

Hello all:

Everybody knows how to add Timer Interrupt to the u-boot?
I wrote a fuction called timer0_isr(), and wanted to add it to Uboot, but I didn't know what to do, Does the uboot has a funciton like function request_irq() in linux kernel?
Thanks in advance!

With kind regards,

Robert Xia

Hi Robert,

Interrupts are not used by u-boot (with some rare exceptions). Generally things poll and there is usually some type of counter register (processor or board-specific) for measuring elapsed time.

If you really need interrupts, you will probably have to set up the vectors, interrupt registers, etc. yourself.

Best regards,
gvb

#2 lore raw
In reply to Robert

Hi Robert,

Quoted 4 lines

Everybody knows how to add Timer Interrupt to the u-boot?
I wrote a fuction called timer0_isr(), and wanted to add it to Uboot, but I didn't know what to do, Does the uboot has a funciton like function request_irq() in linux kernel?

As Jerry told you, U-Boot generally avoids using interrupts.

For some architectures however we have code to allow using interrupts, e.g. from standalone applications. You can look at examples/interrupt.c which effectively was written with cpu/mpc5xxx/interrupts.c in mind. The latter was of course derived from the Linux version so it shouldn't be a big problem to do something similar for other architectures.

Cheers
Detlev

Signature · 9 lines
Once the  implementation is  up and running,  it is still a trick to keep it
running.  In a normal,  closed implementation,  this is not a problem;  in a
system with metaobject protocols [..] there is the potential for spectacular
failure modes if certain situations are not properly anticipated.
                                       -- The Art of the Metaobject Protocol
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de