test aux key pressed

Werner Almesberger werner at openmoko.org
Wed Aug 27 19:50:33 CEST 2008

xiangfu wrote:
> if i hold AUX first the gta02 always goto NOR uboot.

AUX is a bit tricky on GTA02. What it does is that it changes what
the CPU sees at address 0. If AUX is not pressed, it sees the
SteppingStone RAM. If AUX is pressed, it sees the NOR.

Interestingly, AUX does not only change the content at address 0
at reset time, but also anytime later.

So this means if AUX changes while code is still running from NOR
or from SteppingStone, the result is unpredictable.

There are two times when qi may run code from SteppingStone: before
it has relocated itself, and when executing an exception, e.g., an

I don't think qi currently uses interrupts, but if you run into the
problem with the exception vectors, here is a work-around for it:

Some ARM cores, including our 920T, can remap addresses at 0x00xxxxxx
to a different location without even using the MMU. This is
accomplished by writing that address to MMU register 13. E.g.,

	mov r0, #0x30000000
	mcr p15, 0, r0, c13, c0

maps 0x00xxxxxx to 0x30xxxxxx. You can undo this mapping with

	mov r0, #0
	mcr p15, 0, r0, c13, c0

Note that you also have to make sure there are valid vectors at the
new location, i.e., that they have been copied when relocating.

There's also a brief description of that mechanism in

Qi is still vulnerable until it has relocated itself, and there's
no protection against this. So AUX should not be pressed within
the first ~100ms after reset.

- Werner

More information about the openmoko-kernel mailing list