2 * arch/mips/dec/decstation.c
4 #include <asm/sections.h>
11 * Magic number indicating REX PROM available on DECSTATION.
13 #define REX_PROM_MAGIC 0x30464354
15 #define REX_PROM_CLEARCACHE 0x7c/4
16 #define REX_PROM_PRINTF 0x30/4
18 #define VEC_RESET 0xBFC00000 /* Prom base address */
19 #define PMAX_PROM_ENTRY(x) (VEC_RESET+((x)*8)) /* Prom jump table */
20 #define PMAX_PROM_PRINTF PMAX_PROM_ENTRY(17)
22 #define PARAM (k_start + 0x2000)
24 #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
25 #define INITRD_START (*(unsigned long *) (PARAM+0x218))
26 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
28 extern int _ftext; /* begin and end of kernel image */
29 extern void kernel_entry(int, char **, unsigned long, int *);
31 void * memcpy(void * dest, const void *src, unsigned int count)
33 unsigned long *tmp = (unsigned long *) dest, *s = (unsigned long *) src;
42 void dec_entry(int argc, char **argv,
43 unsigned long magic, int *prom_vec)
45 void (*rex_clear_cache)(void);
46 int (*prom_printf)(char *, ...);
47 unsigned long k_start, len;
50 * The DS5100 leaves cpu with BEV enabled, clear it.
52 asm( "lui\t$8,0x3000\n\t"
54 ".section\t.sdata\n\t"
60 if (magic == REX_PROM_MAGIC) {
61 prom_printf = (int (*)(char *, ...)) *(prom_vec + REX_PROM_PRINTF);
63 prom_printf = (int (*)(char *, ...)) PMAX_PROM_PRINTF;
65 prom_printf("Launching kernel...\n");
68 k_start = (unsigned long) (&kernel_entry) & 0xffff0000;
72 * Now copy kernel image to its destination.
74 len = ((unsigned long) (&_end) - k_start);
75 memcpy((void *)k_start, &_ftext, len);
78 if (magic == REX_PROM_MAGIC) {
79 rex_clear_cache = (void (*)(void)) * (prom_vec + REX_PROM_CLEARCACHE);
83 kernel_entry(argc, argv, magic, prom_vec);