public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Lars Povlsen <lpovlsen@vitesse.com>
Cc: eCos Disuss <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Thumb support for arm9 variants?
Date: Mon, 12 Jun 2006 21:39:00 -0000	[thread overview]
Message-ID: <20060612213912.GA3347@lunn.ch> (raw)
In-Reply-To: <4635C7499BD3A14C9361477F0613ED9BB86D10@mx-dk1.vsc.vitesse.com>

On Mon, Jun 12, 2006 at 11:12:09PM +0200, Lars Povlsen wrote:
> 
> Andrew,
> 
> The offending instructions are indeed inline assembly - its both the
> cache manip and reset:
> 
> void
> cyg_hal_arm9_soft_reset(CYG_ADDRESS entry)
> {
> 
>     /* It would probably make more sense to have the
>        clear/drain/invalidate after disabling the cache and MMU, but
>        then we'd have to know the (unmapped) address of this code. */
>     asm volatile ("mrs r1,cpsr;"
>                   "bic r1,r1,#0x1F;"  /* Put processor in SVC mode */
>                   "orr r1,r1,#0x13;"
>                   "msr cpsr,r1;"
> 
>                   "mov r1, #0;"
>                   "mcr p15,0,r1,c7,c7,0;"  /* clear I+DCache */
>                   "mcr p15,0,r1,c7,c10,4;" /* Drain Write Buffer */
>                   "mcr p15,0,r1,c8,c7,0;"  /* Invalidate TLBs */
>                   "mrc p15,0,r1,c1,c0,0;"
>                   "bic r1,r1,#0x1000;"     /* disable ICache */
>                   "bic r1,r1,#0x0007;"     /* disable DCache, MMU and
> alignment faults */
>                   "mcr p15,0,r1,c1,c0,0;"
>                   "nop;"                   /* delay 1 */
>                   "mov pc, %0;"            /* delay 2  - next
> instruction should be fetched flat */
>                   : : "r" (entry) : "r1");
>     for(;;);
> }
> 
> As this is none of my code (!) - my question is more along the lines as
> why the hal/arm/arm9/* variants does not support thumb - when the arm/*
> variants do? I was under the impression that the former was the most
> recent?

Most recent, but probably less used in deeply embedded systems than
arm7. Also, arm9 systems tend to be big systems with lots of RAM, so
the more compact thumb is not normally called for.

If you want to use thumb on the arm9 it looks like you are going to
have to do a little work first. Either provide thumb implementation of
this inline assembly, or add mode switch code to change to ARM mode
before and back to thumb afterwards.

       Andrew

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

  reply	other threads:[~2006-06-12 21:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 21:12 Lars Povlsen
2006-06-12 21:39 ` Andrew Lunn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-12 20:03 Lars Povlsen
2006-06-12 20:56 ` Andrew Lunn

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=20060612213912.GA3347@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=lpovlsen@vitesse.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).