* [U-Boot-Users] question about interrupt
@ 2008-05-20 2:11 loody
2008-05-20 5:18 ` Chetan Nanda
0 siblings, 1 reply; 9+ messages in thread
From: loody @ 2008-05-20 2:11 UTC (permalink / raw)
To: u-boot
Dear all:
I have trace interrupt/Fiq vector in uboot based on smdk2410.
after we save user registers, we jump to following functions I
excerpted at the end of mail.
But these 2 functions seems not really handle the irq/fiq, would
someone please tell me where the real
interrupt handler is?
Is the interrupt handled in kernel?
if it really is, how loader pass the vector pointer to OS?
appreciate your help,
miloody
void do_fiq (struct pt_regs *pt_regs)
{
printf ("fast interrupt request\n");
show_regs (pt_regs);
bad_mode ();
}
void do_irq (struct pt_regs *pt_regs)
{
#if defined (CONFIG_USE_IRQ) && defined (CONFIG_ARCH_INTEGRATOR)
/* ASSUMED to be a timer interrupt */
/* Just clear it - count handled in */
/* integratorap.c */
*(volatile ulong *)(CFG_TIMERBASE + 0x0C) = 0;
#else
printf ("interrupt request\n");
show_regs (pt_regs);
bad_mode ();
#endif
}
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot-Users] question about interrupt 2008-05-20 2:11 [U-Boot-Users] question about interrupt loody @ 2008-05-20 5:18 ` Chetan Nanda 2008-05-20 5:53 ` loody 0 siblings, 1 reply; 9+ messages in thread From: Chetan Nanda @ 2008-05-20 5:18 UTC (permalink / raw) To: u-boot On Tue, May 20, 2008 at 7:41 AM, loody <miloody@gmail.com> wrote: > Dear all: > I have trace interrupt/Fiq vector in uboot based on smdk2410. > after we save user registers, we jump to following functions I > excerpted at the end of mail. > But these 2 functions seems not really handle the irq/fiq, would > someone please tell me where the real > interrupt handler is? > > Is the interrupt handled in kernel? > if it really is, how loader pass the vector pointer to OS? > appreciate your help, > miloody > > > void do_fiq (struct pt_regs *pt_regs) > { > printf ("fast interrupt request\n"); > show_regs (pt_regs); > bad_mode (); > } > > void do_irq (struct pt_regs *pt_regs) > { > #if defined (CONFIG_USE_IRQ) && defined (CONFIG_ARCH_INTEGRATOR) > /* ASSUMED to be a timer interrupt */ > /* Just clear it - count handled in */ > /* integratorap.c */ > *(volatile ulong *)(CFG_TIMERBASE + 0x0C) = 0; > #else > printf ("interrupt request\n"); > show_regs (pt_regs); > bad_mode (); > #endif > } > As far as i know, U-Boot do no support interrupts, and above functions are just the place holders. and also Interrupts for various devices are generally not enabled in u-boot code. > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > U-Boot-Users mailing list > U-Boot-Users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 5:18 ` Chetan Nanda @ 2008-05-20 5:53 ` loody 2008-05-20 8:36 ` Chetan Nanda 2008-05-20 8:36 ` Andreas Schweigstill 0 siblings, 2 replies; 9+ messages in thread From: loody @ 2008-05-20 5:53 UTC (permalink / raw) To: u-boot hi: thanks for your kind help. As far as I know, the cpu will set the PC to irq/fiq vector when the these exceptions are triggered. And these pointers are usually at the beginning position of bootloader, if bootloader wants to pass these functions to kernel, there may be some instructions like "b xxxxxx'. If uboot don't handle these exceptions, how the kernel knows these events? appreciate your kind help, miloody 2008/5/20 Chetan Nanda <chetannanda@gmail.com>: > On Tue, May 20, 2008 at 7:41 AM, loody <miloody@gmail.com> wrote: >> Dear all: >> I have trace interrupt/Fiq vector in uboot based on smdk2410. >> after we save user registers, we jump to following functions I >> excerpted at the end of mail. >> But these 2 functions seems not really handle the irq/fiq, would >> someone please tell me where the real >> interrupt handler is? >> >> Is the interrupt handled in kernel? >> if it really is, how loader pass the vector pointer to OS? >> appreciate your help, >> miloody >> >> >> void do_fiq (struct pt_regs *pt_regs) >> { >> printf ("fast interrupt request\n"); >> show_regs (pt_regs); >> bad_mode (); >> } >> >> void do_irq (struct pt_regs *pt_regs) >> { >> #if defined (CONFIG_USE_IRQ) && defined (CONFIG_ARCH_INTEGRATOR) >> /* ASSUMED to be a timer interrupt */ >> /* Just clear it - count handled in */ >> /* integratorap.c */ >> *(volatile ulong *)(CFG_TIMERBASE + 0x0C) = 0; >> #else >> printf ("interrupt request\n"); >> show_regs (pt_regs); >> bad_mode (); >> #endif >> } >> > As far as i know, U-Boot do no support interrupts, and above functions > are just the place holders. > and also Interrupts for various devices are generally not enabled in > u-boot code. > >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> U-Boot-Users mailing list >> U-Boot-Users at lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/u-boot-users >> > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 5:53 ` loody @ 2008-05-20 8:36 ` Chetan Nanda 2008-05-20 9:23 ` Wolfgang Denk 2008-05-20 8:36 ` Andreas Schweigstill 1 sibling, 1 reply; 9+ messages in thread From: Chetan Nanda @ 2008-05-20 8:36 UTC (permalink / raw) To: u-boot On Tue, May 20, 2008 at 11:23 AM, loody <miloody@gmail.com> wrote: > hi: > thanks for your kind help. > As far as I know, the cpu will set the PC to irq/fiq vector when the > these exceptions are triggered. And these pointers are usually at the > beginning position of bootloader, if bootloader wants to pass these > functions to kernel, there may be some instructions like "b xxxxxx'. > > If uboot don't handle these exceptions, how the kernel knows these events? > appreciate your kind help, > miloody > as i have mentioned, u-boot do not handle any interrupt, and neither it pass vector information to OS it going to boot. But OS that booted specify its own vector tables for handling the interrupts and exception. Anyone, correct me if i am at wrong path. > 2008/5/20 Chetan Nanda <chetannanda@gmail.com>: >> On Tue, May 20, 2008 at 7:41 AM, loody <miloody@gmail.com> wrote: >>> Dear all: >>> I have trace interrupt/Fiq vector in uboot based on smdk2410. >>> after we save user registers, we jump to following functions I >>> excerpted at the end of mail. >>> But these 2 functions seems not really handle the irq/fiq, would >>> someone please tell me where the real >>> interrupt handler is? >>> >>> Is the interrupt handled in kernel? >>> if it really is, how loader pass the vector pointer to OS? >>> appreciate your help, >>> miloody >>> >>> >>> void do_fiq (struct pt_regs *pt_regs) >>> { >>> printf ("fast interrupt request\n"); >>> show_regs (pt_regs); >>> bad_mode (); >>> } >>> >>> void do_irq (struct pt_regs *pt_regs) >>> { >>> #if defined (CONFIG_USE_IRQ) && defined (CONFIG_ARCH_INTEGRATOR) >>> /* ASSUMED to be a timer interrupt */ >>> /* Just clear it - count handled in */ >>> /* integratorap.c */ >>> *(volatile ulong *)(CFG_TIMERBASE + 0x0C) = 0; >>> #else >>> printf ("interrupt request\n"); >>> show_regs (pt_regs); >>> bad_mode (); >>> #endif >>> } >>> >> As far as i know, U-Boot do no support interrupts, and above functions >> are just the place holders. >> and also Interrupts for various devices are generally not enabled in >> u-boot code. >> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2008. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> _______________________________________________ >>> U-Boot-Users mailing list >>> U-Boot-Users at lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/u-boot-users >>> >> > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 8:36 ` Chetan Nanda @ 2008-05-20 9:23 ` Wolfgang Denk 2008-05-20 9:40 ` Chetan Nanda 0 siblings, 1 reply; 9+ messages in thread From: Wolfgang Denk @ 2008-05-20 9:23 UTC (permalink / raw) To: u-boot In message <7f245da80805200136y297e5309k110f1b193981ac16@mail.gmail.com> you wrote: > > as i have mentioned, u-boot do not handle any interrupt, and neither In this general form, the statement is wrong. Depending on architecture, U-Boot does implement and use interrupts. It even exports an interface to standalone applications which allows to register custom interrupt handlers. It's just just most U-Boot drivers do not use interrupts but polling mode - note that there are exceptions from this rule, too. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A modem is a baudy house. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 9:23 ` Wolfgang Denk @ 2008-05-20 9:40 ` Chetan Nanda 2008-05-20 12:31 ` Wolfgang Denk 0 siblings, 1 reply; 9+ messages in thread From: Chetan Nanda @ 2008-05-20 9:40 UTC (permalink / raw) To: u-boot On Tue, May 20, 2008 at 2:53 PM, Wolfgang Denk <wd@denx.de> wrote: > In message <7f245da80805200136y297e5309k110f1b193981ac16@mail.gmail.com> you wrote: >> >> as i have mentioned, u-boot do not handle any interrupt, and neither > > In this general form, the statement is wrong. > > Depending on architecture, U-Boot does implement and use interrupts. > It even exports an interface to standalone applications which allows > to register custom interrupt handlers. So if someone enable a interrupt and handled it properly then at the time of interrupt handler will be called, but how then control reaches back to u-boot original task that was running prior to interrupt delivery? I mean who is taking care of context switch at the time of interrupts? > > It's just just most U-Boot drivers do not use interrupts but polling > mode - note that there are exceptions from this rule, too. > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de > A modem is a baudy house. > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 9:40 ` Chetan Nanda @ 2008-05-20 12:31 ` Wolfgang Denk 0 siblings, 0 replies; 9+ messages in thread From: Wolfgang Denk @ 2008-05-20 12:31 UTC (permalink / raw) To: u-boot In message <7f245da80805200240o7dde7b3bl83875b910d69ad08@mail.gmail.com> you wrote: > > So if someone enable a interrupt and handled it properly then at the > time of interrupt handler will be called, but how then control reaches > back to u-boot original task that was running prior to interrupt That's just a normal return from interrupt, like you return from a normal function call. > delivery? I mean who is taking care of context switch at the time of > interrupts? There is no such thing as a context switch. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Anyone attempting to generate random numbers by deterministic means is, of course, living in a state of sin." - John Von Neumann ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 5:53 ` loody 2008-05-20 8:36 ` Chetan Nanda @ 2008-05-20 8:36 ` Andreas Schweigstill 2008-05-20 9:25 ` Wolfgang Denk 1 sibling, 1 reply; 9+ messages in thread From: Andreas Schweigstill @ 2008-05-20 8:36 UTC (permalink / raw) To: u-boot Hello! loody schrieb: > As far as I know, the cpu will set the PC to irq/fiq vector when the > these exceptions are triggered. And these pointers are usually at the > beginning position of bootloader, if bootloader wants to pass these > functions to kernel, there may be some instructions like "b xxxxxx'. > > If uboot don't handle these exceptions, how the kernel knows these events? Probably you are confusing a bootloader with something like a BIOS. When a Linux kernel starts it just copies some data (like information contained in ATAGS on ARM processors) and activates the MMU. U-Boot just works when the MMU is disabled because it uses physical addresses. Usually the interrupt handler code isn't used by *plain* U-Boot, and on many platforms it may be totally out-dated. The big advantage of this concept is that you can implement your own interrupt handler without fearing conflicts with other interrupt handler stuff, so the runtime behaviour of such a single interrupt handler can be much more predictable than in complex environments like Linux. And the answer to the next question which you probably have in mind is: No, the U-Boot process scheduler or realtime kernel also doesn't use interrupts because the is no kernel. Everything is based on a main loop. Yes, on implication is that U-Boot also won't respond to ARP/ICMP ECHO or similar network requests when it isn't running a network command like bootp, dhcp or ftp. And also timer handling is not interrupt driven but instead performed by polling some hardware timer registers. Regards Andreas Schweigstill -- Dipl.-Phys. Andreas Schweigstill Schweigstill IT | Embedded Systems Schauenburgerstra?e 116, D-24118 Kiel, Germany Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436 Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] question about interrupt 2008-05-20 8:36 ` Andreas Schweigstill @ 2008-05-20 9:25 ` Wolfgang Denk 0 siblings, 0 replies; 9+ messages in thread From: Wolfgang Denk @ 2008-05-20 9:25 UTC (permalink / raw) To: u-boot In message <48328D89.9050708@schweigstill.de> you wrote: > > No, the U-Boot process scheduler or realtime kernel also doesn't use > interrupts because the is no kernel. Everything is based on a main loop. Actually U-Boot has neither a concept of processes or tasks or scheduling or whatever. U-Boot is strictly single-tasking. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Wherever you go...There you are. - Buckaroo Banzai ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-05-20 12:31 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-05-20 2:11 [U-Boot-Users] question about interrupt loody 2008-05-20 5:18 ` Chetan Nanda 2008-05-20 5:53 ` loody 2008-05-20 8:36 ` Chetan Nanda 2008-05-20 9:23 ` Wolfgang Denk 2008-05-20 9:40 ` Chetan Nanda 2008-05-20 12:31 ` Wolfgang Denk 2008-05-20 8:36 ` Andreas Schweigstill 2008-05-20 9:25 ` Wolfgang Denk
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.