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/fsp | |
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/fsp')
-rw-r--r-- | hw/fsp/fsp-sensor.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c index 6363530..eff5d21 100644 --- a/hw/fsp/fsp-sensor.c +++ b/hw/fsp/fsp-sensor.c @@ -87,7 +87,7 @@ enum spcn_attr { /* Parsed sensor attributes, passed through OPAL */ struct opal_sensor_data { uint64_t async_token; /* Asynchronous token */ - uint32_t *sensor_data; /* Kernel pointer to copy data */ + uint64_t *sensor_data; /* Kernel pointer to copy data */ enum spcn_attr spcn_attr; /* Modifier attribute */ uint16_t rid; /* Sensor RID */ uint8_t frc; /* Sensor resource class */ @@ -306,8 +306,9 @@ static int fsp_sensor_process_read(struct fsp_msg *resp_msg) static void queue_msg_for_delivery(int rc, struct opal_sensor_data *attr) { - prlog(PR_INSANE, "%s: rc:%d, data:%d\n", + prlog(PR_INSANE, "%s: rc:%d, data:%lld\n", __func__, rc, *(attr->sensor_data)); + check_sensor_read(attr->async_token); opal_queue_msg(OPAL_MSG_ASYNC_COMP, NULL, NULL, attr->async_token, rc); spcn_mod_data[attr->mod_index].entry_count = 0; @@ -512,7 +513,7 @@ static int64_t parse_sensor_id(uint32_t handler, struct opal_sensor_data *attr) int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token, - uint32_t *sensor_data) + uint64_t *sensor_data) { struct opal_sensor_data *attr; int64_t rc; |