@ -22,13 +22,11 @@
* MA 0 2 1 1 1 - 1 3 0 7 U S A
* /
# include < c o n f i g . h >
# include < v e r s i o n . h >
# include < a s m / r e g d e f . h >
# include < a s m / m i p s r e g s . h >
# define R V E C E N T ( f ,n ) \
b f ; nop
# define X V E C E N T ( f ,b e v ) \
@ -192,7 +190,7 @@ _start:
.word 0x00000000
.word 0x03e00008
.word 0x00000000
.word 0x00000000
.word 0x00000000
/* 0xbfc00428 */
.word 0xdc870000
.word 0xfca70000
@ -203,7 +201,7 @@ _start:
.word 0x00000000
.word 0x03e00008
.word 0x00000000
.word 0x00000000
.word 0x00000000
# endif / * C O N F I G _ P U R P L E * /
.align 4
reset :
@ -235,33 +233,33 @@ reset:
mtc0 t 0 , C P 0 _ C O N F I G
/ * Initialize $ g p .
* /
bal 1 f
* /
bal 1 f
nop
.word _gp
1 :
move g p , r a
lw t 1 , 0 ( r a )
1 :
move g p , r a
lw t 1 , 0 ( r a )
move g p , t 1
# ifdef C O N F I G _ I N C A _ I P
/ * Disable I N C A - I P W a t c h d o g .
* /
la t 9 , d i s a b l e _ i n c a i p _ w d t
jalr t 9
la t 9 , d i s a b l e _ i n c a i p _ w d t
jalr t 9
nop
# endif
/ * Initialize a n y e x t e r n a l m e m o r y .
* /
la t 9 , l o w l e v e l _ i n i t
jalr t 9
la t 9 , l o w l e v e l _ i n i t
jalr t 9
nop
/ * Initialize c a c h e s . . .
* /
la t 9 , m i p s _ c a c h e _ r e s e t
jalr t 9
la t 9 , m i p s _ c a c h e _ r e s e t
jalr t 9
nop
/ * . . . and e n a b l e t h e m .
@ -269,12 +267,11 @@ reset:
li t 0 , C O N F _ C M _ C A C H A B L E _ N O N C O H E R E N T
mtc0 t 0 , C P 0 _ C O N F I G
/ * Set u p t e m p o r a r y s t a c k .
* /
li a0 , C F G _ I N I T _ S P _ O F F S E T
la t 9 , m i p s _ c a c h e _ l o c k
jalr t 9
la t 9 , m i p s _ c a c h e _ l o c k
jalr t 9
nop
li t 0 , C F G _ S D R A M _ B A S E + C F G _ I N I T _ S P _ O F F S E T
@ -284,7 +281,6 @@ reset:
j t 9
nop
/ *
* void r e l o c a t e _ c o d e ( a d d r _ s p , g d , a d d r _ m o n i )
*
@ -298,7 +294,7 @@ reset:
.globl relocate_code
.ent relocate_code
relocate_code :
move s p , a0 / * S e t n e w s t a c k p o i n t e r * /
move s p , a0 / * S e t n e w s t a c k p o i n t e r * /
li t 0 , C F G _ M O N I T O R _ B A S E
la t 3 , i n _ r a m
@ -312,8 +308,8 @@ relocate_code:
* /
move t 6 , g p
sub g p , C F G _ M O N I T O R _ B A S E
add g p , a2 / * g p n o w a d j u s t e d * /
sub t 6 , g p , t 6 / * t 6 < - - r e l o c a t i o n o f f s e t * /
add g p , a2 / * g p n o w a d j u s t e d * /
sub t 6 , g p , t 6 / * t 6 < - - r e l o c a t i o n o f f s e t * /
/ *
* t0 = s o u r c e a d d r e s s
@ -329,7 +325,7 @@ relocate_code:
sw t 3 , 0 ( t 1 )
addu t 0 , 4
ble t 0 , t 2 , 1 b
addu t 1 , 4 / * d e l a y s l o t * /
addu t 1 , 4 / * d e l a y s l o t * /
# endif
/ * If c a c h e s w e r e e n a b l e d , w e w o u l d h a v e t o f l u s h t h e m h e r e .
@ -376,7 +372,8 @@ in_ram:
add t 2 , t 6
sub t 1 , 4
1 : addi t 1 , 4
1 :
addi t 1 , 4
bltl t 1 , t 2 , 1 b
sw z e r o , 0 ( t 1 ) / * d e l a y s l o t * /
@ -387,11 +384,10 @@ in_ram:
.end relocate_code
/ * Exception h a n d l e r s .
* /
romReserved :
b r o m R e s e r v e d
b r o m R e s e r v e d
romExcHandle :
b r o m E x c H a n d l e
b r o m E x c H a n d l e