This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / ppc / boot / simple / misc-mv64x60.S
1 /*
2  * arch/ppc/boot/simple/misc-mv64x60.S
3  * 
4  * Code to change the base address of the host bridges and call board specific
5  * init routine.
6  *
7  * Author: Mark Greer <mgreer@mvista.com>
8  *
9  * 2002 (c) MontaVista, Software, Inc.  This file is licensed under the terms
10  * of the GNU General Public License version 2.  This program is licensed
11  * "as is" without any warranty of any kind, whether express or implied.
12  */
13
14 #include <linux/config.h>
15 #include <asm/ppc_asm.h>
16 #include <asm/processor.h>
17 #include <asm/cache.h>
18 #include <asm/mv64x60_defs.h>
19
20         .globl  mv64x60_init
21 mv64x60_init:
22         mflr    r27
23
24 #if (CONFIG_MV64X60_NEW_BASE != CONFIG_MV64X60_BASE)
25         bl      move_base
26 #endif
27         bl      mv64x60_board_init
28
29         mtlr    r27
30         blr
31
32 #if (CONFIG_MV64X60_NEW_BASE != CONFIG_MV64X60_BASE)
33 move_base:
34         li      r20,0
35         li      r23,20
36
37         /* Relocate bridge's regs */
38         addis   r25,0,CONFIG_MV64X60_BASE@h
39         ori     r25,r25,MV64x60_INTERNAL_SPACE_DECODE             
40         lwbrx   r26,0,(r25)
41         lis     r24,0xffff
42         and     r26,r26,r24
43         addis   r24,0,CONFIG_MV64X60_NEW_BASE@h
44         srw     r24,r24,r23
45         or      r26,r26,r24
46         stwbrx  r26,0,(r25)
47         sync
48
49         /* Wait for write to take effect */
50         addis   r25,0,CONFIG_MV64X60_NEW_BASE@h
51         ori     r25,r25,MV64x60_INTERNAL_SPACE_DECODE
52 1:      lwbrx   r24,0,(r25)
53         cmpw    r24,r26
54         bne     1b
55
56         blr
57 #endif