@ -22,55 +22,7 @@
# 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
# define _ 2 5 6 M 0 x10 0 0 0 0 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 _ 8 M 0 x00 0 0 0 0 6 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
@ -83,19 +35,23 @@
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
.section .bootpg , " ax"
.globl tlbtab
.section .bootpg , " ax"
.globl tlbtab
tlbtab :
tlbtab_ s t a r t
tlbentry( 0 x f00 0 0 0 0 0 , S Z _ 2 5 6 M , 0 x f00 0 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( C F G _ P E R I P H E R A L _ B A S E , S Z _ 2 5 6 M , 0 x40 0 0 0 0 0 0 , 1 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbentry( C F G _ I S R A M _ B A S E , S Z _ 4 K , 0 x80 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X )
tlbentry( C F G _ I S R A M _ B A S E + 0 x10 0 0 , S Z _ 4 K , 0 x80 0 0 1 0 0 0 , 0 , A C _ R | A C _ W | A C _ X )
tlbentry( C F G _ S D R A M _ B A S E , 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( C F G _ S D R A M _ B A S E + 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 )
tlbentry( C F G _ S D R A M _ B A S E + 0 x20 0 0 0 0 0 0 , S Z _ 2 5 6 M , 0 x20 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ I )
tlbentry( C F G _ S D R A M _ B A S E + 0 x30 0 0 0 0 0 0 , S Z _ 2 5 6 M , 0 x30 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X | S A _ G | S A _ 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 , 2 , 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 x00 0 0 0 0 0 0 , 3 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbtab_ e n d
tlbtab_ s t a r t
tlbentry( 0 x f00 0 0 0 0 0 , S Z _ 2 5 6 M , 0 x f00 0 0 0 0 0 , 1 , A C _ R | A C _ W | A C _ X | 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.
* /
tlbentry( C F G _ P E R I P H E R A L _ B A S E , S Z _ 2 5 6 M , 0 x40 0 0 0 0 0 0 , 1 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbentry( C F G _ I S R A M _ B A S E , S Z _ 4 K , 0 x80 0 0 0 0 0 0 , 0 , A C _ R | A C _ W | A C _ X )
tlbentry( C F G _ I S R A M _ B A S E + 0 x10 0 0 , S Z _ 4 K , 0 x80 0 0 1 0 0 0 , 0 , A C _ R | A C _ W | A C _ X )
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 , 2 , 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 x00 0 0 0 0 0 0 , 3 , A C _ R | A C _ W | S A _ G | S A _ I )
tlbtab_ e n d