2011-09-06 10:59:40 +04:00
/ *
* Copyright 2 0 1 1 F r e e s c a l e S e m i c o n d u c t o r , I n c .
* Copyright 2 0 1 1 L i n a r o L t d .
*
* The c o d e c o n t a i n e d h e r e i n i s l i c e n s e d u n d e r t h e G N U G e n e r a l P u b l i c
* License. Y o u m a y o b t a i n a c o p y 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
* Version 2 o r l a t e r a t t h e f o l l o w i n g l o c a t i o n s :
*
* http : / / www. o p e n s o u r c e . o r g / l i c e n s e s / g p l - l i c e n s e . h t m l
* http : / / www. g n u . o r g / c o p y l e f t / g p l . h t m l
* /
# 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 >
2011-09-06 11:08:40 +04:00
# include < a s m / a s m - o f f s e t s . h >
2011-09-06 10:59:40 +04:00
# include < a s m / h a r d w a r e / c a c h e - l 2 x0 . h >
.section " .text .head " , " ax"
# ifdef C O N F I G _ S M P
ENTRY( v7 _ s e c o n d a r y _ s t a r t u p )
bl v7 _ i n v a l i d a t e _ l 1
b s e c o n d a r y _ s t a r t u p
ENDPROC( v7 _ s e c o n d a r y _ s t a r t u p )
# endif
2011-09-06 11:08:40 +04:00
2013-04-30 19:57:00 +04:00
# ifdef C O N F I G _ A R M _ C P U _ S U S P E N D
2011-09-06 11:08:40 +04:00
/ *
2013-02-19 08:11:30 +04:00
* The f o l l o w i n g c o d e m u s t a s s u m e i t i s r u n n i n g f r o m p h y s i c a l a d d r e s s
* where a b s o l u t e v i r t u a l a d d r e s s e s t o t h e d a t a s e c t i o n h a v e t o b e
* turned i n t o r e l a t i v e o n e s .
2011-09-06 11:08:40 +04:00
* /
2011-12-22 07:55:01 +04:00
# ifdef C O N F I G _ C A C H E _ L 2 X 0
2011-09-06 11:08:40 +04:00
.macro pl310_resume
2013-02-19 08:11:30 +04:00
adr r0 , l 2 x0 _ s a v e d _ r e g s _ o f f s e t
ldr r2 , [ r0 ]
add r2 , r2 , r0
2011-09-06 11:08:40 +04:00
ldr r0 , [ r2 , #L 2 X 0 _ R _ P H Y _ B A S E ] @ get physical base of l2x0
ldr r1 , [ r2 , #L 2 X 0 _ R _ A U X _ C T R L ] @ get aux_ctrl value
str r1 , [ r0 , #L 2 X 0 _ A U X _ C T R L ] @ restore aux_ctrl
mov r1 , #0x1
str r1 , [ r0 , #L 2 X 0 _ C T R L ] @ re-enable L2
.endm
2013-02-19 08:11:30 +04:00
l2x0_saved_regs_offset :
.word l2x0_saved_regs - .
2011-12-22 07:55:01 +04:00
# else
.macro pl310_resume
.endm
# endif
2011-09-06 11:08:40 +04:00
ENTRY( v7 _ c p u _ r e s u m e )
bl v7 _ i n v a l i d a t e _ l 1
pl3 1 0 _ r e s u m e
b c p u _ r e s u m e
ENDPROC( v7 _ c p u _ r e s u m e )
2011-12-21 18:38:23 +04:00
# endif