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

TOMOYO Linux Cross Reference
Linux/arch/mips/dec/prom/init.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/mips/dec/prom/init.c (Architecture ppc) and /arch/mips/dec/prom/init.c (Architecture mips)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2 /*                                                  2 /*
  3  * init.c: PROM library initialisation code.        3  * init.c: PROM library initialisation code.
  4  *                                                  4  *
  5  * Copyright (C) 1998 Harald Koerfgen               5  * Copyright (C) 1998 Harald Koerfgen
  6  * Copyright (C) 2002, 2004  Maciej W. Rozycki      6  * Copyright (C) 2002, 2004  Maciej W. Rozycki
  7  */                                                 7  */
  8 #include <linux/init.h>                             8 #include <linux/init.h>
  9 #include <linux/kernel.h>                           9 #include <linux/kernel.h>
 10 #include <linux/linkage.h>                         10 #include <linux/linkage.h>
 11 #include <linux/smp.h>                             11 #include <linux/smp.h>
 12 #include <linux/string.h>                          12 #include <linux/string.h>
 13 #include <linux/types.h>                           13 #include <linux/types.h>
 14                                                    14 
 15 #include <asm/bootinfo.h>                          15 #include <asm/bootinfo.h>
 16 #include <asm/cpu.h>                               16 #include <asm/cpu.h>
 17 #include <asm/cpu-type.h>                          17 #include <asm/cpu-type.h>
 18 #include <asm/processor.h>                         18 #include <asm/processor.h>
 19                                                    19 
 20 #include <asm/dec/prom.h>                          20 #include <asm/dec/prom.h>
 21                                                    21 
 22                                                    22 
 23 int (*__rex_bootinit)(void);                       23 int (*__rex_bootinit)(void);
 24 int (*__rex_bootread)(void);                       24 int (*__rex_bootread)(void);
 25 int (*__rex_getbitmap)(memmap *);                  25 int (*__rex_getbitmap)(memmap *);
 26 unsigned long *(*__rex_slot_address)(int);         26 unsigned long *(*__rex_slot_address)(int);
 27 void *(*__rex_gettcinfo)(void);                    27 void *(*__rex_gettcinfo)(void);
 28 int (*__rex_getsysid)(void);                       28 int (*__rex_getsysid)(void);
 29 void (*__rex_clear_cache)(void);                   29 void (*__rex_clear_cache)(void);
 30                                                    30 
 31 int (*__prom_getchar)(void);                       31 int (*__prom_getchar)(void);
 32 char *(*__prom_getenv)(char *);                    32 char *(*__prom_getenv)(char *);
 33 int (*__prom_printf)(char *, ...);                 33 int (*__prom_printf)(char *, ...);
 34                                                    34 
 35 int (*__pmax_open)(char*, int);                    35 int (*__pmax_open)(char*, int);
 36 int (*__pmax_lseek)(int, long, int);               36 int (*__pmax_lseek)(int, long, int);
 37 int (*__pmax_read)(int, void *, int);              37 int (*__pmax_read)(int, void *, int);
 38 int (*__pmax_close)(int);                          38 int (*__pmax_close)(int);
 39                                                    39 
 40                                                    40 
 41 /*                                                 41 /*
 42  * Detect which PROM the DECSTATION has, and s     42  * Detect which PROM the DECSTATION has, and set the callback vectors
 43  * appropriately.                                  43  * appropriately.
 44  */                                                44  */
 45 void __init which_prom(s32 magic, s32 *prom_ve     45 void __init which_prom(s32 magic, s32 *prom_vec)
 46 {                                                  46 {
 47         /*                                         47         /*
 48          * No sign of the REX PROM's magic num     48          * No sign of the REX PROM's magic number means we assume a non-REX
 49          * machine (i.e. we're on a DS2100/310     49          * machine (i.e. we're on a DS2100/3100, DS5100 or DS5000/2xx)
 50          */                                        50          */
 51         if (prom_is_rex(magic)) {                  51         if (prom_is_rex(magic)) {
 52                 /*                                 52                 /*
 53                  * Set up prom abstraction str     53                  * Set up prom abstraction structure with REX entry points.
 54                  */                                54                  */
 55                 __rex_bootinit =                   55                 __rex_bootinit =
 56                         (void *)(long)*(prom_v     56                         (void *)(long)*(prom_vec + REX_PROM_BOOTINIT);
 57                 __rex_bootread =                   57                 __rex_bootread =
 58                         (void *)(long)*(prom_v     58                         (void *)(long)*(prom_vec + REX_PROM_BOOTREAD);
 59                 __rex_getbitmap =                  59                 __rex_getbitmap =
 60                         (void *)(long)*(prom_v     60                         (void *)(long)*(prom_vec + REX_PROM_GETBITMAP);
 61                 __prom_getchar =                   61                 __prom_getchar =
 62                         (void *)(long)*(prom_v     62                         (void *)(long)*(prom_vec + REX_PROM_GETCHAR);
 63                 __prom_getenv =                    63                 __prom_getenv =
 64                         (void *)(long)*(prom_v     64                         (void *)(long)*(prom_vec + REX_PROM_GETENV);
 65                 __rex_getsysid =                   65                 __rex_getsysid =
 66                         (void *)(long)*(prom_v     66                         (void *)(long)*(prom_vec + REX_PROM_GETSYSID);
 67                 __rex_gettcinfo =                  67                 __rex_gettcinfo =
 68                         (void *)(long)*(prom_v     68                         (void *)(long)*(prom_vec + REX_PROM_GETTCINFO);
 69                 __prom_printf =                    69                 __prom_printf =
 70                         (void *)(long)*(prom_v     70                         (void *)(long)*(prom_vec + REX_PROM_PRINTF);
 71                 __rex_slot_address =               71                 __rex_slot_address =
 72                         (void *)(long)*(prom_v     72                         (void *)(long)*(prom_vec + REX_PROM_SLOTADDR);
 73                 __rex_clear_cache =                73                 __rex_clear_cache =
 74                         (void *)(long)*(prom_v     74                         (void *)(long)*(prom_vec + REX_PROM_CLEARCACHE);
 75         } else {                                   75         } else {
 76                 /*                                 76                 /*
 77                  * Set up prom abstraction str     77                  * Set up prom abstraction structure with non-REX entry points.
 78                  */                                78                  */
 79                 __prom_getchar = (void *)PMAX_     79                 __prom_getchar = (void *)PMAX_PROM_GETCHAR;
 80                 __prom_getenv = (void *)PMAX_P     80                 __prom_getenv = (void *)PMAX_PROM_GETENV;
 81                 __prom_printf = (void *)PMAX_P     81                 __prom_printf = (void *)PMAX_PROM_PRINTF;
 82                 __pmax_open = (void *)PMAX_PRO     82                 __pmax_open = (void *)PMAX_PROM_OPEN;
 83                 __pmax_lseek = (void *)PMAX_PR     83                 __pmax_lseek = (void *)PMAX_PROM_LSEEK;
 84                 __pmax_read = (void *)PMAX_PRO     84                 __pmax_read = (void *)PMAX_PROM_READ;
 85                 __pmax_close = (void *)PMAX_PR     85                 __pmax_close = (void *)PMAX_PROM_CLOSE;
 86         }                                          86         }
 87 }                                                  87 }
 88                                                    88 
 89 void __init prom_init(void)                        89 void __init prom_init(void)
 90 {                                                  90 {
 91         extern void dec_machine_halt(void);        91         extern void dec_machine_halt(void);
 92         static const char cpu_msg[] __initcons     92         static const char cpu_msg[] __initconst =
 93                 "Sorry, this kernel is compile     93                 "Sorry, this kernel is compiled for a wrong CPU type!\n";
 94         s32 argc = fw_arg0;                        94         s32 argc = fw_arg0;
 95         s32 *argv = (void *)fw_arg1;               95         s32 *argv = (void *)fw_arg1;
 96         u32 magic = fw_arg2;                       96         u32 magic = fw_arg2;
 97         s32 *prom_vec = (void *)fw_arg3;           97         s32 *prom_vec = (void *)fw_arg3;
 98                                                    98 
 99         /*                                         99         /*
100          * Determine which PROM we have           100          * Determine which PROM we have
101          * (and therefore which machine we're     101          * (and therefore which machine we're on!)
102          */                                       102          */
103         which_prom(magic, prom_vec);              103         which_prom(magic, prom_vec);
104                                                   104 
105         if (prom_is_rex(magic))                   105         if (prom_is_rex(magic))
106                 rex_clear_cache();                106                 rex_clear_cache();
107                                                   107 
108         /* Register the early console.  */        108         /* Register the early console.  */
109         register_prom_console();                  109         register_prom_console();
110                                                   110 
111         /* Were we compiled with the right CPU    111         /* Were we compiled with the right CPU option? */
112 #if defined(CONFIG_CPU_R3000)                     112 #if defined(CONFIG_CPU_R3000)
113         if ((current_cpu_type() == CPU_R4000SC    113         if ((current_cpu_type() == CPU_R4000SC) ||
114             (current_cpu_type() == CPU_R4400SC    114             (current_cpu_type() == CPU_R4400SC)) {
115                 static const char r4k_msg[] __    115                 static const char r4k_msg[] __initconst =
116                         "Please recompile with    116                         "Please recompile with \"CONFIG_CPU_R4X00 = y\".\n";
117                 printk(cpu_msg);                  117                 printk(cpu_msg);
118                 printk(r4k_msg);                  118                 printk(r4k_msg);
119                 dec_machine_halt();               119                 dec_machine_halt();
120         }                                         120         }
121 #endif                                            121 #endif
122                                                   122 
123 #if defined(CONFIG_CPU_R4X00)                     123 #if defined(CONFIG_CPU_R4X00)
124         if ((current_cpu_type() == CPU_R3000)     124         if ((current_cpu_type() == CPU_R3000) ||
125             (current_cpu_type() == CPU_R3000A)    125             (current_cpu_type() == CPU_R3000A)) {
126                 static const char r3k_msg[] __    126                 static const char r3k_msg[] __initconst =
127                         "Please recompile with    127                         "Please recompile with \"CONFIG_CPU_R3000 = y\".\n";
128                 printk(cpu_msg);                  128                 printk(cpu_msg);
129                 printk(r3k_msg);                  129                 printk(r3k_msg);
130                 dec_machine_halt();               130                 dec_machine_halt();
131         }                                         131         }
132 #endif                                            132 #endif
133                                                   133 
134         prom_meminit(magic);                      134         prom_meminit(magic);
135         prom_identify_arch(magic);                135         prom_identify_arch(magic);
136         prom_init_cmdline(argc, argv, magic);     136         prom_init_cmdline(argc, argv, magic);
137 }                                                 137 }
138                                                   138 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php