import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / arm / boot / compressed / head-ftvpci.S
1 /* 
2  * linux/arch/arm/boot/compressed/head-ftvpci.S
3  * 
4  * Copyright (C) 2000 FutureTV Labs Ltd.
5  * 
6  * Special startup code for FTV PCI board.
7  */
8
9 /*
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version
13  * 2 of the License, or (at your option) any later version.
14  */
15
16         .section        ".start", "ax"
17 ftv_start:
18         mcr     p15, 0, r0, c7, c5, 0           @ flush I cache
19         mrc     p15, 0, r0, c1, c0
20         orr     r0, r0, #1 << 12
21         mcr     p15, 0, r0, c1, c0              @ enable I cache
22         mov     r0, #0
23         mcreq   p15, 0, r0, c15, c1, 2          @ enable clock switching
24
25         /* check to see if the kernel must be relocated */
26         ldr     ip, =ftv_start
27         adr     sl, ftv_start
28         teq     ip, sl
29         beq     2f                              @ no need to copy
30
31         /* in the wrong place -> presumably, executing out of ROM */
32         sub     ip, ip, sl                      @ displacement
33         ldr     lr, =_start                     @ destination
34         sub     sp, lr, ip                      @ source
35         ldr     fp, =_edata                     @ end of copied area
36 1:      ldmia   sp!, {r0, r1, r2, r3, r4, r5, r6, r10}
37         stmia   lr!, {r0, r1, r2, r3, r4, r5, r6, r10}
38         cmp     lr, fp
39         ble     1b
40
41 2:
42         mov     r8, #0
43         mov     r7, #3
44         b       1f
45 .ltorg
46 1:
47         /* fall back into head.S */