]> Git Repo - linux.git/commitdiff
Pull model-name into release branch
authorTony Luck <[email protected]>
Tue, 26 Sep 2006 16:47:04 +0000 (09:47 -0700)
committerTony Luck <[email protected]>
Tue, 26 Sep 2006 16:47:04 +0000 (09:47 -0700)
1  2 
arch/ia64/kernel/setup.c
include/asm-ia64/pal.h
include/asm-ia64/processor.h

diff --combined arch/ia64/kernel/setup.c
index 7ad0d9cc6db65c1503cc3a69259954633c6c5991,3f7067c68b08e3d00c6b43c4045407f1defdd12b..84f93c0f2c666b15d3f70c3df47c3c17a5949ad0
@@@ -22,6 -22,7 +22,6 @@@
   * 06/24/99 W.Drummond        added boot_cpu_data.
   * 05/28/05 Z. Menyhart       Dynamic stride size for "flush_icache_range()"
   */
 -#include <linux/config.h>
  #include <linux/module.h>
  #include <linux/init.h>
  
@@@ -35,7 -36,7 +35,7 @@@
  #include <linux/seq_file.h>
  #include <linux/string.h>
  #include <linux/threads.h>
 -#include <linux/tty.h>
 +#include <linux/screen_info.h>
  #include <linux/dmi.h>
  #include <linux/serial.h>
  #include <linux/serial_core.h>
@@@ -259,7 -260,6 +259,7 @@@ reserve_memory (void
        n++;
  
        num_rsvd_regions = n;
 +      BUG_ON(IA64_MAX_RSVD_REGIONS + 1 < n);
  
        sort_regions(rsvd_region, num_rsvd_regions);
  }
@@@ -509,7 -509,7 +509,7 @@@ show_cpuinfo (struct seq_file *m, void 
                { 1UL << 1, "spontaneous deferral"},
                { 1UL << 2, "16-byte atomic ops" }
        };
-       char family[32], features[128], *cp, sep;
+       char features[128], *cp, sep;
        struct cpuinfo_ia64 *c = v;
        unsigned long mask;
        unsigned long proc_freq;
  
        mask = c->features;
  
-       switch (c->family) {
-             case 0x07:        memcpy(family, "Itanium", 8); break;
-             case 0x1f:        memcpy(family, "Itanium 2", 10); break;
-             default:          sprintf(family, "%u", c->family); break;
-       }
        /* build the feature string: */
        memcpy(features, " standard", 10);
        cp = features;
                   "processor  : %d\n"
                   "vendor     : %s\n"
                   "arch       : IA-64\n"
-                  "family     : %s\n"
+                  "family     : %u\n"
                   "model      : %u\n"
+                  "model name : %s\n"
                   "revision   : %u\n"
                   "archrev    : %u\n"
                   "features   :%s\n"   /* don't change this---it _is_ right! */
                   "cpu MHz    : %lu.%06lu\n"
                   "itc MHz    : %lu.%06lu\n"
                   "BogoMIPS   : %lu.%02lu\n",
-                  cpunum, c->vendor, family, c->model, c->revision, c->archrev,
+                  cpunum, c->vendor, c->family, c->model,
+                  c->model_name, c->revision, c->archrev,
                   features, c->ppn, c->number,
                   proc_freq / 1000, proc_freq % 1000,
                   c->itc_freq / 1000000, c->itc_freq % 1000000,
@@@ -611,6 -607,31 +607,31 @@@ struct seq_operations cpuinfo_op = 
        .show =         show_cpuinfo
  };
  
+ static char brandname[128];
+ static char * __cpuinit
+ get_model_name(__u8 family, __u8 model)
+ {
+       char brand[128];
+       if (ia64_pal_get_brand_info(brand)) {
+               if (family == 0x7)
+                       memcpy(brand, "Merced", 7);
+               else if (family == 0x1f) switch (model) {
+                       case 0: memcpy(brand, "McKinley", 9); break;
+                       case 1: memcpy(brand, "Madison", 8); break;
+                       case 2: memcpy(brand, "Madison up to 9M cache", 23); break;
+               } else
+                       memcpy(brand, "Unknown", 8);
+       }
+       if (brandname[0] == '\0')
+               return strcpy(brandname, brand);
+       else if (strcmp(brandname, brand) == 0)
+               return brandname;
+       else
+               return kstrdup(brand, GFP_KERNEL);
+ }
  static void __cpuinit
  identify_cpu (struct cpuinfo_ia64 *c)
  {
        pal_status_t status;
        unsigned long impl_va_msb = 50, phys_addr_size = 44;    /* Itanium defaults */
        int i;
        for (i = 0; i < 5; ++i)
                cpuid.bits[i] = ia64_get_cpuid(i);
  
        c->family = cpuid.field.family;
        c->archrev = cpuid.field.archrev;
        c->features = cpuid.field.features;
+       c->model_name = get_model_name(c->family, c->model);
  
        status = ia64_pal_vm_summary(&vm1, &vm2);
        if (status == PAL_STATUS_SUCCESS) {
diff --combined include/asm-ia64/pal.h
index 20a8d618c8454776b441245317c21d7e19444a87,312109d7be978851aade88438d46e7f03a9974b8..d1587e4f57595ef52433cdfd5549899e78d6d4fe
@@@ -78,6 -78,7 +78,7 @@@
  #define PAL_VM_TR_READ                261     /* read contents of translation register */
  #define PAL_GET_PSTATE                262     /* get the current P-state */
  #define PAL_SET_PSTATE                263     /* set the P-state */
+ #define PAL_BRAND_INFO                274     /* Processor branding information */
  
  #ifndef __ASSEMBLY__
  
@@@ -1133,6 -1134,15 +1134,15 @@@ ia64_pal_set_pstate (u64 pstate_index
        return iprv.status;
  }
  
+ /* Processor branding information*/
+ static inline s64
+ ia64_pal_get_brand_info (char *brand_info)
+ {
+       struct ia64_pal_retval iprv;
+       PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0);
+       return iprv.status;
+ }
  /* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
   * suspended, but cache and TLB coherency is maintained.
   */
@@@ -1433,12 -1443,7 +1443,12 @@@ typedef union  pal_version_u 
  } pal_version_u_t;
  
  
 -/* Return PAL version information */
 +/*
 + * Return PAL version information.  While the documentation states that
 + * PAL_VERSION can be called in either physical or virtual mode, some
 + * implementations only allow physical calls.  We don't call it very often,
 + * so the overhead isn't worth eliminating.
 + */
  static inline s64
  ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
  {
index 265f4824db0e2e6ea04abc225f81758547a8de62,03100c4272c6bd36d2b35bf88368bba8bc3c0a8a..ead68f8eb883cd254c8801ce59a61640e1f5d2c8
@@@ -13,6 -13,7 +13,6 @@@
   * 06/16/00   A. Mallick      added csd/ssd/tssd for ia32 support
   */
  
 -#include <linux/config.h>
  
  #include <asm/intrinsics.h>
  #include <asm/kregs.h>
@@@ -163,6 -164,7 +163,7 @@@ struct cpuinfo_ia64 
        __u8 family;
        __u8 archrev;
        char vendor[16];
+       char *model_name;
  
  #ifdef CONFIG_NUMA
        struct ia64_node_data *node_data;
This page took 0.067742 seconds and 4 git commands to generate.