* Get (mostly) rid of CFG_MONITOR_LEN definition; compute real length
[oweals/u-boot.git] / cpu / mpc5xx / start.S
index d17fe92720d829c5d07b3a942a8b681eb3516454..4d7c71644f0fc10851f27ad34246d967935cfaae 100644 (file)
@@ -66,8 +66,9 @@
        GOT_ENTRY(_end_of_vectors)
        GOT_ENTRY(transfer_to_handler)
 
+       GOT_ENTRY(__init_end)
        GOT_ENTRY(_end)
-       GOT_ENTRY(.bss)
+       GOT_ENTRY(__bss_start)
        END_GOT
 
 /*
@@ -432,8 +433,8 @@ relocate_code:
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CFG_MONITOR_BASE@h          /* Source      Address  */
        ori     r4, r4, CFG_MONITOR_BASE@l
-       lis     r5, CFG_MONITOR_LEN@h           /* Length in Bytes      */
-       ori     r5, r5, CFG_MONITOR_LEN@l
+       lwz     r5, GOT(__init_end)
+       sub     r5, r5, r4
 
        /*
         * Fix GOT pointer:
@@ -527,7 +528,7 @@ clear_bss:
        /*
         * Now clear BSS segment
         */
-       lwz     r3,GOT(.bss)
+       lwz     r3,GOT(__bss_start)
        lwz     r4,GOT(_end)
        cmplw   0, r3, r4
        beq     6f
@@ -544,12 +545,6 @@ clear_bss:
        mr      r4, r10         /* Destination Address          */
        bl      board_init_r
 
-       /* Problems accessing "end" in C, so do it here */
-       .globl  get_endaddr
-get_endaddr:
-       lwz     r3,GOT(_end)
-       blr
-
        /*
         * Copy exception vector code to low memory
         *