diff mbox series

occ-sensors : Add OCC inband sensor region to exports

Message ID 1508327372-10535-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com
State Accepted
Headers show
Series occ-sensors : Add OCC inband sensor region to exports | expand

Commit Message

Shilpasri G Bhat Oct. 18, 2017, 11:49 a.m. UTC
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 hw/occ-sensor.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

Stewart Smith Oct. 19, 2017, 5:08 a.m. UTC | #1
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> writes:
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> ---
>  hw/occ-sensor.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)

Thanks, merged to master as of b7a10ce59358291f95aefe457034a948e0b5577f
diff mbox series

Patch

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);
 }