aboutsummaryrefslogtreecommitdiff
path: root/hw/fsp/fsp-sensor.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-12-08 22:22:45 +1000
committerOliver O'Halloran <oohall@gmail.com>2019-12-16 14:50:56 +1100
commit1b9a449d5d48de9520befd09892d85d6aec7ba62 (patch)
treed8fb15c0217cf0328a8afeb90cb03bac1dbbc8db /hw/fsp/fsp-sensor.c
parent0ed09ec18e3f856d5456908c4abe3649a025ea12 (diff)
downloadskiboot-1b9a449d5d48de9520befd09892d85d6aec7ba62.zip
skiboot-1b9a449d5d48de9520befd09892d85d6aec7ba62.tar.gz
skiboot-1b9a449d5d48de9520befd09892d85d6aec7ba62.tar.bz2
opal-api: add endian conversions to most opal calls
This adds missing endian conversions to most calls, sufficient at least to handle calls from a kernel booting on mambo. Subsystems requiring more extensive changes (e.g., xive) will be done with individual changes. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw/fsp/fsp-sensor.c')
-rw-r--r--hw/fsp/fsp-sensor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c
index 43c8ce4..74deac7 100644
--- a/hw/fsp/fsp-sensor.c
+++ b/hw/fsp/fsp-sensor.c
@@ -70,7 +70,7 @@ enum spcn_attr {
/* Parsed sensor attributes, passed through OPAL */
struct opal_sensor_data {
uint64_t async_token; /* Asynchronous token */
- uint64_t *sensor_data; /* Kernel pointer to copy data */
+ __be64 *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 */
@@ -243,7 +243,7 @@ static void fsp_sensor_process_data(struct opal_sensor_data *attr)
sensor_buf_ptr += spcn_mod_data[attr->mod_index].entry_size;
}
- *(attr->sensor_data) = sensor_data;
+ *attr->sensor_data = cpu_to_be64(sensor_data);
if (sensor_data == INVALID_DATA)
queue_msg_for_delivery(OPAL_PARTIAL, attr);
else
@@ -345,7 +345,7 @@ static void fsp_sensor_read_complete(struct fsp_msg *msg)
unlock(&sensor_lock);
return;
err:
- *(attr->sensor_data) = INVALID_DATA;
+ *attr->sensor_data = cpu_to_be64(INVALID_DATA);
queue_msg_for_delivery(rc, attr);
unlock(&sensor_lock);
log_simple_error(&e_info(OPAL_RC_SENSOR_ASYNC_COMPLETE),
@@ -496,7 +496,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,
- uint64_t *sensor_data)
+ __be64 *sensor_data)
{
struct opal_sensor_data *attr;
int64_t rc;