aboutsummaryrefslogtreecommitdiff
path: root/hw/dts.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2016-09-13 19:39:22 +0200
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-12-08 13:03:23 +1100
commit33fada1a6f4b1f5fcf131765f37fcb76c079bfb2 (patch)
tree2b4f11fee2f8d812b77c22b21cdce7fce102e188 /hw/dts.c
parentaed1fbe848ec7dcfef5c2831ab779ae9c21b41f6 (diff)
downloadskiboot-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/dts.c')
-rw-r--r--hw/dts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/dts.c b/hw/dts.c
index d5196db..902a3b4 100644
--- a/hw/dts.c
+++ b/hw/dts.c
@@ -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)