2006-03-27 17:58:25 +04:00
/ *
* linux/ a r c h / a r m / k e r n e l / h e a d - n o m m u . S
*
* Copyright ( C ) 1 9 9 4 - 2 0 0 2 R u s s e l l K i n g
* Copyright ( C ) 2 0 0 3 - 2 0 0 6 H y o k S . C h o i
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
*
* Common k e r n e l s t a r t u p c o d e ( n o n - p a g e d M M )
*
* /
# include < l i n u x / l i n k a g e . h >
# include < l i n u x / i n i t . h >
# include < a s m / a s s e m b l e r . h >
# include < a s m / m a c h - t y p e s . h >
# include < a s m / p t r a c e . h >
2006-05-05 18:11:14 +04:00
# include < a s m / a s m - o f f s e t s . h >
2006-04-24 12:45:35 +04:00
# include < a s m / t h r e a d _ i n f o . h >
2006-03-27 17:58:25 +04:00
# include < a s m / s y s t e m . h >
/ *
* Kernel s t a r t u p e n t r y p o i n t .
* - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* This i s n o r m a l l y c a l l e d f r o m t h e d e c o m p r e s s o r c o d e . T h e r e q u i r e m e n t s
* are : MMU = o f f , D - c a c h e = o f f , I - c a c h e = d o n t c a r e , r0 = 0 ,
* r1 = m a c h i n e n r .
*
* See l i n u x / a r c h / a r m / t o o l s / m a c h - t y p e s f o r t h e c o m p l e t e l i s t o f m a c h i n e
* numbers f o r r1 .
*
* /
2007-05-08 18:15:45 +04:00
.section " .text .head " , " ax"
2006-03-27 17:58:25 +04:00
.type stext, % f u n c t i o n
ENTRY( s t e x t )
2006-06-25 15:01:48 +04:00
msr c p s r _ c , #P S R _ F _ B I T | P S R _ I _ B I T | S V C _ M O D E @ e n s u r e s v c m o d e
2006-03-27 17:58:25 +04:00
@ and irqs disabled
2006-09-26 12:36:37 +04:00
# ifndef C O N F I G _ C P U _ C P 1 5
ldr r9 , =CONFIG_PROCESSOR_ID
# else
2006-03-27 17:58:25 +04:00
mrc p15 , 0 , r9 , c0 , c0 @ get processor id
2006-09-26 12:36:37 +04:00
# endif
2006-03-27 17:58:25 +04:00
bl _ _ l o o k u p _ p r o c e s s o r _ t y p e @ r5=procinfo r9=cpuid
movs r10 , r5 @ invalid processor (r5=0)?
beq _ _ e r r o r _ p @ yes, error 'p'
bl _ _ l o o k u p _ m a c h i n e _ t y p e @ r5=machinfo
movs r8 , r5 @ invalid machine (r5=0)?
beq _ _ e r r o r _ a @ yes, error 'a'
ldr r13 , _ _ s w i t c h _ d a t a @ address to jump to after
@ the initialization is done
adr l r , _ _ a f t e r _ p r o c _ i n i t @ return (PIC) address
add p c , r10 , #P R O C I N F O _ I N I T F U N C
/ *
* Set t h e C o n t r o l R e g i s t e r a n d R e a d t h e p r o c e s s I D .
* /
.type _ _ after_ p r o c _ i n i t , % f u n c t i o n
__after_proc_init :
2006-09-26 12:36:37 +04:00
# ifdef C O N F I G _ C P U _ C P 1 5
2006-03-27 17:58:25 +04:00
mrc p15 , 0 , r0 , c1 , c0 , 0 @ read control reg
# ifdef C O N F I G _ A L I G N M E N T _ T R A P
orr r0 , r0 , #C R _ A
# else
bic r0 , r0 , #C R _ A
# endif
# ifdef C O N F I G _ C P U _ D C A C H E _ D I S A B L E
bic r0 , r0 , #C R _ C
# endif
# ifdef C O N F I G _ C P U _ B P R E D I C T _ D I S A B L E
bic r0 , r0 , #C R _ Z
# endif
# ifdef C O N F I G _ C P U _ I C A C H E _ D I S A B L E
bic r0 , r0 , #C R _ I
2006-09-28 16:46:34 +04:00
# endif
# ifdef C O N F I G _ C P U _ H I G H _ V E C T O R
orr r0 , r0 , #C R _ V
# else
bic r0 , r0 , #C R _ V
2006-03-27 17:58:25 +04:00
# endif
mcr p15 , 0 , r0 , c1 , c0 , 0 @ write control reg
2006-09-26 12:36:37 +04:00
# endif / * C O N F I G _ C P U _ C P 1 5 * /
2006-03-27 17:58:25 +04:00
mov p c , r13 @ clear the BSS and jump
@ to start_kernel
2006-04-24 12:45:35 +04:00
.ltorg
2006-03-27 17:58:25 +04:00
# include " h e a d - c o m m o n . S "