1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#include <config.h>
29
30#ifndef CONFIG_SKIP_LOWLEVEL_INIT
31
32#include <asm/arch/hardware.h>
33#include <asm/arch/at91_mc.h>
34#include <asm/arch/at91_pmc.h>
35#include <asm/arch/at91_pio.h>
36
37#define ARM920T_CONTROL 0xC0000000
38
39_MTEXT_BASE:
40#undef START_FROM_MEM
41#ifdef START_FROM_MEM
42 .word CONFIG_SYS_TEXT_BASE-PHYS_FLASH_1
43#else
44 .word CONFIG_SYS_TEXT_BASE
45#endif
46
47.globl lowlevel_init
48lowlevel_init:
49 ldr r1, =AT91_ASM_PMC_MOR
50
51#ifdef CONFIG_SYS_USE_MAIN_OSCILLATOR
52 ldr r0, =0x0000FF01
53#else
54 ldr r0, =0x0000FF00
55#endif
56 str r0, [r1]
57
58 ldr r0, =0x00000010
59LoopOsc:
60 subs r0, r0,
61 bhi LoopOsc
62
63
64
65 ldr r0, =SMRDATA
66 ldr r1, _MTEXT_BASE
67 sub r0, r0, r1
68 ldr r2, =SMRDATAE
69 sub r2, r2, r1
70pllloop:
71
72 ldr r1, [r0],
73
74 ldr r3, [r0],
75 str r3, [r1]
76 cmp r2, r0
77 bne pllloop
78
79 ldr r0, =0x00010000
80
81lock:
82 subs r0, r0,
83 bhi lock
84 ldr r0, =SMRDATA1
85 ldr r1, _MTEXT_BASE
86 sub r0, r0, r1
87 ldr r2, =SMRDATA1E
88 sub r2, r2, r1
89sdinit:
90
91 ldr r1, [r0],
92
93 ldr r3, [r0],
94 str r3, [r1]
95 cmp r2, r0
96 bne sdinit
97
98
99 mrc p15, 0, r0, c1, c0, 0
100 orr r0, r0,
101 mcr p15, 0, r0, c1, c0, 0
102
103
104 mov pc, lr
105
106 .ltorg
107
108SMRDATA:
109 .word AT91_ASM_MC_EBI_CFG
110 .word CONFIG_SYS_EBI_CFGR_VAL
111 .word AT91_ASM_MC_SMC_CSR0
112 .word CONFIG_SYS_SMC_CSR0_VAL
113 .word AT91_ASM_PMC_PLLAR
114 .word CONFIG_SYS_PLLAR_VAL
115 .word AT91_ASM_PMC_PLLBR
116 .word CONFIG_SYS_PLLBR_VAL
117 .word AT91_ASM_PMC_MCKR
118 .word CONFIG_SYS_MCKR_VAL
119SMRDATAE:
120
121SMRDATA1:
122 .word AT91_ASM_PIOC_ASR
123 .word CONFIG_SYS_PIOC_ASR_VAL
124 .word AT91_ASM_PIOC_BSR
125 .word CONFIG_SYS_PIOC_BSR_VAL
126 .word AT91_ASM_PIOC_PDR
127 .word CONFIG_SYS_PIOC_PDR_VAL
128 .word AT91_ASM_MC_EBI_CSA
129 .word CONFIG_SYS_EBI_CSA_VAL
130 .word AT91_ASM_MC_SDRAMC_CR
131 .word CONFIG_SYS_SDRC_CR_VAL
132 .word AT91_ASM_MC_SDRAMC_MR
133 .word CONFIG_SYS_SDRC_MR_VAL
134 .word CONFIG_SYS_SDRAM
135 .word CONFIG_SYS_SDRAM_VAL
136 .word AT91_ASM_MC_SDRAMC_MR
137 .word CONFIG_SYS_SDRC_MR_VAL1
138 .word CONFIG_SYS_SDRAM
139 .word CONFIG_SYS_SDRAM_VAL
140 .word CONFIG_SYS_SDRAM
141 .word CONFIG_SYS_SDRAM_VAL
142 .word CONFIG_SYS_SDRAM
143 .word CONFIG_SYS_SDRAM_VAL
144 .word CONFIG_SYS_SDRAM
145 .word CONFIG_SYS_SDRAM_VAL
146 .word CONFIG_SYS_SDRAM
147 .word CONFIG_SYS_SDRAM_VAL
148 .word CONFIG_SYS_SDRAM
149 .word CONFIG_SYS_SDRAM_VAL
150 .word CONFIG_SYS_SDRAM
151 .word CONFIG_SYS_SDRAM_VAL
152 .word CONFIG_SYS_SDRAM
153 .word CONFIG_SYS_SDRAM_VAL
154 .word AT91_ASM_MC_SDRAMC_MR
155 .word CONFIG_SYS_SDRC_MR_VAL2
156 .word CONFIG_SYS_SDRAM1
157 .word CONFIG_SYS_SDRAM_VAL
158 .word AT91_ASM_MC_SDRAMC_TR
159 .word CONFIG_SYS_SDRC_TR_VAL
160 .word CONFIG_SYS_SDRAM
161 .word CONFIG_SYS_SDRAM_VAL
162 .word AT91_ASM_MC_SDRAMC_MR
163 .word CONFIG_SYS_SDRC_MR_VAL3
164 .word CONFIG_SYS_SDRAM
165 .word CONFIG_SYS_SDRAM_VAL
166SMRDATA1E:
167
168#endif
169