[Skiboot] [RFC V3] sensors: occ: Add support for OCC inband sensors

Shilpasri G Bhat shilpa.bhat at linux.vnet.ibm.com
Thu Mar 30 23:27:37 AEDT 2017



On 03/30/2017 05:54 PM, Cédric Le Goater wrote:
> On 03/30/2017 02:13 PM, Shilpasri G Bhat wrote:
>> Add support to parse and export OCC inband sensors which are copied
>> by OCC to main memory in P9. Each OCC writes three buffers which
>> includes one names buffer for sensor meta data and two buffers for
>> sensor readings. While OCC writes to one buffer the sensor values
>> can be read from the other buffer. The sensors are updated every
>> 100ms.
>>
>> This patch adds power, temperature, current and voltage sensors to
>> /ibm,opal/sensors device-tree node which can be exported by the
>> ibmpowernv-hwmon driver in Linux.
>>
>> Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
>> ---
>> Changes from V2:
>> - Added current and voltage sensors
>> - Removed 'struct occ_sensor_info' which was used to store sensor
>>   offset address values
>> - Added sensor attributes like MIN and MAX
>> - Moved the header sanity checks to a separate routine
>>   'occ_sensor_sanity()'
>> - Added a mapping for OCC sensor name to userspace label. If the
>>   mapping is not found we fall back to OCC name.
> 
> Could you give us a sample output of the command 'sensors' ? 
> 
> and also the result of :
> 
> 	lsprop /proc/device-tree/ibm,opal/sensors/
> 
> Thanks,
> 
> C.
> 

# sensors
ibmpowernv-isa-0000
Adapter: ISA adapter
Chip 0 Vdd Remote Sense:  +5.40 V  (lowest =  +0.02 V, highest =  +0.03 V)
Chip 0 Vdd:               +5.40 V  (lowest =  +0.02 V, highest =  +0.03 V)
Core 0:                   +46.0°C
Core 8:                   +47.0°C
Core 16:                  +53.0°C
Core 24:                  +50.0°C
Chip 0 Core 0 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Core 1 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Core 2 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Core 3 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Core 4 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 GPU 2 :            +46.0°C  (low  = +32.0°C, high = +54.0°C)
Chip 0 GPU 2 DRAM0:       +46.0°C  (low  = +32.0°C, high = +54.0°C)
Chip 0 GPU 1 DRAM2:       +46.0°C  (low  = +32.0°C, high = +54.0°C)
Chip 0 DIMM 6 :           +34.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 DIMM 0 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 DIMM 3 :           +46.0°C  (low  = +32.0°C, high = +54.0°C)
Centaur 1:                +30.0°C
Chip 0 Nest:              +34.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Quad 0 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Quad 1 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 Quad 2 :           +30.0°C  (low  = +25.0°C, high = +80.0°C)
Chip 0 GPU:              340.00 W  (lowest = 250.00 W, highest = 800.00 W)
Chip 0 :                 540.00 W  (lowest =  23.00 W, highest =  34.00 W)
Chip 0 Vdd:              540.00 W  (lowest =  23.00 W, highest =  34.00 W)
Chip 0 Memory:           540.00 W  (lowest =  23.00 W, highest =  34.00 W)
System:                  940.00 W  (lowest = 250.00 W, highest = 800.00 W)
Fan:                     370.00 W  (lowest = 250.00 W, highest = 800.00 W)
IO:                      360.00 W  (lowest = 250.00 W, highest = 800.00 W)
Storage:                 380.00 W  (lowest = 250.00 W, highest = 800.00 W)
APSS 12 :                540.00 W  (lowest =  23.00 W, highest =  34.00 W)
Chip 0 Vdd:               +0.05 A  (lowest =  +0.03 A, highest =  +0.05 A)

/proc/device-tree/ibm,opal/sensors# lsprop
compatible       "ibm,opal-sensor"
phandle          1000011b (268435739)
name             "sensors"

vrm-curr at c00010:
sensor-data      00c00010 (12582928)
compatible       "ibm,opal-sensor"
occ_label        "CURVDD"
label            "Chip 0 Vdd"
phandle          10000148 (268435784)
sensor-type      "curr"
sensor-data-min  02c00010 (46137360)
sensor-data-max  01c00010 (29360144)
name             "vrm-curr"

gpu-power at c00004:
sensor-data      00c00004 (12582916)
compatible       "ibm,opal-sensor"
occ_label        "PWRGPU"
label            "Chip 0 GPU"
phandle          1000013d (268435773)
sensor-type      "power"
sensor-data-min  02c00004 (46137348)
sensor-data-max  01c00004 (29360132)
name             "gpu-power"

quad-temp at c0000e:
sensor-data      00c0000e (12582926)
compatible       "ibm,opal-sensor"
occ_label        "TEMPQ1"
label            "Chip 0 Quad 1 "
phandle          10000146 (268435782)
sensor-type      "temp"
sensor-data-min  02c0000e (46137358)
sensor-data-max  01c0000e (29360142)
name             "quad-temp"

