[Skiboot] [PATCH] occ-sensors : Add OCC inband sensor region to exports
Shilpasri G Bhat
shilpa.bhat at linux.vnet.ibm.com
Wed Oct 18 22:49:32 AEDT 2017
Signed-off-by: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
---
hw/occ-sensor.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index 89f529f..1042c11 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -546,7 +546,7 @@ static const char *get_sensor_loc_string(enum occ_sensor_location loc)
void occ_sensors_init(void)
{
struct proc_chip *chip;
- struct dt_node *sg;
+ struct dt_node *sg, *exports;
int occ_num = 0, i;
/* OCC inband sensors is only supported in P9 */
@@ -633,4 +633,16 @@ void occ_sensors_init(void)
occ_add_sensor_groups(sg, phandles, phcount, chip->id);
free(phandles);
}
+
+ if (!occ_num)
+ return;
+
+ exports = dt_find_by_path(dt_root, "/ibm,opal/firmware/exports");
+ if (!exports) {
+ prerror("OCC: dt node /ibm,opal/firmware/exports not found\n");
+ return;
+ }
+
+ dt_add_property_u64s(exports, "occ_inband_sensors", occ_sensor_base,
+ OCC_SENSOR_DATA_BLOCK_SIZE * occ_num);
}
--
1.8.3.1
More information about the Skiboot
mailing list