arch/tile: allow querying cpu module information from the hypervisor
authorChris Metcalf <cmetcalf@tilera.com>
Fri, 30 Mar 2012 20:21:17 +0000 (16:21 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Fri, 25 May 2012 16:48:28 +0000 (12:48 -0400)
This just adds a few more attributes to the information Linux
can query from the hypervisor for the /sys/hypervisor/board/ directory,
providing part, serial#, revision#, and description for cpu modules
(as opposed to the board itself, or any mezzanine boards).

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/include/hv/hypervisor.h
arch/tile/kernel/sysfs.c

index 85e5cab4c2f0abc6843a29c12254a76f7b0888ee..ccd847e2347f14b2f1c4b54e2605b30a6a99aa17 100644 (file)
@@ -508,7 +508,19 @@ typedef enum {
   HV_CONFSTR_SWITCH_CONTROL  = 14,
 
   /** Chip revision level. */
-  HV_CONFSTR_CHIP_REV        = 15
+  HV_CONFSTR_CHIP_REV        = 15,
+
+  /** CPU module part number. */
+  HV_CONFSTR_CPUMOD_PART_NUM = 16,
+
+  /** CPU module serial number. */
+  HV_CONFSTR_CPUMOD_SERIAL_NUM = 17,
+
+  /** CPU module revision level. */
+  HV_CONFSTR_CPUMOD_REV      = 18,
+
+  /** Human-readable CPU module description. */
+  HV_CONFSTR_CPUMOD_DESC     = 19
 
 } HV_ConfstrQuery;
 
index 71ae728e9d0be08eda450eb6b35076755086c528..e25b0a89c18f8e7c63cc3391477f8cadb255f468 100644 (file)
@@ -93,6 +93,10 @@ HV_CONF_ATTR(mezz_part,              HV_CONFSTR_MEZZ_PART_NUM)
 HV_CONF_ATTR(mezz_serial,      HV_CONFSTR_MEZZ_SERIAL_NUM)
 HV_CONF_ATTR(mezz_revision,    HV_CONFSTR_MEZZ_REV)
 HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC)
+HV_CONF_ATTR(cpumod_part,      HV_CONFSTR_CPUMOD_PART_NUM)
+HV_CONF_ATTR(cpumod_serial,    HV_CONFSTR_CPUMOD_SERIAL_NUM)
+HV_CONF_ATTR(cpumod_revision,  HV_CONFSTR_CPUMOD_REV)
+HV_CONF_ATTR(cpumod_description,HV_CONFSTR_CPUMOD_DESC)
 HV_CONF_ATTR(switch_control,   HV_CONFSTR_SWITCH_CONTROL)
 
 static struct attribute *board_attrs[] = {
@@ -104,6 +108,10 @@ static struct attribute *board_attrs[] = {
        &dev_attr_mezz_serial.attr,
        &dev_attr_mezz_revision.attr,
        &dev_attr_mezz_description.attr,
+       &dev_attr_cpumod_part.attr,
+       &dev_attr_cpumod_serial.attr,
+       &dev_attr_cpumod_revision.attr,
+       &dev_attr_cpumod_description.attr,
        &dev_attr_switch_control.attr,
        NULL
 };