proc-power at c00016:
sensor-data      00c00016 (12582934)
compatible       "ibm,opal-sensor"
occ_label        "PWRMEM"
label            "Chip 0 Memory"
phandle          1000014e (268435790)
sensor-type      "power"
sensor-data-min  02c00016 (46137366)
sensor-data-max  01c00016 (29360150)
name             "proc-power"

proc-power at c00014:
sensor-data      00c00014 (12582932)
compatible       "ibm,opal-sensor"
occ_label        "PWRVDD"
label            "Chip 0 Vdd"
phandle          1000014c (268435788)
sensor-type      "power"
sensor-data-min  02c00014 (46137364)
sensor-data-max  01c00014 (29360148)
name             "proc-power"

core-temp at c0000b:
sensor-data      00c0000b (12582923)
compatible       "ibm,opal-sensor"
occ_label        "TEMPC3"
label            "Chip 0 Core 3 "
phandle          10000143 (268435779)
sensor-type      "temp"
sensor-data-min  02c0000b (46137355)
sensor-data-max  01c0000b (29360139)
name             "core-temp"

mem-temp at c00017:
sensor-data      00c00017 (12582935)
compatible       "ibm,opal-sensor"
occ_label        "TEMPDIMM0"
label            "Chip 0 DIMM 0 "
phandle          1000014f (268435791)
sensor-type      "temp"
sensor-data-min  02c00017 (46137367)
sensor-data-max  01c00017 (29360151)
name             "mem-temp"

gpu-temp at c0001a:
sensor-data      00c0001a (12582938)
compatible       "ibm,opal-sensor"
occ_label        "TEMPGPU2DRAM0"
label            "Chip 0 GPU 2 DRAM0"
phandle          10000152 (268435794)
sensor-type      "temp"
sensor-data-min  02c0001a (46137370)
sensor-data-max  01c0001a (29360154)
name             "gpu-temp"

sys-power at c00012:
sensor-data      00c00012 (12582930)
compatible       "ibm,opal-sensor"
occ_label        "PWRAPSSCH12"
label            "APSS 12 "
phandle          1000014a (268435786)
sensor-type      "power"
sensor-data-min  02c00012 (46137362)
sensor-data-max  01c00012 (29360146)
name             "sys-power"

core-temp at 68:
sensor-data      00e00068 (14680168)
compatible       "ibm,opal-sensor"
ibm,pir          00000068 (104)
label            "Core"
phandle          1000011e (268435742)
sensor-type      "temp"
sensor-status    01e00068 (31457384)
name             "core-temp"

proc-in at c00015:
sensor-data      00c00015 (12582933)
compatible       "ibm,opal-sensor"
occ_label        "VOLTVDDSENSE"
label            "Chip 0 Vdd Remote Sense"
phandle          1000014d (268435789)
sensor-type      "in"
sensor-data-min  02c00015 (46137365)
sensor-data-max  01c00015 (29360149)
name             "proc-in"

sys-power at c00002:
sensor-data      00c00002 (12582914)
compatible       "ibm,opal-sensor"
occ_label        "PWRIO"
label            "IO"
phandle          1000013b (268435771)
sensor-type      "power"
sensor-data-min  02c00002 (46137346)
sensor-data-max  01c00002 (29360130)
name             "sys-power"

core-temp at c00009:
sensor-data      00c00009 (12582921)
compatible       "ibm,opal-sensor"
occ_label        "TEMPC1"
label            "Chip 0 Core 1 "
phandle          10000141 (268435777)
sensor-type      "temp"
sensor-data-min  02c00009 (46137353)
sensor-data-max  01c00009 (29360137)
name             "core-temp"

core-temp at 28:
sensor-data      00e00028 (14680104)
compatible       "ibm,opal-sensor"
ibm,pir          00000028 (40)
label            "Core"
phandle          1000011d (268435741)
sensor-type      "temp"
sensor-status    01e00028 (31457320)
name             "core-temp"

sys-power at c00000:
sensor-data      00c00000 (12582912)
compatible       "ibm,opal-sensor"
occ_label        "PWRSYS"
label            "System"
phandle          10000139 (268435769)
sensor-type      "power"
sensor-data-min  02c00000 (46137344)
sensor-data-max  01c00000 (29360128)
name             "sys-power"

proc-temp at c00005:
sensor-data      00c00005 (12582917)
compatible       "ibm,opal-sensor"
occ_label        "TEMPNEST"
label            "Chip 0 Nest"
phandle          1000013e (268435774)
sensor-type      "temp"
sensor-data-min  02c00005 (46137349)
sensor-data-max  01c00005 (29360133)
name             "proc-temp"

quad-temp at c0000f:
sensor-data      00c0000f (12582927)
compatible       "ibm,opal-sensor"
occ_label        "TEMPQ2"
label            "Chip 0 Quad 2 "
phandle          10000147 (268435783)
sensor-type      "temp"
sensor-data-min  02c0000f (46137359)
sensor-data-max  01c0000f (29360143)
name             "quad-temp"

quad-temp at c0000d:
sensor-data      00c0000d (12582925)
compatible       "ibm,opal-sensor"
occ_label        "TEMPQ0"
label            "Chip 0 Quad 0 "
phandle          10000145 (268435781)
sensor-type      "temp"
sensor-data-min  02c0000d (46137357)
sensor-data-max  01c0000d (29360141)
name             "quad-temp"

