root/arch/sparc/kernel/cpu.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. cpu_probe

   1 /* cpu.c: Dinky routines to look for the kind of Sparc cpu
   2  *        we are on.
   3  *
   4  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
   5  */
   6 
   7 #include <linux/kernel.h>
   8 
   9 #include <asm/oplib.h>
  10 #include <asm/head.h>
  11 #include <asm/psr.h>
  12 #include <asm/mbus.h>
  13 
  14 struct cpu_iu_info {
  15   int psr_impl;
  16   int psr_vers;
  17   char* cpu_name;   /* should be enough I hope... */
  18 };
  19 
  20 struct cpu_fp_info {
  21   int psr_impl;
  22   int fp_vers;
  23   char* fp_name;
  24 };
  25 
  26 /* In order to get the fpu type correct, you need to take the IDPROM's
  27  * machine type value into consideration too.  I will fix this.
  28  */
  29 struct cpu_fp_info linux_sparc_fpu[] = {
  30   { 0, 0, "Fujitsu MB86910 or Weitek WTL1164/5"},
  31   { 0, 1, "Fujitsu MB86911 or Weitek WTL1164/5 or LSI L64831"},
  32   { 0, 2, "LSI Logic L64802 or Texas Instruments ACT8847"},
  33   /* SparcStation SLC, SparcStation1 */
  34   { 0, 3, "Weitek WTL3170/2"},
  35   /* SPARCstation-5 */
  36   { 0, 4, "Lsi Logic/Meiko L64804 or compatible"},
  37   { 0, 5, "reserved"},
  38   { 0, 6, "reserved"},
  39   { 0, 7, "No FPU"},
  40   { 1, 0, "ROSS HyperSparc combined IU/FPU"},
  41   { 1, 1, "Lsi Logic L64814"},
  42   { 1, 2, "Texas Instruments TMS390-C602A"},
  43   { 1, 3, "Cypress CY7C602 FPU"},
  44   { 1, 4, "reserved"},
  45   { 1, 5, "reserved"},
  46   { 1, 6, "reserved"},
  47   { 1, 7, "No FPU"},
  48   { 2, 0, "BIT B5010 or B5110/20 or B5210"},
  49   { 2, 1, "reserved"},
  50   { 2, 2, "reserved"},
  51   { 2, 3, "reserved"},
  52   { 2, 4, "reserved"},
  53   { 2, 5, "reserved"},
  54   { 2, 6, "reserved"},
  55   { 2, 7, "No FPU"},
  56   /* SuperSparc 50 module */
  57   { 4, 0, "SuperSparc on-chip FPU"},
  58   /* SparcClassic */
  59   { 4, 4, "TI MicroSparc on chip FPU"},
  60   { 5, 0, "Matsushita MN10501"},
  61   { 5, 1, "reserved"},
  62   { 5, 2, "reserved"},
  63   { 5, 3, "reserved"},
  64   { 5, 4, "reserved"},
  65   { 5, 5, "reserved"},
  66   { 5, 6, "reserved"},
  67   { 5, 7, "No FPU"},
  68 };
  69 
  70 #define NSPARCFPU  (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info))
  71 
  72 struct cpu_iu_info linux_sparc_chips[] = {
  73   /* Sun4/100, 4/200, SLC */
  74   { 0, 0, "Fujitsu  MB86900/1A or LSI L64831 SparcKIT-40"},
  75   /* borned STP1012PGA */
  76   { 0, 4, "Fujitsu  MB86904"},
  77   /* SparcStation2, SparcServer 490 & 690 */
  78   { 1, 0, "LSI Logic Corporation - L64811"},
  79   /* SparcStation2 */
  80   { 1, 1, "Cypress/ROSS CY7C601"},
  81   /* Embedded controller */
  82   { 1, 3, "Cypress/ROSS CY7C611"},
  83   /* Ross Technologies HyperSparc */
  84   { 1, 0xf, "ROSS HyperSparc RT620"},
  85   { 1, 0xe, "ROSS HyperSparc RT625"},
  86   /* ECL Implementation, CRAY S-MP Supercomputer... AIEEE! */
  87   /* Someone please write the code to support this beast! ;) */
  88   { 2, 0, "Bipolar Integrated Technology - B5010"},
  89   { 3, 0, "LSI Logic Corporation - unknown-type"},
  90   { 4, 0, "Texas Instruments, Inc. - SuperSparc 50"},
  91   /* SparcClassic  --  borned STP1010TAB-50*/
  92   { 4, 1, "Texas Instruments, Inc. - MicroSparc"},
  93   { 4, 2, "Texas Instruments, Inc. - MicroSparc II"},
  94   { 4, 3, "Texas Instruments, Inc. - SuperSparc 51"},
  95   { 4, 4, "Texas Instruments, Inc. - SuperSparc 61"},
  96   { 4, 5, "Texas Instruments, Inc. - unknown"},
  97   { 5, 0, "Matsushita - MN10501"},
  98   { 6, 0, "Philips Corporation - unknown"},
  99   { 7, 0, "Harvest VLSI Design Center, Inc. - unknown"},
 100   /* Gallium arsenide 200MHz, BOOOOGOOOOMIPS!!! */
 101   { 8, 0, "Systems and Processes Engineering Corporation (SPEC)"},
 102   { 9, 0, "Fujitsu #3"},
 103   { 0xa, 0, "UNKNOWN CPU-VENDOR/TYPE"},
 104   { 0xb, 0, "UNKNOWN CPU-VENDOR/TYPE"},
 105   { 0xc, 0, "UNKNOWN CPU-VENDOR/TYPE"},
 106   { 0xd, 0, "UNKNOWN CPU-VENDOR/TYPE"},
 107   { 0xe, 0, "UNKNOWN CPU-VENDOR/TYPE"},
 108   { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"},
 109 };
 110 
 111 #define NSPARCCHIPS  (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info))
 112 
 113 char *sparc_cpu_type[NCPUS] = { "cpu-oops", "cpu-oops1", "cpu-oops2", "cpu-oops3" };
 114 char *sparc_fpu_type[NCPUS] = { "fpu-oops", "fpu-oops1", "fpu-oops2", "fpu-oops3" };
 115 
 116 unsigned int fsr_storage;
 117 
 118 void
 119 cpu_probe(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 120 {
 121         int psr_impl, psr_vers, fpu_vers;
 122         int i, cpuid;
 123 
 124         cpuid = get_cpuid();
 125 
 126         psr_impl = ((get_psr()>>28)&0xf);
 127         psr_vers = ((get_psr()>>24)&0xf);
 128 
 129         fpu_vers = ((get_fsr()>>17)&0x7);
 130 
 131         for(i = 0; i<NSPARCCHIPS; i++) {
 132                 if(linux_sparc_chips[i].psr_impl == psr_impl)
 133                         if(linux_sparc_chips[i].psr_vers == psr_vers) {
 134                                 sparc_cpu_type[cpuid] = linux_sparc_chips[i].cpu_name;
 135                                 break;
 136                         }
 137         }
 138 
 139         if(i==NSPARCCHIPS)
 140                 printk("DEBUG: psr.impl = 0x%x   psr.vers = 0x%x\n", psr_impl, 
 141                             psr_vers);
 142 
 143         for(i = 0; i<NSPARCFPU; i++) {
 144                 if(linux_sparc_fpu[i].psr_impl == psr_impl)
 145                         if(linux_sparc_fpu[i].fp_vers == fpu_vers) {
 146                                 sparc_fpu_type[cpuid] = linux_sparc_fpu[i].fp_name;
 147                                 break;
 148                         }
 149         }
 150 
 151         if(i == NSPARCFPU) {
 152                 printk("DEBUG: psr.impl = 0x%x  fsr.vers = 0x%x\n", psr_impl,
 153                             fpu_vers);
 154                 sparc_fpu_type[cpuid] = linux_sparc_fpu[31].fp_name;
 155         }
 156 }

/* [previous][next][first][last][top][bottom][index][help] */