2013-02-13 17:47:07 +04:00
/ *
* Shared S C U s e t u p f o r m a c h - s h m o b i l e
*
* Copyright ( C ) 2 0 1 2 B a s t i a n H e c h t
*
* 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 i t 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
* 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 ; either version 2 of
* the L i c e n s e , o r ( a t 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 ,
* MA 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 < l i n u x / i n i t . h >
# include < a s m / m e m o r y . h >
_ _ CPUINIT
/ *
2013-06-10 13:20:25 +04:00
* Boot c o d e f o r s e c o n d a r y C P U s .
2013-02-13 17:47:07 +04:00
*
* First w e t u r n o n L 1 c a c h e c o h e r e n c y f o r o u r C P U . T h e n w e j u m p t o
* shmobile_ i n v a l i d a t e _ s t a r t t h a t i n v a l i d a t e s t h e c a c h e a n d h a n d s o v e r c o n t r o l
* to t h e c o m m o n A R M s t a r t u p c o d e .
* /
2013-06-10 13:19:46 +04:00
ENTRY( s h m o b i l e _ b o o t _ s c u )
@ r0 = SCU base address
mrc p15 , 0 , r1 , c0 , c0 , 5 @ read MIPDR
and r1 , r1 , #3 @ mask out cpu ID
lsl r1 , r1 , #3 @ we will shift by cpu_id * 8 bits
ldr r2 , [ r0 , #8 ] @ SCU Power Status Register
mov r3 , #3
bic r2 , r2 , r3 , l s l r1 @ Clear bits of our CPU (Run Mode)
str r2 , [ r0 , #8 ] @ write back
b s h m o b i l e _ i n v a l i d a t e _ s t a r t
ENDPROC( s h m o b i l e _ b o o t _ s c u )
2013-02-13 17:47:17 +04:00
.text
.globl shmobile_scu_base
shmobile_scu_base :
.space 4