diff options
author | Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> | 2017-07-28 00:45:30 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-07-28 14:53:19 +1000 |
commit | 1ded56ceb6a1c0f6e37321cbb74f4104ebfcf3fa (patch) | |
tree | cb55ab95e6deb847d25f2a658ef666b42b021438 /core | |
parent | 5bec6cdf92f984cccc09dbe57579760a6e593b79 (diff) | |
download | skiboot-1ded56ceb6a1c0f6e37321cbb74f4104ebfcf3fa.zip skiboot-1ded56ceb6a1c0f6e37321cbb74f4104ebfcf3fa.tar.gz skiboot-1ded56ceb6a1c0f6e37321cbb74f4104ebfcf3fa.tar.bz2 |
sensors: occ: Add support for OCC inband sensors
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@linux.vnet.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/init.c | 1 | ||||
-rw-r--r-- | core/sensor.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/core/init.c b/core/init.c index 02bd30c..466a426 100644 --- a/core/init.c +++ b/core/init.c @@ -507,6 +507,7 @@ void __noreturn load_and_boot_kernel(bool is_reboot) * as possible to avoid delay. */ occ_pstates_init(); + occ_sensors_init(); /* Use nvram bootargs over device tree */ cmdline = nvram_query("bootargs"); diff --git a/core/sensor.c b/core/sensor.c index cc5341c..b0d3c5e 100644 --- a/core/sensor.c +++ b/core/sensor.c @@ -29,6 +29,10 @@ static int64_t opal_sensor_read(uint32_t sensor_hndl, int token, switch (sensor_get_family(sensor_hndl)) { case SENSOR_DTS: return dts_sensor_read(sensor_hndl, sensor_data); + case SENSOR_OCC: + return occ_sensor_read(sensor_hndl, sensor_data); + default: + break; } if (platform.sensor_read) |