aboutsummaryrefslogtreecommitdiff
path: root/hw/lpc-rtc.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/lpc-rtc.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/lpc-rtc.c')
-rw-r--r--hw/lpc-rtc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/lpc-rtc.c b/hw/lpc-rtc.c
index f560c8c..ba15941f 100644
--- a/hw/lpc-rtc.c
+++ b/hw/lpc-rtc.c
@@ -139,14 +139,15 @@ static void lpc_init_hw(void)
unlock(&rtc_lock);
}
-static int64_t lpc_opal_rtc_read(uint32_t *y_m_d,
- uint64_t *h_m_s_m)
+static int64_t lpc_opal_rtc_read(__be32 *__ymd, __be64 *__hmsm)
{
uint8_t val;
int64_t rc = OPAL_SUCCESS;
struct tm tm;
+ uint32_t ymd;
+ uint64_t hmsm;
- if (!y_m_d || !h_m_s_m)
+ if (!__ymd || !__hmsm)
return OPAL_PARAMETER;
/* Return busy if updating. This is somewhat racy, but will
@@ -172,7 +173,9 @@ static int64_t lpc_opal_rtc_read(uint32_t *y_m_d,
rtc_cache_update(&tm);
/* Convert to OPAL time */
- tm_to_datetime(&tm, y_m_d, h_m_s_m);
+ tm_to_datetime(&tm, &ymd, &hmsm);
+ *__ymd = cpu_to_be32(ymd);
+ *__hmsm = cpu_to_be64(hmsm);
}
return rc;