~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/dec/boot/decstation.c

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/mips/dec/decstation.c
  3  */
  4 #include <linux/config.h>
  5 
  6 #define RELOC
  7 #define INITRD
  8 #define DEBUG_BOOT
  9 
 10 /*
 11  * Magic number indicating REX PROM available on DECSTATION.
 12  */
 13 #define REX_PROM_MAGIC          0x30464354
 14 
 15 #define REX_PROM_CLEARCACHE     0x7c/4
 16 #define REX_PROM_PRINTF         0x30/4
 17 
 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)
 21 
 22 #define PARAM   (k_start + 0x2000)
 23 
 24 #define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
 25 #define INITRD_START (*(unsigned long *) (PARAM+0x218))
 26 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
 27 
 28 extern int _ftext, _end;                /* begin and end of kernel image */
 29 extern void *__rd_start, *__rd_end;     /* begin and end of ramdisk image */
 30 extern void kernel_entry(int, char **, unsigned long, int *);
 31 
 32 void * memcpy(void * dest, const void *src, unsigned int count)
 33 {
 34         unsigned long *tmp = (unsigned long *) dest, *s = (unsigned long *) src;
 35 
 36         count >>= 2;
 37         while (count--)
 38                 *tmp++ = *s++;
 39 
 40         return dest;
 41 }
 42 
 43 void dec_entry(int argc, char **argv,
 44                unsigned long magic, int *prom_vec)
 45 {
 46         void (*rex_clear_cache)(void);
 47         int (*prom_printf)(char *, ...);
 48         unsigned long k_start, len;
 49 
 50         /*
 51          * The DS5100 leaves cpu with BEV enabled, clear it.
 52          */
 53         asm(    "lui\t$8,0x3000\n\t"
 54                 "mtc0\t$8,$12\n\t"
 55                 ".section\t.sdata\n\t"
 56                 ".section\t.sbss\n\t"
 57                 ".section\t.text"
 58                 : : : "$8");
 59 
 60 #ifdef DEBUG_BOOT
 61         if (magic == REX_PROM_MAGIC) {
 62         prom_printf = (int (*)(char *, ...)) *(prom_vec + REX_PROM_PRINTF);
 63         } else {
 64                 prom_printf = (int (*)(char *, ...)) PMAX_PROM_PRINTF;
 65         }
 66         prom_printf("Launching kernel...\n");
 67 #endif
 68 
 69         k_start = (unsigned long) (&kernel_entry) & 0xffff0000;
 70 
 71 #ifdef RELOC
 72         /*
 73          * Now copy kernel image to its destination.
 74          */
 75         len = ((unsigned long) (&_end) - k_start);
 76         memcpy((void *)k_start, &_ftext, len);
 77 #endif
 78 
 79         if (magic == REX_PROM_MAGIC) {
 80                 rex_clear_cache = (void (*)(void)) * (prom_vec + REX_PROM_CLEARCACHE);
 81                 rex_clear_cache();
 82         }
 83 
 84 #ifdef CONFIG_BLK_DEV_INITRD
 85         LOADER_TYPE = 1;
 86         INITRD_START = (long)&__rd_start;
 87         INITRD_SIZE = (long)&__rd_end - (long)&__rd_start;
 88 #endif
 89 
 90         kernel_entry(argc, argv, magic, prom_vec);
 91 }
 92 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp