Skip to content

Commit

Permalink
occ-sensors : Add OCC inband sensor region to exports
Browse files Browse the repository at this point in the history
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
shilpasri authored and stewartsmith committed Oct 19, 2017
1 parent 62ac763 commit b7a10ce
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion hw/occ-sensor.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
}

0 comments on commit b7a10ce

Please sign in to comment.