@ -33,11 +33,8 @@
# include < a s m - o f f s e t s . h >
# include < c o n f i g . h >
# include < v e r s i o n . h >
# ifdef C O N F I G _ E N A B L E _ M M U
# include < a s m / p r o c / d o m a i n . h >
# endif
# if ! d e f i n e d ( C O N F I G _ E N A B L E _ M M U ) & & ! d e f i n e d ( C O N F I G _ S Y S _ P H Y _ U B O O T _ B A S E )
# ifndef C O N F I G _ S Y S _ P H Y _ U B O O T _ B A S E
# define C O N F I G _ S Y S _ P H Y _ U B O O T _ B A S E C O N F I G _ S Y S _ U B O O T _ B A S E
# endif
@ -105,14 +102,6 @@ _TEXT_BASE:
# endif
/ *
* Below v a r i a b l e i s v e r y i m p o r t a n t b e c a u s e w e u s e M M U i n U - B o o t .
* Without i t , w e c a n n o t r u n c o d e c o r r e c t l y b e f o r e M M U i s O N .
* by s c s u h .
* /
_TEXT_PHY_BASE :
.word CONFIG_SYS_PHY_UBOOT_BASE
/ *
* These a r e d e f i n e d i n t h e b o a r d - s p e c i f i c l i n k e r s c r i p t .
* Subtracting _ s t a r t f r o m t h e m l e t s t h e l i n k e r p u t t h e i r
* relative p o s i t i o n i n t h e e x e c u t a b l e i n s t e a d o f l e a v i n g
@ -298,44 +287,6 @@ fixnext:
blo f i x l o o p
# endif
# ifdef C O N F I G _ E N A B L E _ M M U
enable_mmu :
/* enable domain access */
ldr r5 , =0x0000ffff
mcr p15 , 0 , r5 , c3 , c0 , 0 / * l o a d d o m a i n a c c e s s r e g i s t e r * /
/* Set the TTB register */
ldr r0 , _ m m u _ t a b l e _ b a s e
ldr r1 , =CONFIG_SYS_PHY_UBOOT_BASE
ldr r2 , =0xfff00000
bic r0 , r0 , r2
orr r1 , r0 , r1
mcr p15 , 0 , r1 , c2 , c0 , 0
/* Enable the MMU */
mrc p15 , 0 , r0 , c1 , c0 , 0
orr r0 , r0 , #1 / * S e t C R _ M t o e n a b l e M M U * /
/* Prepare to enable the MMU */
adr r1 , s k i p _ h w _ i n i t
and r1 , r1 , #0x3fc
ldr r2 , _ T E X T _ B A S E
ldr r3 , =0xfff00000
and r2 , r2 , r3
orr r2 , r2 , r1
b m m u _ e n a b l e
.align 5
/* Run in a single cache-line */
mmu_enable :
mcr p15 , 0 , r0 , c1 , c0 , 0
nop
nop
mov p c , r2
skip_hw_init :
# endif
relocate_done :
bx l r
@ -347,11 +298,6 @@ _rel_dyn_end_ofs:
_dynsym_start_ofs :
.word __dynsym_start - _ start
# ifdef C O N F I G _ E N A B L E _ M M U
_mmu_table_base :
.word mmu_table
# endif
.globl c_runtime_cpu_setup
c_runtime_cpu_setup :
@ -359,41 +305,6 @@ c_runtime_cpu_setup:
# ifndef C O N F I G _ S P L _ B U I L D
/ *
* we a s s u m e t h a t c a c h e o p e r a t i o n i s d o n e b e f o r e . ( e g . c l e a n u p _ b e f o r e _ l i n u x ( ) )
* actually, w e d o n ' t n e e d t o d o a n y t h i n g a b o u t c a c h e i f n o t u s e d - c a c h e i n
* U- B o o t . S o , i n t h i s f u n c t i o n w e c l e a n o n l y M M U . b y s c s u h
*
* void t h e L a s t J u m p ( v o i d * k e r n e l , i n t a r c h _ n u m , u i n t b o o t _ p a r a m s ) ;
* /
# ifdef C O N F I G _ E N A B L E _ M M U
.globl theLastJump
theLastJump :
mov r9 , r0
ldr r3 , =0xfff00000
ldr r4 , _ T E X T _ P H Y _ B A S E
adr r5 , p h y _ l a s t _ j u m p
bic r5 , r5 , r3
orr r5 , r5 , r4
mov p c , r5
phy_last_jump :
/ *
* disable M M U s t u f f
* /
mrc p15 , 0 , r0 , c1 , c0 , 0
bic r0 , r0 , #0x00002300 / * c l e a r b i t s 1 3 , 9 : 8 ( - - V - - - R S ) * /
bic r0 , r0 , #0x00000087 / * c l e a r b i t s 7 , 2 : 0 ( B - - - - C A M ) * /
orr r0 , r0 , #0x00000002 / * s e t b i t 2 ( A ) A l i g n * /
orr r0 , r0 , #0x00001000 / * s e t b i t 1 2 ( I ) I - C a c h e * /
mcr p15 , 0 , r0 , c1 , c0 , 0
mcr p15 , 0 , r0 , c8 , c7 , 0 / * f l u s h v4 T L B * /
mov r0 , #0
mov p c , r9
# endif
/ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Interrupt h a n d l i n g