aboutsummaryrefslogtreecommitdiff
path: root/platforms
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 /platforms
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 'platforms')
-rw-r--r--platforms/ibm-fsp/ibm-fsp.h2
-rw-r--r--platforms/mambo/mambo.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/platforms/ibm-fsp/ibm-fsp.h b/platforms/ibm-fsp/ibm-fsp.h
index b3418e6..16af68f 100644
--- a/platforms/ibm-fsp/ibm-fsp.h
+++ b/platforms/ibm-fsp/ibm-fsp.h
@@ -15,7 +15,7 @@ struct errorlog;
extern int elog_fsp_commit(struct errorlog *buf);
extern int64_t ibm_fsp_sensor_read(uint32_t sensor_hndl, int token,
- uint64_t *sensor_data);
+ __be64 *sensor_data);
/* Apollo PCI support */
extern void apollo_pci_setup_phb(struct phb *phb,
diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c
index e523cd3..aa1bf83 100644
--- a/platforms/mambo/mambo.c
+++ b/platforms/mambo/mambo.c
@@ -173,11 +173,13 @@ static void bogus_disk_flash_init(void)
}
}
-static int64_t mambo_rtc_read(uint32_t *ymd, uint64_t *hmsm)
+static int64_t mambo_rtc_read(__be32 *ymd, __be64 *hmsm)
{
int64_t mambo_time;
struct tm t;
time_t mt;
+ uint32_t __ymd;
+ uint64_t __hmsm;
if (!ymd || !hmsm)
return OPAL_PARAMETER;
@@ -185,7 +187,10 @@ static int64_t mambo_rtc_read(uint32_t *ymd, uint64_t *hmsm)
mambo_time = callthru0(SIM_GET_TIME_CODE);
mt = mambo_time >> 32;
gmtime_r(&mt, &t);
- tm_to_datetime(&t, ymd, hmsm);
+ tm_to_datetime(&t, &__ymd, &__hmsm);
+
+ *ymd = cpu_to_be32(__ymd);
+ *hmsm = cpu_to_be64(__hmsm);
return OPAL_SUCCESS;
}