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