public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Redboot from ROM and Virtual Vectors.
@ 2002-04-03 10:55 Fabrice Gautier
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Gautier @ 2002-04-03 10:55 UTC (permalink / raw)
  To: 'Grant Edwards'; +Cc: Ecos-List (E-mail)


> -----Original Message-----
> From: Grant Edwards [mailto:grante@visi.com]
> Sent: Tuesday, April 02, 2002 9:17 PM
> Subject: Re: [ECOS] Redboot from ROM and Virtual Vectors.
> 
> 
> I found that re-mapping memory, though requiring a bit of 
> tricky assembly language, made life much easier.


I also think that remapping is the way to go, however on my platform the
remapping works a bit differently than other ARM platform i have seen.

On my case, ROM goes from 0 to 0x400000 and an 8k SRAM starts at 0x400000. 
After remaping i get the SRAM at 0 and the first 8k of ram are remapped at
0x400000.

The vectors in SRAM are initialized by copying the vectors in ROM at zero.
In most case the ROM doesnt start at zero (but is remmaped to 0 at startup)
so that ROM vectors always stays at the same adress in ROM.

For now my workaround is to add some target specific code in vectors.S.
Basically each time there is a 
	ldr r1, =__exception_vectors
I add
#ifdef MY_TARGET
	add r1, #0x400000
#endif

I have tried to play with the Memory layout so that it dont have to do that
but so far it doesnt seems possible.

-- 
Fabrice Gautier, 
Fabrice_Gautier@sdesigns.com

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

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

* Re: [ECOS] Redboot from ROM and Virtual Vectors.
  2002-04-02 17:29 Fabrice Gautier
@ 2002-04-02 21:17 ` Grant Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2002-04-02 21:17 UTC (permalink / raw)
  To: Fabrice Gautier; +Cc: Ecos-List (E-mail)

On Tue, Apr 02, 2002 at 05:42:49PM -0800, Fabrice Gautier wrote:

> When using Redboot, it seems that, at least on ARM, the VV table is
> initialized at run time.
> That means that the virtual vector cant reside in ROM. However the VV table
> is located in the .vector section which contains also the hardware vectors
> which are initialized in ROM (at compile time)

At one point a few years back, I messed with the ARM architecture HAL code
so that I could have the .vectors in ROM.  It was a pain, and required me to
maintain non-standard ARM/arch startup code. Then the guy who wanted the
vectors in ROM quit, so I added startup code that remaps memory to place RAM
at address 0 (where the interrupt vectors go).

As an aside, I put my VV table somewhere else entirely.  Interrupt vectors
are at the bottom of RAM (address 0x00000000).  On my board, RedBoot lives
at the top of RAM, and that's where my VV table is.

> Is there any target that has the virtual vectors hardcoded in ROM, or should
> they absolutely be located in RAM.

You're going to loose a lot of functionality if they're in ROM, but I
suppose you could get it to work that way.

> And can the hardware vectors on ARM reside in ROM forever or should they be
> placed in RAM at some point? (I think the other ARM targets have a remap
> function to chose wether the hard vectors are in RAM or ROM)

If you hack up the ARM startup code, you can get things to work with
interrupt vectors in ROM: you have to vector them through a secondary vector
table that's in RAM, so it adds complexity and slows things down.  It's
especially painful if that secondary table is too far away for a direct jump.

I found that re-mapping memory, though requiring a bit of tricky assembly
language, made life much easier.

-- 
Grant Edwards
grante@visi.com

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

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

* [ECOS] Redboot from ROM and Virtual Vectors.
@ 2002-04-02 17:29 Fabrice Gautier
  2002-04-02 21:17 ` Grant Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Gautier @ 2002-04-02 17:29 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

When using Redboot, it seems that, at least on ARM, the VV table is
initialized at run time.
That means that the virtual vector cant reside in ROM. However the VV table
is located in the .vector section which contains also the hardware vectors
which are initialized in ROM (at compile time)

Is there any target that has the virtual vectors hardcoded in ROM, or should
they absolutely be located in RAM.
And can the hardware vectors on ARM reside in ROM forever or should they be
placed in RAM at some point ? (I think the other ARM targets have a remap
function to chose wether the hard vectors are in RAM or ROM)

Thanks
-- 
Fabrice Gautier, 
Fabrice_Gautier@sdesigns.com

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

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

end of thread, other threads:[~2002-04-03 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03 10:55 [ECOS] Redboot from ROM and Virtual Vectors Fabrice Gautier
  -- strict thread matches above, loose matches on Subject: below --
2002-04-02 17:29 Fabrice Gautier
2002-04-02 21:17 ` Grant Edwards

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).