@ -1,73 +1,31 @@
/ *
*
* See f i l e C R E D I T S f o r l i s t o f p e o p l e w h o c o n t r i b u t e d t o t h i s
* project.
*
* 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
* /
* ( C) C o p y r i g h t 2 0 0 7
* Stefan R o e s e , D E N X S o f t w a r e E n g i n e e r i n g , s r @denx.de.
*
* Copyright ( C ) 2 0 0 2 S c o t t M c N u t t < s m c n u t t @artesyncp.com>
*
* See f i l e C R E D I T S f o r l i s t o f p e o p l e w h o c o n t r i b u t e d t o t h i s
* project.
*
* 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 < p p c _ a s m . t m p l >
# include < c o n f i g . h >
/* General */
# define T L B _ V A L I D 0 x00 0 0 0 2 0 0
/* Supported page sizes */
# define S Z _ 1 K 0 x00 0 0 0 0 0 0
# define S Z _ 4 K 0 x00 0 0 0 0 1 0
# define S Z _ 1 6 K 0 x00 0 0 0 0 2 0
# define S Z _ 6 4 K 0 x00 0 0 0 0 3 0
# define S Z _ 2 5 6 K 0 x00 0 0 0 0 4 0
# define S Z _ 1 M 0 x00 0 0 0 0 5 0
# define S Z _ 1 6 M 0 x00 0 0 0 0 7 0
# define S Z _ 2 5 6 M 0 x00 0 0 0 0 9 0
/* Storage attributes */
# define S A _ W 0 x00 0 0 0 8 0 0 / * W r i t e - t h r o u g h * /
# define S A _ I 0 x00 0 0 0 4 0 0 / * C a c h i n g i n h i b i t e d * /
# define S A _ M 0 x00 0 0 0 2 0 0 / * M e m o r y c o h e r e n c e * /
# define S A _ G 0 x00 0 0 0 1 0 0 / * G u a r d e d * /
# define S A _ E 0 x00 0 0 0 0 8 0 / * E n d i a n * /
/* Access control */
# define A C _ X 0 x00 0 0 0 0 2 4 / * E x e c u t e * /
# define A C _ W 0 x00 0 0 0 0 1 2 / * W r i t e * /
# define A C _ R 0 x00 0 0 0 0 0 9 / * R e a d * /
/* Some handy macros */
# define E P N ( e ) ( ( e ) & 0 x f f f f f c00 )
# define T L B 0 ( e p n ,s z ) ( ( E P N ( ( e p n ) ) | ( s z ) | T L B _ V A L I D ) )
# define T L B 1 ( r p n ,e r p n ) ( ( ( r p n ) & 0 x f f f f f c00 ) | ( e r p n ) )
# define T L B 2 ( a ) ( ( a ) & 0 x00 0 0 0 f b f )
# define t l b t a b _ s t a r t \
mflr r1 ;\
bl 0 f ;
# define t l b t a b _ e n d \
.long 0 , 0 , 0 ; \
0 : mflr r0 ; \
mtlr r1 ; \
blr ;
# define t l b e n t r y ( e p n ,s z ,r p n ,e r p n ,a t t r ) \
.long TLB0 ( e p n ,s z ) ,T L B 1 ( r p n ,e r p n ) ,T L B 2 ( a t t r )
# include < a s m - p p c / m m u . h >
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* TLB T A B L E
@ -80,53 +38,37 @@
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
.section .bootpg , " ax"
.globl tlbtab
.section .bootpg , " ax"
.globl tlbtab
tlbtab :
tlbtab_ s t a r t
# if ( C F G _ L A R G E _ F L A S H = = 0 x f f c00 0 0 0 ) / * i f b o o t i n g f r o m l a r g e f l a s h * /
/* large flash */
tlbentry( 0 x f f c00 0 0 0 , S Z _ 1 M , 0 x f f c00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I | S A _ W )
tlbentry( 0 x f f d00 0 0 0 , S Z _ 1 M , 0 x f f d00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I | S A _ W )
tlbentry( 0 x f f e 0 0 0 0 0 , S Z _ 1 M , 0 x f f e 0 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I | S A _ W )
tlbentry( 0 x f f f00 0 0 0 , S Z _ 1 M , 0 x f f f00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I | S A _ W )
tlbentry( 0 x f f80 0 0 0 0 , S Z _ 1 M , 0 x f f80 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
tlbentry( 0 x f f90 0 0 0 0 , S Z _ 1 M , 0 x f f90 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I | S A _ W )
# else / * e l s e b o o t i n g f r o m s m a l l f l a s h * /
tlbentry( 0 x f f e 0 0 0 0 0 , S Z _ 1 M , 0 x f f e 0 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
tlbentry( 0 x f f f00 0 0 0 , S Z _ 1 M , 0 x f f f00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
tlbentry( 0 x f f80 0 0 0 0 , S Z _ 1 M , 0 x f f80 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
tlbentry( 0 x f f90 0 0 0 0 , S Z _ 1 M , 0 x f f90 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
tlbentry( 0 x f f a00 0 0 0 , S Z _ 1 M , 0 x f f a00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
tlbentry( 0 x f f b00 0 0 0 , S Z _ 1 M , 0 x f f b00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
# endif
tlbentry( C F G _ E P L D _ B A S E , S Z _ 2 5 6 K , 0 x f f00 0 0 0 0 , 1 , A C _ R | A C _ W | S A _ G | S A _ I )
# if ( C F G _ S R A M _ B A S E ! = 0 ) / * i f S R A M u p h i g h a n d S D R A M a t z e r o * /
tlbentry( 0 x00 0 0 0 0 0 0 , S Z _ 2 5 6 M , 0 x00 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( 0 x10 0 0 0 0 0 0 , S Z _ 2 5 6 M , 0 x10 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
# elif ( C F G _ S M A L L _ F L A S H = = 0 x f f90 0 0 0 0 ) / * e l s e S R A M a t 0 * /
tlbentry( 0 x00 0 0 0 0 0 0 , S Z _ 1 M , 0 x f f80 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
# elif ( C F G _ S M A L L _ F L A S H = = 0 x f f f00 0 0 0 )
tlbentry( 0 x00 0 0 0 0 0 0 , S Z _ 1 M , 0 x f f e 0 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G / * | S A _ I * / )
# else
# error D O N T K N O W S R A M L O C A T I O N
# endif
/* internal ram (l2 cache) */
tlbentry( C F G _ I S R A M _ B A S E , S Z _ 2 5 6 K , 0 x80 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X | S A _ I )
/* peripherals at f0000000 */
tlbentry( C F G _ P E R I P H E R A L _ B A S E , S Z _ 4 K , C F G _ P E R I P H E R A L _ B A S E , 1 , A C _ R | A C _ W | S A _ G | S A _ I )
/* PCI */
# if ( C O N F I G _ C O M M A N D S & C F G _ C M D _ P C I )
tlbentry( C F G _ P C I _ B A S E , S Z _ 2 5 6 M , 0 x00 0 0 0 0 0 0 , 9 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbentry( C F G _ P C I _ M E M B A S E , S Z _ 2 5 6 M , 0 x10 0 0 0 0 0 0 , 9 , A C _ R | A C _ W | S A _ G | S A _ I )
# endif
tlbtab_ e n d
tlbtab_ s t a r t
/ *
* BOOT_ C S ( F L A S H ) m u s t b e f i r s t . B e f o r e r e l o c a t i o n S A _ I c a n b e o f f t o u s e t h e
* speed u p b o o t p r o c e s s . I t i s p a t c h e d a f t e r r e l o c a t i o n t o e n a b l e S A _ I
* /
tlbentry( 0 x f f f00 0 0 0 , S Z _ 1 M , 0 x f f f00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G )
tlbentry( 0 x f f c00 0 0 0 , S Z _ 1 M , 0 x f f c00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( 0 x f f d00 0 0 0 , S Z _ 1 M , 0 x f f d00 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( 0 x f f e 0 0 0 0 0 , S Z _ 1 M , 0 x f f e 0 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( 0 x f f90 0 0 0 0 , S Z _ 1 M , 0 x f f90 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( C F G _ E P L D _ B A S E , S Z _ 2 5 6 K , 0 x f f00 0 0 0 0 , 1 , A C _ R | A C _ W | S A _ G | S A _ I )
/ *
* TLB e n t r i e s f o r S D R A M a r e n o t n e e d e d o n t h i s p l a t f o r m .
* They a r e d y n a m i c a l l y g e n e r a t e d i n t h e S P D D D R ( 2 ) d e t e c t i o n
* routine.
* /
/* internal ram (l2 cache) */
tlbentry( C F G _ I S R A M _ B A S E , S Z _ 2 5 6 K , 0 x80 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X | S A _ I )
/* peripherals at f0000000 */
tlbentry( C F G _ P E R I P H E R A L _ B A S E , S Z _ 4 K , C F G _ P E R I P H E R A L _ B A S E , 1 , A C _ R | A C _ W | S A _ G | S A _ I )
/* PCI */
tlbentry( C F G _ P C I _ B A S E , S Z _ 2 5 6 M , 0 x00 0 0 0 0 0 0 , 9 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbentry( C F G _ P C I _ M E M B A S E , S Z _ 2 5 6 M , 0 x10 0 0 0 0 0 0 , 9 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbtab_ e n d