2007-09-21 18:44:38 +04:00
/ *
* This f i l e c o n t a i n s l o w l e v e l C P U s e t u p f u n c t i o n s .
* Valentine B a r s h a k < v b a r s h a k @ru.mvista.com>
* MontaVista S o f t w a r e , I n c ( c ) 2 0 0 7
*
2008-02-24 00:07:41 +03:00
* Based o n c p u _ s e t u p _ 6 x x c o d e b y
2007-09-21 18:44:38 +04:00
* Benjamin H e r r e n s c h m i d t < b e n h @kernel.crashing.org>
*
* 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
* as p u b l i s h e d 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 t h e 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 .
*
* /
# include < a s m / p r o c e s s o r . h >
# include < a s m / c p u t a b l e . h >
# include < a s m / p p c _ a s m . h >
2007-09-21 18:46:57 +04:00
_ GLOBAL( _ _ s e t u p _ c p u _ 4 4 0 e p )
b _ _ i n i t _ f p u _ 4 4 x
_ GLOBAL( _ _ s e t u p _ c p u _ 4 4 0 e p x )
2007-09-21 18:50:09 +04:00
mflr r4
bl _ _ i n i t _ f p u _ 4 4 x
bl _ _ p l b _ d i s a b l e _ w r p
2007-12-21 07:39:21 +03:00
bl _ _ f i x u p _ 4 4 0 A _ m c h e c k
2007-09-21 18:50:09 +04:00
mtlr r4
blr
_ GLOBAL( _ _ s e t u p _ c p u _ 4 4 0 g r x )
2007-12-04 22:02:18 +03:00
mflr r4
bl _ _ p l b _ d i s a b l e _ w r p
bl _ _ f i x u p _ 4 4 0 A _ m c h e c k
mtlr r4
blr
2008-02-24 00:07:41 +03:00
_ GLOBAL( _ _ s e t u p _ c p u _ 4 6 0 e x )
2008-06-11 15:52:40 +04:00
_ GLOBAL( _ _ s e t u p _ c p u _ 4 6 0 g t )
2009-02-05 16:31:36 +03:00
_ GLOBAL( _ _ s e t u p _ c p u _ 4 6 0 s x )
2008-11-11 19:02:43 +03:00
mflr r4
bl _ _ i n i t _ f p u _ 4 4 x
bl _ _ f i x u p _ 4 4 0 A _ m c h e c k
mtlr r4
blr
2008-12-04 08:39:55 +03:00
_ GLOBAL( _ _ s e t u p _ c p u _ 4 4 0 x5 )
2007-12-21 07:39:21 +03:00
_ GLOBAL( _ _ s e t u p _ c p u _ 4 4 0 g x )
_ GLOBAL( _ _ s e t u p _ c p u _ 4 4 0 s p e )
b _ _ f i x u p _ 4 4 0 A _ m c h e c k
2007-09-21 18:50:09 +04:00
2007-09-21 18:46:57 +04:00
/* enable APU between CPU and FPU */
_ GLOBAL( _ _ i n i t _ f p u _ 4 4 x )
mfspr r3 ,S P R N _ C C R 0
/* Clear DAPUIB flag in CCR0 */
rlwinm r3 ,r3 ,0 ,1 2 ,1 0
mtspr S P R N _ C C R 0 ,r3
isync
blr
2007-09-21 18:50:09 +04:00
/ *
* Workaround f o r t h e i n c o r r e c t w r i t e t o D D R S D R A M e r r a t a .
* The w r i t e a d d r e s s c a n b e c o r r u p t e d d u r i n g w r i t e s t o
* DDR S D R A M w h e n w r i t e p i p e l i n i n g i s e n a b l e d o n P L B 0 .
* Disable w r i t e p i p e l i n i n g h e r e .
* /
# define D C R N _ P L B 4 A 0 _ A C R 0 x81
_ GLOBAL( _ _ p l b _ d i s a b l e _ w r p )
mfdcr r3 ,D C R N _ P L B 4 A 0 _ A C R
/* clear WRP bit in PLB4A0_ACR */
rlwinm r3 ,r3 ,0 ,8 ,6
mtdcr D C R N _ P L B 4 A 0 _ A C R ,r3
isync
blr