diff options
author | Cédric Le Goater <clg@kaod.org> | 2016-09-13 19:39:22 +0200 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-12-08 13:03:23 +1100 |
commit | 33fada1a6f4b1f5fcf131765f37fcb76c079bfb2 (patch) | |
tree | 2b4f11fee2f8d812b77c22b21cdce7fce102e188 /hw | |
parent | aed1fbe848ec7dcfef5c2831ab779ae9c21b41f6 (diff) | |
download | skiboot-33fada1a6f4b1f5fcf131765f37fcb76c079bfb2.zip skiboot-33fada1a6f4b1f5fcf131765f37fcb76c079bfb2.tar.gz skiboot-33fada1a6f4b1f5fcf131765f37fcb76c079bfb2.tar.bz2 |
sensor: add a family field in the handler
Currently, we are hijacking the last bit of the resource field of the
sensor handler to differentiate the sensor families and route the
opal_sensor_read() call to the appropriate component.
Let's reserve the last 3bits and provide an API to set the sensor
family for current use and future use. This gives us a maximum of 8
families and 32 resource classes. The FSP uses 15, so we should be
fine for a while.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/dts.c | 6 | ||||
-rw-r--r-- | hw/fsp/fsp-sensor.c | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -290,7 +290,7 @@ int64_t dts_sensor_read(uint32_t sensor_hndl, uint32_t *sensor_data) memset(&dts, 0, sizeof(struct dts)); - switch (sensor_get_frc(sensor_hndl) & ~SENSOR_DTS) { + switch (sensor_get_frc(sensor_hndl)) { case SENSOR_DTS_CORE_TEMP: rc = dts_read_core_temp(rid, &dts); break; @@ -326,11 +326,11 @@ int64_t dts_sensor_read(uint32_t sensor_hndl, uint32_t *sensor_data) (((chip_id) & 0x3ff) | ((dimm_id) << 10)) #define core_handler(core_id, attr_id) \ - sensor_make_handler(SENSOR_DTS_CORE_TEMP | SENSOR_DTS, \ + sensor_make_handler(SENSOR_DTS, SENSOR_DTS_CORE_TEMP, \ core_id, attr_id) #define cen_handler(cen_id, attr_id) \ - sensor_make_handler(SENSOR_DTS_MEM_TEMP|SENSOR_DTS, \ + sensor_make_handler(SENSOR_DTS, SENSOR_DTS_MEM_TEMP, \ centaur_make_id(chip_id, 0), attr_id) bool dts_sensor_create_nodes(struct dt_node *sensors) diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c index 51ee872..0fa3115 100644 --- a/hw/fsp/fsp-sensor.c +++ b/hw/fsp/fsp-sensor.c @@ -617,7 +617,7 @@ static struct dt_node *sensor_get_node(struct dt_node *sensors, } #define sensor_handler(header, attr_num) \ - sensor_make_handler((header).frc, (header).rid, attr_num) + sensor_make_handler(SENSOR_FSP, (header).frc, (header).rid, attr_num) static int add_sensor_prs(struct dt_node *sensors, struct sensor_prs *prs) { |