[Skiboot] [RFC PATCH v2 0/9] add support to read the core temperatures

Cédric Le Goater clg at fr.ibm.com
Thu Jan 22 18:09:13 AEDT 2015


This latest version goes a little further than adding the core 
temperatures support. It also proposes a new layout for the device 
tree under "ibm,opal/sensors". This in order to ease support of
new sensors in OPAL and in the Linux driver.

  core: add a platform op to read sensors
  dts: add support to read the core temperatures
  dts: add device tree nodes for the core temperatures
  spcn: add definitions for the PRS command and modifiers
  fsp-sensor: rework device tree for sensors
  fsp-sensor: add a status property
  sensor: add a type property
  dts: add some extra properties to improve the driver
  fsp-sensor: cleanup unused code

The patchset starts with a framework to support sensor from different 
OPAL components, the current code only supporting the FSP. The DTS 
support comes next. Patch 5 brings in a lot of changes: it makes use 
of the new SPCN definitions and it reworks the device tree for the FSP 
sensors, using such a layout :

	<resource class name>@<resource identifier>/
	   └── ...

	cooling-fan at 2100/
	   ├── name             "cooling-fan"
	   ├── sensor-status    00052100 (336128)
	   ├── compatible       "ibm,opal-sensor"
	   ├── ibm,loc-code     "A1"
	   ├── sensor-threshold 01052100 (17113344)
	   ├── sensor-data      02052100 (33890560)
	   ├── sensor-type      "fan"
	   ├── phandle          10000016 (268435478)
	   └── linux,phandle    10000016 (268435478)

The last patches add a few extra sensor properties useful for output in 
the Linux driver.

On the Linux side, we need a small change in the OPAL_SENSOR_READ call
to be able to read a sensor value in a synchronous manner. We also need 
a reworked 'ibmpowernv' driver supporting the new device tree. To be
sent later.


TODO:

 * the file doc/opal-spec.txt needs an update.
 * get the junction temperatures (from the OCC SRAM ?)
 * add the DTS for the memory controllers 
 * improve the location property 


Thanks,

C. 

 core/Makefile.inc           |    2 +-
 core/init.c                 |    4 +
 core/sensor.c               |   46 ++++
 hw/Makefile.inc             |    2 +-
 hw/dts.c                    |  211 ++++++++++++++++++
 hw/fsp/fsp-sensor.c         |  495 ++++++++++++++++++++++++-------------------
 include/dts.h               |   25 +++
 include/fsp.h               |    2 +
 include/platform.h          |    6 +
 include/sensor.h            |   55 +++++
 include/spcn.h              |   94 ++++++++
 include/xscom.h             |    8 +
 platforms/ibm-fsp/firenze.c |    1 +
 13 files changed, 734 insertions(+), 217 deletions(-)
 create mode 100644 core/sensor.c
 create mode 100644 hw/dts.c
 create mode 100644 include/dts.h
 create mode 100644 include/sensor.h

-- 
1.7.10.4



More information about the Skiboot mailing list