This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Interupts and redboot


>>>>> Joshua Boyd writes:

> It looks to me like Redboot turns on interupts before it hads off to the
> ecos application.  It appears to be doing this in the call to
> HAL_THREAD_SWITCH_CONTEXT in main.c.

HAL_THREAD_SWITCH_CONTEXT in main.c:do_go() sends the $pc to
main.c:trampoline() where it calls HAL_DISABLE_INTERRUPTS
before jumping to the actual application code.

The only problem I have seen with this is due to a specific
RedBoot port not initializing the interrupt controller properly
so some spurious interrupt occurs during the jump to the
trampoline code. 


  I know for sure it is doing it on
> our SH3 board, and from reading the source code, it appears to do the
> same on the arm platform.  Am I misreading something here, or is redboot
> really intending to do this, and if so why?  I thought bootloaders were
> usually supposed to leave interupts off when handing off to the
> application they were loading.

> I fixed my platform by changing (_regs_)->sr = 0; to (_regs_)->sr =
> 0x000000F0; on line 104 of the sh3 hal_var_bank.h file, and now my
> application starts up fine, even while interupts are being fired doing
> startup. 

You really don't want to mess with the HAL_THREAD_SWITCH_CONTEXT like
that. I suspect you need to add some boot-time init code that turns
off the hardware that is asserting the irq[s].

--Mark



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]