2 * arch/mips/dec/decstation.c
10 * Magic number indicating REX PROM available on DECSTATION.
12 #define REX_PROM_MAGIC 0x30464354
14 #define REX_PROM_CLEARCACHE 0x7c/4
15 #define REX_PROM_PRINTF 0x30/4
17 #define VEC_RESET 0xBFC00000 /* Prom base address */
18 #define PMAX_PROM_ENTRY(x) (VEC_RESET+((x)*8)) /* Prom jump table */
19 #define PMAX_PROM_PRINTF PMAX_PROM_ENTRY(17)
21 #define PARAM (k_start + 0x2000)
23 #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
24 #define INITRD_START (*(unsigned long *) (PARAM+0x218))
25 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
27 extern int _ftext
, _end
; /* begin and end of kernel image */
28 extern void kernel_entry(int, char **, unsigned long, int *);
30 void * memcpy(void * dest
, const void *src
, unsigned int count
)
32 unsigned long *tmp
= (unsigned long *) dest
, *s
= (unsigned long *) src
;
41 void dec_entry(int argc
, char **argv
,
42 unsigned long magic
, int *prom_vec
)
44 void (*rex_clear_cache
)(void);
45 int (*prom_printf
)(char *, ...);
46 unsigned long k_start
, len
;
49 * The DS5100 leaves cpu with BEV enabled, clear it.
51 asm( "lui\t$8,0x3000\n\t"
53 ".section\t.sdata\n\t"
59 if (magic
== REX_PROM_MAGIC
) {
60 prom_printf
= (int (*)(char *, ...)) *(prom_vec
+ REX_PROM_PRINTF
);
62 prom_printf
= (int (*)(char *, ...)) PMAX_PROM_PRINTF
;
64 prom_printf("Launching kernel...\n");
67 k_start
= (unsigned long) (&kernel_entry
) & 0xffff0000;
71 * Now copy kernel image to its destination.
73 len
= ((unsigned long) (&_end
) - k_start
);
74 memcpy((void *)k_start
, &_ftext
, len
);
77 if (magic
== REX_PROM_MAGIC
) {
78 rex_clear_cache
= (void (*)(void)) * (prom_vec
+ REX_PROM_CLEARCACHE
);
82 kernel_entry(argc
, argv
, magic
, prom_vec
);