aboutsummaryrefslogtreecommitdiff
path: root/platforms/mambo/mambo.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 /platforms/mambo/mambo.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 'platforms/mambo/mambo.c')
-rw-r--r--platforms/mambo/mambo.c9
1 files changed, 7 insertions, 2 deletions
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;
}