2010-10-02 19:13:42 +09:00
/ * linux/ a r c h / a r m / p l a t - s5 p / s l e e p . S
*
* Copyright ( c ) 2 0 1 0 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
*
* S5 P V 2 1 0 p o w e r M a n a g e r ( S u s p e n d - T o - R A M ) s u p p o r t
* Based o n S 3 C 2 4 1 0 s l e e p c o d e b y :
* Ben D o o k s , ( c ) 2 0 0 4 S i m t e c E l e c t r o n i c s
*
* Based o n P X A / S A 1 1 0 0 s l e e p c o d e b y :
* Nicolas P i t r e , ( c ) 2 0 0 2 M o n t a V i s t a S o f t w a r e I n c
* Cliff B r a k e , ( c ) 2 0 0 1
*
* 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 .
*
* You s h o u l d h a v e r e c e i v e d 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
* along w i t h t h i s p r o g r a m ; if not, write to the Free Software
* Foundation, I n c . , 5 9 T e m p l e P l a c e , S u i t e 3 3 0 , B o s t o n , M A 0 2 1 1 1 - 1 3 0 7 U S A
* /
# include < l i n u x / l i n k a g e . h >
# include < a s m / a s s e m b l e r . h >
# include < a s m / m e m o r y . h >
.text
/ * s3 c _ c p u _ s a v e
*
* entry :
2011-02-06 17:39:31 +00:00
* r1 = v : p o f f s e t
2010-10-02 19:13:42 +09:00
* /
ENTRY( s3 c _ c p u _ s a v e )
stmfd s p ! , { r3 - r12 , l r }
2011-02-06 17:39:31 +00:00
ldr r3 , =resume_with_mmu
bl c p u _ s u s p e n d
2010-10-02 19:13:42 +09:00
ldr r0 , =pm_cpu_sleep
ldr r0 , [ r0 ]
mov p c , r0
resume_with_mmu :
ldmfd s p ! , { r3 - r12 , p c }
.ltorg
/ * 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
* s3 c _ c p u _ r e s u m e e n t r y .
* /
.word 0x2bedf00d
/ * s3 c _ 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
*
* we m u s t p u t t h i s c o d e h e r e i n t h e d a t a s e g m e n t a s w e h a v e n o
* other w a y o f r e s t o r i n g t h e s t a c k p o i n t e r a f t e r s l e e p , a n d w e
* must n o t w r i t e t o t h e c o d e s e g m e n t ( c o d e i s r e a d - o n l y )
* /
ENTRY( s3 c _ c p u _ r e s u m e )
2011-02-06 17:39:31 +00:00
b c p u _ r e s u m e