core-temp at c0000c:
sensor-data      00c0000c (12582924)
compatible       "ibm,opal-sensor"
occ_label        "TEMPC4"
label            "Chip 0 Core 4 "
phandle          10000144 (268435780)
sensor-type      "temp"
sensor-data-min  02c0000c (46137356)
sensor-data-max  01c0000c (29360140)
name             "core-temp"

mem-temp at c00018:
sensor-data      00c00018 (12582936)
compatible       "ibm,opal-sensor"
occ_label        "TEMPDIMM3"
label            "Chip 0 DIMM 3 "
phandle          10000150 (268435792)
sensor-type      "temp"
sensor-data-min  02c00018 (46137368)
sensor-data-max  01c00018 (29360152)
name             "mem-temp"

core-temp at 70:
sensor-data      00e00070 (14680176)
compatible       "ibm,opal-sensor"
ibm,pir          00000070 (112)
label            "Core"
phandle          1000011f (268435743)
sensor-type      "temp"
sensor-status    01e00070 (31457392)
name             "core-temp"

gpu-temp at c0001b:
sensor-data      00c0001b (12582939)
compatible       "ibm,opal-sensor"
occ_label        "TEMPGPU1DRAM2"
label            "Chip 0 GPU 1 DRAM2"
phandle          10000153 (268435795)
sensor-type      "temp"
sensor-data-min  02c0001b (46137371)
sensor-data-max  01c0001b (29360155)
name             "gpu-temp"

proc-power at c00013:
sensor-data      00c00013 (12582931)
compatible       "ibm,opal-sensor"
occ_label        "PWRPROC"
label            "Chip 0 "
phandle          1000014b (268435787)
sensor-type      "power"
sensor-data-min  02c00013 (46137363)
sensor-data-max  01c00013 (29360147)
name             "proc-power"

core-temp at c0000a:
sensor-data      00c0000a (12582922)
compatible       "ibm,opal-sensor"
occ_label        "TEMPC2"
label            "Chip 0 Core 2 "
phandle          10000142 (268435778)
sensor-type      "temp"
sensor-data-min  02c0000a (46137354)
sensor-data-max  01c0000a (29360138)
name             "core-temp"

vrm-in at c00011:
sensor-data      00c00011 (12582929)
compatible       "ibm,opal-sensor"
occ_label        "VOLTVDD"
label            "Chip 0 Vdd"
phandle          10000149 (268435785)
sensor-type      "in"
sensor-data-min  02c00011 (46137361)
sensor-data-max  01c00011 (29360145)
name             "vrm-in"

mem-temp at c00006:
sensor-data      00c00006 (12582918)
compatible       "ibm,opal-sensor"
occ_label        "TEMPDIMM6"
label            "Chip 0 DIMM 6 "
phandle          1000013f (268435775)
sensor-type      "temp"
sensor-data-min  02c00006 (46137350)
sensor-data-max  01c00006 (29360134)
name             "mem-temp"

sys-power at c00003:
sensor-data      00c00003 (12582915)
compatible       "ibm,opal-sensor"
occ_label        "PWRSTORE"
label            "Storage"
phandle          1000013c (268435772)
sensor-type      "power"
sensor-data-min  02c00003 (46137347)
sensor-data-max  01c00003 (29360131)
name             "sys-power"

mem-temp at 80000001:
sensor-data      00e10001 (14745601)
compatible       "ibm,opal-sensor"
label            "Centaur"
ibm,chip-id      80000001
phandle          10000120 (268435744)
sensor-type      "temp"
sensor-status    01e10001 (31522817)
name             "mem-temp"

core-temp at 10:
sensor-data      00e00010 (14680080)
compatible       "ibm,opal-sensor"
ibm,pir          00000010 (16)
label            "Core"
phandle          1000011c (268435740)
sensor-type      "temp"
sensor-status    01e00010 (31457296)
name             "core-temp"

sys-power at c00001:
sensor-data      00c00001 (12582913)
compatible       "ibm,opal-sensor"
occ_label        "PWRFAN"
label            "Fan"
phandle          1000013a (268435770)
sensor-type      "power"
sensor-data-min  02c00001 (46137345)
sensor-data-max  01c00001 (29360129)
name             "sys-power"

gpu-temp at c00019:
sensor-data      00c00019 (12582937)
compatible       "ibm,opal-sensor"
occ_label        "TEMPGPU2"
label            "Chip 0 GPU 2 "
phandle          10000151 (268435793)
sensor-type      "temp"
sensor-data-min  02c00019 (46137369)
sensor-data-max  01c00019 (29360153)
name             "gpu-temp"

core-temp at c00008:
sensor-data      00c00008 (12582920)
compatible       "ibm,opal-sensor"
occ_label        "TEMPC0"
label            "Chip 0 Core 0 "
phandle          10000140 (268435776)
sensor-type      "temp"
sensor-data-min  02c00008 (46137352)
sensor-data-max  01c00008 (29360136)
name             "core-temp"



More information about the Skiboot mailing list