aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>2017-12-15 12:51:00 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-02-21 11:58:19 +1100
commitfa3494602a3e3effe9f222193453d67ccc0c0606 (patch)
tree730c36fc14fb245578927ca98f11287a16833cde /include
parent7f4c8e8ce0b78ca046643d7f4f63d81f4fd11746 (diff)
downloadskiboot-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 'include')
-rw-r--r--include/cpu.h2
-rw-r--r--include/dts.h2
-rw-r--r--include/fsp.h2
-rw-r--r--include/opal-api.h3
-rw-r--r--include/platform.h2
-rw-r--r--include/sensor.h1
-rw-r--r--include/skiboot.h2
7 files changed, 8 insertions, 6 deletions
diff --git a/include/cpu.h b/include/cpu.h
index bec4b03..2ec6f03 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -116,7 +116,7 @@ struct cpu_thread {
*/
struct lock dts_lock;
struct timer dts_timer;
- void *sensor_data;
+ u64 *sensor_data;
u32 sensor_attr;
u32 token;
bool dts_read_in_progress;
diff --git a/include/dts.h b/include/dts.h
index 17e2e15..30188ac 100644
--- a/include/dts.h
+++ b/include/dts.h
@@ -19,7 +19,7 @@
#include <stdint.h>
-extern int64_t dts_sensor_read(u32 sensor_hndl, int token, u32 *sensor_data);
+extern int64_t dts_sensor_read(u32 sensor_hndl, int token, u64 *sensor_data);
extern bool dts_sensor_create_nodes(struct dt_node *sensors);
#endif /* __DTS_H */
diff --git a/include/fsp.h b/include/fsp.h
index c34a518..9b96d5d 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -822,7 +822,7 @@ extern void fsp_memory_err_init(void);
/* Sensor */
extern void fsp_init_sensor(void);
extern int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token,
- uint32_t *sensor_data);
+ uint64_t *sensor_data);
/* Diagnostic */
extern void fsp_init_diag(void);
diff --git a/include/opal-api.h b/include/opal-api.h
index 0bd5f17..05fe767 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -215,7 +215,8 @@
#define OPAL_SENSOR_GROUP_CLEAR 156
#define OPAL_PCI_SET_P2P 157
#define OPAL_QUIESCE 158
-#define OPAL_LAST 158
+#define OPAL_SENSOR_READ_U64 159
+#define OPAL_LAST 159
#define QUIESCE_HOLD 1 /* Spin all calls at entry */
#define QUIESCE_REJECT 2 /* Fail all calls with OPAL_BUSY */
diff --git a/include/platform.h b/include/platform.h
index f3af390..e6ece27 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -183,7 +183,7 @@ struct platform {
* Read a sensor value
*/
int64_t (*sensor_read)(uint32_t sensor_hndl, int token,
- uint32_t *sensor_data);
+ uint64_t *sensor_data);
/*
* Return the heartbeat time
*/
diff --git a/include/sensor.h b/include/sensor.h
index 445a6bc..40b275a 100644
--- a/include/sensor.h
+++ b/include/sensor.h
@@ -63,5 +63,6 @@ enum {
extern struct dt_node *sensor_node;
extern void sensor_init(void);
+extern void check_sensor_read(int token);
#endif /* __SENSOR_H */
diff --git a/include/skiboot.h b/include/skiboot.h
index 2f81a05..d140ab2 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -352,7 +352,7 @@ extern int fake_nvram_write(uint32_t offset, void *src, uint32_t size);
/* OCC Inband Sensors */
extern void occ_sensors_init(void);
-extern int occ_sensor_read(u32 handle, u32 *data);
+extern int occ_sensor_read(u32 handle, u64 *data);
extern int occ_sensor_group_clear(u32 group_hndl, int token);
extern void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles,
int nr_phandles, int chipid);