ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / boot / simple / misc-ev64260.S
1 /*
2  * arch/ppc/boot/simple/misc-ev64260.S
3  *
4  * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board
5  * with a GT64260 onboard.
6  *
7  * Author: Mark Greer <mgreer@mvista.com>
8  *
9  * 2001 (c) MontaVista, Software, Inc.  This file is licensed under
10  * the terms of the GNU General Public License version 2.  This program
11  * is licensed "as is" without any warranty of any kind, whether express
12  * or implied.
13  */
14
15 #include <asm/ppc_asm.h>
16 #include <asm/cache.h>
17 #include <asm/gt64260_defs.h>
18
19 #include <platforms/ev64260.h>
20
21         .globl  ev64260_init
22 ev64260_init:
23         li      r20,0
24         li      r23,20
25
26         /* Relocate galileo's regs */
27         addis   r25,0,GT64260_INTERNAL_SPACE_DEFAULT_ADDR@h
28         ori     r25,r25,GT64260_INTERNAL_SPACE_DECODE
29         lwbrx   r26,0,(r25)
30         lis     r24,0xffff
31         and     r26,r26,r24
32         addis   r24,0,EV64260_BRIDGE_REG_BASE@h
33         srw     r24,r24,r23
34         or      r26,r26,r24
35         stwbrx  r26,0,(r25)
36         sync
37
38         /* Wait for write to take effect */
39         addis   r25,0,EV64260_BRIDGE_REG_BASE@h
40         ori     r25,r25,GT64260_INTERNAL_SPACE_DECODE
41 1:      lwbrx   r24,0,(r25)
42         cmpw    r24,r26
43         bne     1b
44
45         /* Change CS2 (UARTS on device module) window */
46         addis   r25,0,EV64260_BRIDGE_REG_BASE@h
47         ori     r25,r25,GT64260_CPU_CS_DECODE_2_BOT
48         addis   r26,0,EV64260_UART_BASE@h
49         srw     r26,r26,r23
50         stwbrx  r26,0,(r25)
51         sync
52
53         addis   r25,0,EV64260_BRIDGE_REG_BASE@h
54         ori     r25,r25,GT64260_CPU_CS_DECODE_2_TOP
55         addis   r26,0,EV64260_UART_END@h
56         srw     r26,r26,r23
57         stwbrx  r26,0,(r25)
58         sync
59
60         blr