summaryrefslogtreecommitdiff
path: root/cpu/mpc512x
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2010-02-06 17:20:09 +0900
committerMinkyu Kang <mk7.kang@samsung.com>2010-02-06 17:20:09 +0900
commitbdaef38171c9ea030bae46b798aba4f430dcac18 (patch)
tree4da072aceaa42e7ff3ec9962f5d99a9ca667ace9 /cpu/mpc512x
parented44387f406ca0e695609270a1282e699111a945 (diff)
parentc20a3c0bac909a0a1311eaafdec156b6a8686d46 (diff)
downloadu-boot-imx-bdaef38171c9ea030bae46b798aba4f430dcac18.zip
u-boot-imx-bdaef38171c9ea030bae46b798aba4f430dcac18.tar.gz
u-boot-imx-bdaef38171c9ea030bae46b798aba4f430dcac18.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Conflicts: cpu/arm_cortexa8/s5pc1xx/cache.c include/configs/spear6xx.h lib_ppc/reloc.S Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'cpu/mpc512x')
-rw-r--r--cpu/mpc512x/config.mk2
-rw-r--r--cpu/mpc512x/cpu.c5
-rw-r--r--cpu/mpc512x/start.S46
3 files changed, 13 insertions, 40 deletions
diff --git a/cpu/mpc512x/config.mk b/cpu/mpc512x/config.mk
index 6ab34b1..fb0a563 100644
--- a/cpu/mpc512x/config.mk
+++ b/cpu/mpc512x/config.mk
@@ -19,7 +19,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
-PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi
+PLATFORM_RELFLAGS += -fPIC -meabi
PLATFORM_CPPFLAGS += -DCONFIG_MPC512X -DCONFIG_E300 \
-ffixed-r2 -msoft-float -mcpu=603e
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index f96a4c8..09cbd20 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -66,9 +66,10 @@ int checkcpu (void)
default:
puts ("unknown ");
}
- printf ("at %s MHz, CSB at %s MHz\n",
+ printf ("at %s MHz, CSB at %s MHz (RSR=0x%04lx)\n",
strmhz(buf1, clock),
- strmhz(buf2, gd->csb_clk) );
+ strmhz(buf2, gd->csb_clk),
+ gd->reset_status & 0xffff);
return 0;
}
diff --git a/cpu/mpc512x/start.S b/cpu/mpc512x/start.S
index 4edc8e9..d26b617 100644
--- a/cpu/mpc512x/start.S
+++ b/cpu/mpc512x/start.S
@@ -65,7 +65,7 @@
/*
* Set up GOT: Global Offset Table
*
- * Use r14 to access the GOT
+ * Use r12 to access the GOT
*/
START_GOT
GOT_ENTRY(_GOT2_TABLE_)
@@ -127,30 +127,15 @@ Alignment:
mfspr r5,DSISR
stw r5,_DSISR(r21)
addi r3,r1,STACK_FRAME_OVERHEAD
- li r20,MSR_KERNEL
- rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */
- rlwimi r20,r23,0,25,25 /* copy IP bit from saved MSR */
- lwz r6,GOT(transfer_to_handler)
- mtlr r6
- blrl
-.L_Alignment:
- .long AlignmentException - _start + EXC_OFF_SYS_RESET
- .long int_return - _start + EXC_OFF_SYS_RESET
+ EXC_XFER_TEMPLATE(Alignment, AlignmentException, MSR_KERNEL, COPY_EE)
/* Program check exception */
. = 0x700
ProgramCheck:
EXCEPTION_PROLOG(SRR0, SRR1)
addi r3,r1,STACK_FRAME_OVERHEAD
- li r20,MSR_KERNEL
- rlwimi r20,r23,0,16,16 /* copy EE bit from saved MSR */
- rlwimi r20,r23,0,25,25 /* copy IP bit from saved MSR */
- lwz r6,GOT(transfer_to_handler)
- mtlr r6
- blrl
-.L_ProgramCheck:
- .long ProgramCheckException - _start + EXC_OFF_SYS_RESET
- .long int_return - _start + EXC_OFF_SYS_RESET
+ EXC_XFER_TEMPLATE(ProgramCheck, ProgramCheckException,
+ MSR_KERNEL, COPY_EE)
/* Floating Point Unit unavailable exception */
STD_EXCEPTION(0x800, FPUnavailable, UnknownException)
@@ -501,6 +486,7 @@ relocate_code:
mr r9, r4 /* Save copy of Global Data pointer */
mr r10, r5 /* Save copy of Destination Address */
+ GET_GOT
mr r3, r5 /* Destination Address */
lis r4, CONFIG_SYS_MONITOR_BASE@h /* Source Address */
ori r4, r4, CONFIG_SYS_MONITOR_BASE@l
@@ -519,7 +505,7 @@ relocate_code:
sub r15, r10, r4
/* First our own GOT */
- add r14, r14, r15
+ add r12, r12, r15
/* then the one used by the C code */
add r30, r30, r15
@@ -599,7 +585,7 @@ relocate_code:
in_ram:
/*
- * Relocation Function, r14 point to got2+0x8000
+ * Relocation Function, r12 point to got2+0x8000
*
* Adjust got2 pointers, no need to check for 0, this code
* already puts a few entries in the table.
@@ -663,6 +649,8 @@ clear_bss:
*/
.globl trap_init
trap_init:
+ mflr r4 /* save link register */
+ GET_GOT
lwz r7, GOT(_start)
lwz r8, GOT(_end_of_vectors)
@@ -670,8 +658,6 @@ trap_init:
cmplw 0, r7, r8
bgelr /* return if r7>=r8 - just in case */
-
- mflr r4 /* save link register */
1:
lwz r0, 0(r7)
stw r0, 0(r9)
@@ -723,17 +709,3 @@ trap_init:
mtlr r4 /* restore link register */
blr
-
- /*
- * Function: relocate entries for one exception vector
- */
-trap_reloc:
- lwz r0, 0(r7) /* hdlr ... */
- add r0, r0, r3 /* ... += dest_addr */
- stw r0, 0(r7)
-
- lwz r0, 4(r7) /* int_return ... */
- add r0, r0, r3 /* ... += dest_addr */
- stw r0, 4(r7)
-
- blr