2014-03-18 07:28:27 +09:00
/ *
* Copyright ( c ) 2 0 1 3 S a m s u n g E l e c t r o n i c s C o . , L t d .
* http : / / www. s a m s u n g . c o m
*
* Exynos l o w - l e v e l r e s u m e c o d e
*
* 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 a s p u b l i s h e d b y
* the F r e e S o f t w a r e F o u n d a t i o n ; either version 2 of the License, or
* ( at y o u r o p t i o n ) a n y l a t e r v e r s i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S F O R A P A R T I C U L A R P U R P O S E . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
* /
# include < l i n u x / l i n k a g e . h >
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / h a r d w a r e / c a c h e - l 2 x0 . h >
# define C P U _ M A S K 0 x f f0 f f f f0
# define C P U _ C O R T E X _ A 9 0 x41 0 f c09 0
/ *
* The f o l l o w i n g c o d e i s l o c a t e d i n t o t h e . d a t a s e c t i o n . T h i s i s t o
* allow l 2 x0 _ r e g s _ p h y s t o b e a c c e s s e d w i t h a r e l a t i v e l o a d w h i l e w e
* can' t r e l y o n a n y M M U t r a n s l a t i o n . W e c o u l d h a v e p u t l 2 x0 _ r e g s _ p h y s
* in t h e . t e x t s e c t i o n a s w e l l , b u t s o m e s e t u p s m i g h t i n s i s t o n i t t o
* be t r u l y r e a d - o n l y . ( R e f e r e n c e f r o m : a r c h / a r m / k e r n e l / s l e e p . S )
* /
.data
.align
/ *
* sleep m a g i c , t o a l l o w t h e b o o t l o a d e r t o c h e c k f o r a n v a l i d
* image t o r e s u m e t o . M u s t b e t h e f i r s t w o r d b e f o r e t h e
* exynos_ c p u _ r e s u m e e n t r y .
* /
.word 0x2bedf00d
/ *
* exynos_ c p u _ r e s u m e
*
* resume c o d e e n t r y f o r b o o t l o a d e r t o c a l l
* /
ENTRY( e x y n o s _ c p u _ r e s u m e )
# ifdef C O N F I G _ C A C H E _ L 2 X 0
mrc p15 , 0 , r0 , c0 , c0 , 0
ldr r1 , =CPU_MASK
and r0 , r0 , r1
ldr r1 , =CPU_CORTEX_A9
cmp r0 , r1
bne s k i p _ l 2 _ r e s u m e
adr r0 , l 2 x0 _ r e g s _ p h y s
ldr r0 , [ r0 ]
cmp r0 , #0
beq s k i p _ l 2 _ r e s u m e
ldr r1 , [ r0 , #L 2 X 0 _ R _ P H Y _ B A S E ]
ldr r2 , [ r1 , #L 2 X 0 _ C T R L ]
tst r2 , #0x1
bne s k i p _ l 2 _ r e s u m e
ldr r2 , [ r0 , #L 2 X 0 _ R _ A U X _ C T R L ]
str r2 , [ r1 , #L 2 X 0 _ A U X _ C T R L ]
ldr r2 , [ r0 , #L 2 X 0 _ R _ T A G _ L A T E N C Y ]
2014-03-16 20:52:25 +00:00
str r2 , [ r1 , #L 310 _ T A G _ L A T E N C Y _ C T R L ]
2014-03-18 07:28:27 +09:00
ldr r2 , [ r0 , #L 2 X 0 _ R _ D A T A _ L A T E N C Y ]
2014-03-16 20:52:25 +00:00
str r2 , [ r1 , #L 310 _ D A T A _ L A T E N C Y _ C T R L ]
2014-03-18 07:28:27 +09:00
ldr r2 , [ r0 , #L 2 X 0 _ R _ P R E F E T C H _ C T R L ]
2014-03-16 20:52:25 +00:00
str r2 , [ r1 , #L 310 _ P R E F E T C H _ C T R L ]
2014-03-18 07:28:27 +09:00
ldr r2 , [ r0 , #L 2 X 0 _ R _ P W R _ C T R L ]
2014-03-16 20:52:25 +00:00
str r2 , [ r1 , #L 310 _ P O W E R _ C T R L ]
2014-03-18 07:28:27 +09:00
mov r2 , #1
str r2 , [ r1 , #L 2 X 0 _ C T R L ]
skip_l2_resume :
# endif
b c p u _ r e s u m e
ENDPROC( e x y n o s _ c p u _ r e s u m e )
# ifdef C O N F I G _ C A C H E _ L 2 X 0
.globl l2x0_regs_phys
l2x0_regs_phys :
.long 0
# endif