diff options
author | Wael El-Essawy <welessa@us.ibm.com> | 2017-03-30 16:55:56 -0500 |
---|---|---|
committer | William A. Bryan <wilbryan@us.ibm.com> | 2017-04-03 15:23:34 -0400 |
commit | 3b1b654a2e720ceb2709412ac2c5e091fcf2e76a (patch) | |
tree | 5c5afea32f0d931e794adb8a4119ff0c59bec3e6 /src | |
parent | b5adc50ad8cda541c0d1d0c253e7899651af347d (diff) | |
download | talos-occ-3b1b654a2e720ceb2709412ac2c5e091fcf2e76a.tar.gz talos-occ-3b1b654a2e720ceb2709412ac2c5e091fcf2e76a.zip |
Fix Sensor Location bug
AMEC_SENSOR_LOC_UNKNOWN is invalid sensor location, since it is defined as 0.
If an additional location is needed to define any driven/virtual sensor, a
new entry should be added to the AMEC_SENSOR_LOC enum (e.g., AMEC_SENSOR_LOC_FW),
and that new location have a 1 in its bit vector. This way, the existing
amester code would be ble to handle it properly in the initial sensor scan
routine.
Change-Id: I61dbd77fcadff2f81acfc42fde682f3659654b93
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38664
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/occ_405/sensor/sensor.h | 18 | ||||
-rwxr-xr-x | src/occ_405/sensor/sensor_info.c | 6 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/occ_405/sensor/sensor.h b/src/occ_405/sensor/sensor.h index 24c518d..9f823a3 100755 --- a/src/occ_405/sensor/sensor.h +++ b/src/occ_405/sensor/sensor.h @@ -54,9 +54,16 @@ #define MAX_AMEC_SENSORS 710 #define VECTOR_SENSOR_DEFAULT_VAL 0xFF +// AMEC_SENSOR_TYPE_INVALID can not be used to identify sensor type. +// A bit vector mask is used to specify sensor types that AMESTER is +// probed for, and hence when a new sensor type is defined, it has to +// have only one bit set in its value (e.g., 0x01<<num). When all types +// are requested, a 0xFFFF mask (SENSOR_TYPE_ALL) is used to specify all +// types, which is the case for initial AMESTER sensor scan routine to +// detect all OCC sensors. typedef enum { - AMEC_SENSOR_TYPE_UNKNOWN = 0x0000, + AMEC_SENSOR_TYPE_INVALID = 0x0000, // Not a valid sensor type AMEC_SENSOR_TYPE_GENERIC = 0x0001, AMEC_SENSOR_TYPE_CURRENT = 0x0002, AMEC_SENSOR_TYPE_VOLTAGE = 0x0004, @@ -69,9 +76,16 @@ typedef enum AMEC_SENSOR_TYPE_ALL = 0xffff, }AMEC_SENSOR_TYPE; +// AMEC_SENSOR_LOC_INVALID can not be used to identify sensor location. +// A bit vector mask is used to specify sensor locations that AMESTER is +// probed for, and hence when a new sensor type is defined, it has to +// have exactly one bit set in its value (e.g., 0x01<<num). When sensors +// from all locations are requested, a 0xFFFF mask (SENSOR_LOC_ALL) is +// used to specify all locations, and that's the case in the initial +// AMESTER sensor scan routine. typedef enum { - AMEC_SENSOR_LOC_UNKNOWN = 0x0000, + AMEC_SENSOR_LOC_INVALID = 0x0000, // Not a valid sensor location. AMEC_SENSOR_LOC_SYS = 0x0001, AMEC_SENSOR_LOC_PROC = 0x0002, AMEC_SENSOR_LOC_LPAR = 0x0004, diff --git a/src/occ_405/sensor/sensor_info.c b/src/occ_405/sensor/sensor_info.c index 484c6b3..998eb3d 100755 --- a/src/occ_405/sensor/sensor_info.c +++ b/src/occ_405/sensor/sensor_info.c @@ -349,8 +349,8 @@ const sensor_info_t G_sensor_info[] = SENS_MEMC_ENTRY_SET( MIRC2MSP0M, "eps\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENS_MEMC_ENTRY_SET( MLP2P0M, "eps\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENS_DIMM_ENTRY_SET( TEMPDIMM, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_32MS_IN_HZ, AMEFP( 1, 0) ), - SENS_MEMC_ENTRY_SET( TEMPDIMMAXP0M, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_UNKNOWN, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), - SENS_MEMC_ENTRY_SET( LOCDIMMAXP0M, "loc\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_UNKNOWN, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENS_MEMC_ENTRY_SET( TEMPDIMMAXP0M, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), + SENS_MEMC_ENTRY_SET( LOCDIMMAXP0M, "loc\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_2MS_IN_HZ, AMEFP( 1, 0) ), /* ==CentaurSensors== NameString Units Type Location Number Freq ScaleFactor */ SEN_CENTR_ENTRY_SET( MAC2MSP0M, "rps\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), @@ -366,7 +366,7 @@ const sensor_info_t G_sensor_info[] = /* ==MemSummarySensors== NameString Units Type Location Number Freq ScaleFactor */ - SENSOR_INFO_T_ENTRY( TEMP2MSCENT, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_UNKNOWN, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), + SENSOR_INFO_T_ENTRY( TEMP2MSCENT, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( TEMPDIMMTHRM, "C\0", AMEC_SENSOR_TYPE_TEMP, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_32MS_IN_HZ, AMEFP( 1, 0) ), SENSOR_INFO_T_ENTRY( MEMSP2MS, "%\0", AMEC_SENSOR_TYPE_PERF, AMEC_SENSOR_LOC_MEM, AMEC_SENSOR_NONUM, AMEEFP_250US_IN_HZ, AMEFP( 1, 0) ), |