tizen 2.4 release
[kernel/u-boot-tm1.git] / arch / arm / cpu / arm926ejs / sc8800g / cpu_spec.S
1 #include <config.h>
2 #include <common.h>
3 #include <version.h>
4
5 #ifdef PLATFORM_SC8800G
6 #define REMAP 0x20900218
7 #define SVC_STACK_TEMP 0x40008000
8 #define GEN2_ADDR 0x8b00002c
9 #define ON_CHIP_RAM_EN 0xF
10 #endif
11
12 #ifdef PLATFORM_SC8800G
13 #define BIGEND_PROT_REG 0x20900290
14 #define AHB_CTRL5_REG 0x20900230
15 #endif
16
17 .globl cpu_spec
18 cpu_spec:
19         LDR    R0, =REMAP
20         LDR    R1, =0
21         STR    R1, [R0]
22
23         MRC p15,0,r0,c1,c0,0
24 #ifdef CHIP_ENDIAN_BIG
25         ORR r0,r0,#0x80
26 #else
27         BIC r0,r0,#0x80
28 #endif
29
30 #ifdef _LITTLE_ENDIAN
31         BIC r0,r0,#1 /*disable MMU*/
32         LDR r1,=0x1004
33         BIC r0,r0,r1  /*disable cache*/
34         LDR r1,=0x1000
35         ORR r0,r0,r1
36 #endif
37         MCR p15,0,r0,c1,c0,0
38
39         /*Set Endian Regs of SC8800G*/
40 #if defined(CHIP_ENDIAN_BIG) && defined(PLATFORM_SC8800G)
41         LDR     R0, =BIGEND_PROT_REG
42         MOV     R2, #0xD4
43         ORR     R2, R2, #0xC300
44         STR     R2,[R0]
45
46         LDR     R2, =AHB_CTRL5_REG
47         MOV     R1, #0xff
48         ORR     R1, R1, #0x300
49
50         STR     R1, [R2]
51         MOV     R1, #0
52         STR     R1, [R0]
53 #endif
54
55         /*set stack limit to 0*/
56         MOV    R10, #0
57
58 #if defined(PLATFORM_SC8800H) || defined(PLATFORM_SC8800G)
59 #else
60         /*Enable on chip ram for ARM*/
61         LDR     R0, =GEN2_ADDR
62         LDR     R1, =ON_CHIP_RAM_EN
63         LDR     R2, [R0]
64         ORR     R1, R1, R2
65         STR     R1, [R0]
66 #endif
67
68         /*set up temp stack*/
69         LDR    sp, =SVC_STACK_TEMP
70
71         STMDB sp!,{lr} 
72         bl lowlevel_init
73         @bl MMU_Init
74         /*Re-set up stack
75           The sp here must be in the reserved region
76           */
77         LDMIA sp!, {lr}
78         LDR     sp, =0x008f0000 
79
80         mov     pc,lr
81 /*end of function cpu_spec*/