diff options
author | Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> | 2017-12-15 12:51:00 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-02-21 11:58:19 +1100 |
commit | fa3494602a3e3effe9f222193453d67ccc0c0606 (patch) | |
tree | 730c36fc14fb245578927ca98f11287a16833cde /hw/dts.c | |
parent | 7f4c8e8ce0b78ca046643d7f4f63d81f4fd11746 (diff) | |
download | skiboot-fa3494602a3e3effe9f222193453d67ccc0c0606.zip skiboot-fa3494602a3e3effe9f222193453d67ccc0c0606.tar.gz skiboot-fa3494602a3e3effe9f222193453d67ccc0c0606.tar.bz2 |
sensors: Support reading u64 sensor values
This patch adds support to read u64 sensor values. This also adds
changes to the core and the backend implementation code to make this
API as the base call. Host can use this new API to read sensors
upto 64bits.
This adds a list to store the pointer to the kernel u32 buffer, for
older kernels making async sensor u32 reads.
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/dts.c')
-rw-r--r-- | hw/dts.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -276,14 +276,15 @@ static void dts_async_read_temp(struct timer *t __unused, void *data, rc = dts_read_core_temp_p9(cpu->pir, &dts); if (!rc) { if (cpu->sensor_attr == SENSOR_DTS_ATTR_TEMP_MAX) - *(u32 *)cpu->sensor_data = dts.temp; + *cpu->sensor_data = dts.temp; else if (cpu->sensor_attr == SENSOR_DTS_ATTR_TEMP_TRIP) - *(u32 *)cpu->sensor_data = dts.trip; + *cpu->sensor_data = dts.trip; } if (!swkup_rc) dctl_clear_special_wakeup(cpu); + check_sensor_read(cpu->token); rc = opal_queue_msg(OPAL_MSG_ASYNC_COMP, NULL, NULL, cpu->token, rc); if (rc) prerror("Failed to queue async message\n"); @@ -292,7 +293,7 @@ static void dts_async_read_temp(struct timer *t __unused, void *data, } static int dts_read_core_temp(u32 pir, struct dts *dts, u8 attr, - int token, u32 *sensor_data) + int token, u64 *sensor_data) { struct cpu_thread *cpu; int rc; @@ -390,7 +391,7 @@ enum sensor_dts_class { */ #define centaur_get_id(rid) (0x80000000 | ((rid) & 0x3ff)) -int64_t dts_sensor_read(u32 sensor_hndl, int token, u32 *sensor_data) +int64_t dts_sensor_read(u32 sensor_hndl, int token, u64 *sensor_data) { uint8_t attr = sensor_get_attr(sensor_hndl); uint32_t rid = sensor_get_rid(sensor_hndl); |