public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] MIPS32 4Kc - Interrupt enable and base address for exceptions
@ 2011-01-18  9:21 Elad Yosef
  2011-01-18 13:30 ` Stefan Sommerfeld
  0 siblings, 1 reply; 3+ messages in thread
From: Elad Yosef @ 2011-01-18  9:21 UTC (permalink / raw)
  To: ecos-discuss

Hi,
MIPS32 4Kc has 2 base addresses for exceptions
bootstrap - 0xBFC00000
normal -     0x80000000

The selection of the base address is by BEV bit in the status register.

In the Boot stage it makes sense that the BEV will select the bootstrap.
but when the application is running from RAM i want it to use the
normal base (mapped to my RAM)

My RedBoot works fine, downloads the application by tftp to RAM and jumps to it.

My application init code is also running well, until the exit from
"cyg_user_start".

The eCos default - Is that point the scheduler goes to action and
interrupts are enabled.

At that point I see that my CPU still using the bootstrap base for
exceptions/interrupt.
which leads to unexpected results.

My question is- Is there some configuration option i need to select in
order to use the "normal" base?

In case there isn't such, At which point on the code should I set the
BEV in the status register?

Thanks

Elad

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] MIPS32 4Kc - Interrupt enable and base address for exceptions
  2011-01-18  9:21 [ECOS] MIPS32 4Kc - Interrupt enable and base address for exceptions Elad Yosef
@ 2011-01-18 13:30 ` Stefan Sommerfeld
  2011-01-18 13:38   ` Elad Yosef
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Sommerfeld @ 2011-01-18 13:30 UTC (permalink / raw)
  To: Elad Yosef; +Cc: ecos-discuss

Hi Elad,

> MIPS32 4Kc has 2 base addresses for exceptions
> bootstrap - 0xBFC00000
> normal -     0x80000000
> 
> The selection of the base address is by BEV bit in the status register.
> 
> In the Boot stage it makes sense that the BEV will select the bootstrap.
> but when the application is running from RAM i want it to use the
> normal base (mapped to my RAM)
> 
> My RedBoot works fine, downloads the application by tftp to RAM and jumps to it.
> 
> My application init code is also running well, until the exit from
> "cyg_user_start".
> 
> The eCos default - Is that point the scheduler goes to action and
> interrupts are enabled.
> 
> At that point I see that my CPU still using the bootstrap base for
> exceptions/interrupt.
> which leads to unexpected results.
> 
> My question is- Is there some configuration option i need to select in
> order to use the "normal" base?
> 
> In case there isn't such, At which point on the code should I set the
> BEV in the status register?
> 

I use normal vectors too. Here are the things you need to do:

- you need the code for the vectors at address 0, so copy the current code (from
your eCos to address 0x00000000)
- store DCache or invalidate it (depending on cached or uncached memory access)
- set BEV to normal base

You must make sure you don't use the first 1KB from memory, so you wont alter
you vectors code.

But think of what you're doing. This will not gain to much, because you can set
all interrupts to memory base routines without BEV. eCos will quickly jump to
the routine from the interrupt vectors table. You can also make your FLASH cachable.

Bye...

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] MIPS32 4Kc - Interrupt enable and base address for exceptions
  2011-01-18 13:30 ` Stefan Sommerfeld
@ 2011-01-18 13:38   ` Elad Yosef
  0 siblings, 0 replies; 3+ messages in thread
From: Elad Yosef @ 2011-01-18 13:38 UTC (permalink / raw)
  To: Stefan Sommerfeld; +Cc: ecos-discuss

Thanks
I was sure that the eCos code already clears the BEV in status register.

Once I clear it, it all works great.
I'll just add some code to clear BEV

Thanks again
Elad

On Tue, Jan 18, 2011 at 3:30 PM, Stefan Sommerfeld <sommerfeld@mikrom.de> wrote:
> Hi Elad,
>
>> MIPS32 4Kc has 2 base addresses for exceptions
>> bootstrap - 0xBFC00000
>> normal -     0x80000000
>>
>> The selection of the base address is by BEV bit in the status register.
>>
>> In the Boot stage it makes sense that the BEV will select the bootstrap.
>> but when the application is running from RAM i want it to use the
>> normal base (mapped to my RAM)
>>
>> My RedBoot works fine, downloads the application by tftp to RAM and jumps to it.
>>
>> My application init code is also running well, until the exit from
>> "cyg_user_start".
>>
>> The eCos default - Is that point the scheduler goes to action and
>> interrupts are enabled.
>>
>> At that point I see that my CPU still using the bootstrap base for
>> exceptions/interrupt.
>> which leads to unexpected results.
>>
>> My question is- Is there some configuration option i need to select in
>> order to use the "normal" base?
>>
>> In case there isn't such, At which point on the code should I set the
>> BEV in the status register?
>>
>
> I use normal vectors too. Here are the things you need to do:
>
> - you need the code for the vectors at address 0, so copy the current code (from
> your eCos to address 0x00000000)
> - store DCache or invalidate it (depending on cached or uncached memory access)
> - set BEV to normal base
>
> You must make sure you don't use the first 1KB from memory, so you wont alter
> you vectors code.
>
> But think of what you're doing. This will not gain to much, because you can set
> all interrupts to memory base routines without BEV. eCos will quickly jump to
> the routine from the interrupt vectors table. You can also make your FLASH cachable.
>
> Bye...
>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-18 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18  9:21 [ECOS] MIPS32 4Kc - Interrupt enable and base address for exceptions Elad Yosef
2011-01-18 13:30 ` Stefan Sommerfeld
2011-01-18 13:38   ` Elad Yosef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).