[ECOS] Redboot and tumb instructions
Thu Apr 14 13:24:00 GMT 2005
On Thu, 2005-04-14 at 18:04 +1200, firstname.lastname@example.org wrote:
> Hi People,
> I'm porting redboot to my board (based on ARM AT91FR40162 like EB40A). I have
> succeed in installing a feature cut down version onto the board.
> The full version gives me:
> Error: bad instruction `mrc p15,0,r3,c0,c0,0'
> when compiling hal/arm/arch/current/src/arm_stub.c
> The section in arm_stub.c at issue is:
> // return non-zero for v5 and later
> static int
> unsigned id;
> asm volatile ("mrc p15,0,%0,c0,c0,0\n"
> : "=r" (id) : /* no inputs */);
> return ((id >> 16) & 0xff) >= 5;
> A work-around is to not use ARM thumb interworking. This is ok but are we able to
> use thumb (which should result in smaller code) with redboot?
The mrc insn is not available to thumb. I think the easiest way around
this would be to move v5T_semantics() to vectors.S where you can force
it to be an arm function callable by thumb-interworking code. Or, the
startup code can read the register once and store the value in a
variable that the thumb code can get to later.
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss