public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Hugo Tyson <hmt@cygnus.co.uk>
To: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] ARM vectors.S question
Date: Wed, 27 Oct 1999 04:00:00 -0000	[thread overview]
Message-ID: <pthfjdw054.fsf@masala.cygnus.co.uk> (raw)
In-Reply-To: <19991026204215.B27067@visi.com>


Grant Edwards <grante@visi.com> writes:
> On Tue, Oct 26, 1999 at 04:12:25PM -0600, Gary Thomas wrote:
> > > Am I missing something?
> > 
> > Not at all.  To date, we have assumed that the environment on ARM platforms
> > will have RAM at zero.  This is the most flexible and easiest setup for us.
> 
> I can see that it would be easiest, but I don't see how you can build
> a useful system with RAM at zero.  Since the reset vector is at 0,
> that location has to be non-volatile memory or the system will start
> up by jumping to a location dependant on the power-up state of the
> RAM.  Some types of RAM ahve a pretty consistent state at power-up,
> but I don't think anybody ever depends on that trait. ;)

Correct; what the designers intended, and what ARM systems generally do is:

At hard reset, ROM is mapped at zero and also at 0xe0000000 or whatever its
"real" address is.  (Implementation may be brutal: for example, A16-A31
ignored, so you have to fit this boot code in only 64k - not so tough...)

During bootup, the code running in low memory jumps to addresses in high
memory, so it is executing out of ROM at its "real" address.
(This is easy: you can even do something like:
	orr pc,pc,#0xe0000000; nop; nop; nop; nop; nop
and you'll be OK; ARMs are like that!)

That code then performs some action to cause RAM to be at zero instead, and
copies appropriate jump code into the RAM vectors to allow the system to
take traps.  "Some action" might involve the MMU or an explicit hardware
control register poke, or with some support chips, the first ever external
write op does this automagically.


The jump to lightspeed^W "real" ROM addresses is achieved in the ARM
vectors.S *either* by means of the indirect jump in the reset vector being
a "true" ROM address (eg. ebsa285, CYGHWR_HAL_ARM_HAS_MMU is not defined)
or by special code in PLATFORM_SETUP1, which is defined in the
hal_platform_setup.h file for the appropriate platform HAL (eg. cl7211).


> > However, as you note, there are some platforms that are not laid out
> > this way.
> 
> Perhaps my prejudices from doing 15 years of embedded systems are
> showing, but I don't see how any system could be laid out this way.
> Perhaps I don't understand how the power-up reset works in the CPU?

See above.  Making the ROM code use RAM vectors for all traps except reset
is another way to go.  But this loses you the intended advantage of being
able to place extensive FIQ handling code at 0x1c *in RAM* - not that eCos
supports this, we place address-type vectors just after the
instruction-type vectors as it happens.

> > Does your hardware have a MMU or some other way to alter the memory
> > layout?
> 
> Yes, there's programmable chip-select logic that can be modified by
> software.

That fits nicely with the model, then, so long as you can wire it so that
ROM is at 0 after reset, where-ever else it was before.
 
> The third option is to run from ROM, in which case the vectors are there
> at power up, and don't need to be initialized by the startup code.

Yup.

HTH,
	- Huge

  reply	other threads:[~1999-10-27  4:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-26 13:44 Grant Edwards
1999-10-26 15:05 ` Gary Thomas
1999-10-26 18:42   ` Grant Edwards
1999-10-27  4:00     ` Hugo Tyson [this message]
1999-10-27  5:14     ` Gary Thomas
1999-10-27  7:01       ` Grant Edwards
1999-10-27  7:09         ` Gary Thomas
1999-10-27  1:04 ` Dan Hovang
2013-10-12 14:54 [ECOS] ARM Vectors.S Question Michael Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pthfjdw054.fsf@masala.cygnus.co.uk \
    --to=hmt@cygnus.co.uk \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).