@ -26,14 +26,6 @@
# include < c o n f i g . h >
# include < v e r s i o n . h >
_TEXT_BASE :
.word CONFIG_SYS_TEXT_BASE @ sdram load addr from config file
.global invalidate_dcache
invalidate_dcache :
mov p c , l r
.align 5
.global reset_cpu
reset_cpu :
@ -47,113 +39,3 @@ _loop_forever:
b _ l o o p _ f o r e v e r
rstctl :
.word PRM_RSTCTRL
.globl lowlevel_init
lowlevel_init :
ldr s p , S R A M _ S T A C K
str i p , [ s p ]
mov i p , l r
bl s _ i n i t @ go setup pll, mux & memory
ldr i p , [ s p ]
mov l r , i p
mov p c , l r @ back to arch calling code
.globl startup_cpu
startup_cpu :
@ Initialize the AVP, clocks, and memory controller
@ SDRAM is guaranteed to be on at this point
ldr r0 , =cold_boot @ R0 = reset vector for CPU
bl s t a r t _ c p u @ start the CPU
@ Transfer control to the AVP code
bl h a l t _ a v p
@ Should never get here
_loop_forever2 :
b _ l o o p _ f o r e v e r2
.globl cache_configure
cache_configure :
stmdb r13 ! ,{ r14 }
@ invalidate instruction cache
mov r1 , #0
mcr p15 , 0 , r1 , c7 , c5 , 0
@ invalidate the i&d tlb entries
mcr p15 , 0 , r1 , c8 , c5 , 0
mcr p15 , 0 , r1 , c8 , c6 , 0
@ enable instruction cache
mrc p15 , 0 , r1 , c1 , c0 , 0
orr r1 , r1 , #( 1 < < 1 2 )
mcr p15 , 0 , r1 , c1 , c0 , 0
bl e n a b l e _ s c u
@ enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg
mrc p15 , 0 , r0 , c1 , c0 , 1
orr r0 , r0 , #0x41
mcr p15 , 0 , r0 , c1 , c0 , 1
@ Now flush the Dcache
mov r0 , #0
@ 256 cache lines
mov r1 , #256
invalidate_loop :
add r1 , r1 , #- 1
mov r0 , r1 , l s l #5
@ invalidate d-cache using line (way0)
mcr p15 , 0 , r0 , c7 , c6 , 2
orr r2 , r0 , #( 1 < < 3 0 )
@ invalidate d-cache using line (way1)
mcr p15 , 0 , r2 , c7 , c6 , 2
orr r2 , r0 , #( 2 < < 3 0 )
@ invalidate d-cache using line (way2)
mcr p15 , 0 , r2 , c7 , c6 , 2
orr r2 , r0 , #( 3 < < 3 0 )
@ invalidate d-cache using line (way3)
mcr p15 , 0 , r2 , c7 , c6 , 2
cmp r1 , #0
bne i n v a l i d a t e _ l o o p
@ FIXME: should have ap20's L2 disabled too?
invalidate_done :
ldmia r13 ! ,{ p c }
.globl cold_boot
cold_boot :
msr c p s r _ c , #0xD3
@ Check current processor: CPU or AVP?
@ If CPU, go to CPU boot code, else continue on AVP path
ldr r0 , =NV_PA_PG_UP_BASE
ldr r1 , [ r0 ]
ldr r2 , =PG_UP_TAG_AVP
@ are we the CPU?
ldr s p , C P U _ S T A C K
cmp r1 , r2
@ yep, we are the CPU
bne _ a r m b o o t _ s t a r t
@ AVP initialization follows this path
ldr s p , A V P _ S T A C K
@ Init AVP and start CPU
b s t a r t u p _ c p u
@ the literal pools origin
.ltorg
SRAM_STACK :
.word LOW_LEVEL_SRAM_STACK
AVP_STACK :
.word EARLY_AVP_STACK
CPU_STACK :
.word EARLY_CPU_STACK