diff options
author | Cédric Le Goater <clg@fr.ibm.com> | 2015-03-09 21:56:12 +0100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-03-24 18:22:55 +1100 |
commit | 132e593400f959074f72cf066e3e99c8cd8d7b82 (patch) | |
tree | 1525fccc1dc2d5976ee2d1b22b4dcb2bc69d2666 /hw | |
parent | 95098fccb85fdd8e5911884f5ef3744bcc17478a (diff) | |
download | skiboot-132e593400f959074f72cf066e3e99c8cd8d7b82.zip skiboot-132e593400f959074f72cf066e3e99c8cd8d7b82.tar.gz skiboot-132e593400f959074f72cf066e3e99c8cd8d7b82.tar.bz2 |
core: add a platform op to read sensors
This patch introduces an initial framework to define a sensor_read
operation per platform. It also proposes a few helper routines to
work on the sensor 'handler' which identifies a sensor and attribute
in the OPAL_SENSOR_READ call.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/fsp/fsp-sensor.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c index 39e4e8e..1435e67 100644 --- a/hw/fsp/fsp-sensor.c +++ b/hw/fsp/fsp-sensor.c @@ -36,7 +36,8 @@ #include <spcn.h> #include <opal-api.h> #include <opal-msg.h> -#include<errorlog.h> +#include <errorlog.h> +#include <sensor.h> #define INVALID_DATA ((uint32_t)-1) @@ -490,7 +491,7 @@ static int64_t parse_sensor_id(uint32_t id, struct opal_sensor_data *attr) } -static int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token, +int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token, uint32_t *sensor_data) { struct opal_sensor_data *attr; @@ -691,14 +692,11 @@ static void add_sensor_ids(struct dt_node *sensors) static void add_opal_sensor_node(void) { int index; - struct dt_node *sensors; if (!fsp_present()) return; - sensors = dt_new(opal_node, "sensors"); - - add_sensor_ids(sensors); + add_sensor_ids(sensor_node); /* Reset the entry count of each modifier */ for (index = 0; spcn_mod_data[index].mod != SPCN_MOD_LAST; @@ -729,9 +727,6 @@ void fsp_init_sensor(void) /* Map TCE */ fsp_tce_map(PSI_DMA_SENSOR_BUF, sensor_buffer, PSI_DMA_SENSOR_BUF_SZ); - /* Register OPAL interface */ - opal_register(OPAL_SENSOR_READ, fsp_opal_read_sensor, 3); - msg.resp = &resp; /* Traverse using all the modifiers to know all the sensors available |