]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
nios2: fix out of reach case for do_reset
authorThomas Chou <thomas@wytron.com.tw>
Mon, 16 Aug 2010 02:49:44 +0000 (10:49 +0800)
committerScott McNutt <smcnutt@psyent.com>
Fri, 20 Aug 2010 02:15:49 +0000 (22:15 -0400)
commit7a6a7d10e6b96ab4a5c0d8852802ec52be2b582e
treef8aad9ce824371f69022db5aedacd0f11477345d
parent62a05573822fc253a1ad5037482511347d6abaa5
nios2: fix out of reach case for do_reset

There is a limitation (or bug?) of nios2 toolchain. The nios2 gcc
didn't generate correct code when the reset vector is passed as a
constant. It just generated a direct "call", which was wrong when
the reset vector was not located in the same 256MB span as u-boot.

The "Nios II Processor Reference Handbook" said,
"call can transfer execution anywhere within the 256 MByte range
determined by PC31..28. The Nios II GNU linker does not automatically
handle cases in which the address is out of this range."

So we have to use registered "callr" instruction to do the job.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
arch/nios2/cpu/cpu.c
arch/nios2/include/asm/system.h