commit 5ff915a9696d37361c0470f29eb26311adea59da Author: Brandon Bergren Date: Sun Sep 6 17:18:24 2020 -0500 [PowerPC] Fix setting of time in OPAL -- The params use register passing. diff --git a/sys/powerpc/powernv/opal_dev.c b/sys/powerpc/powernv/opal_dev.c index 250599c19c36..d70222bd58be 100644 --- a/sys/powerpc/powernv/opal_dev.c +++ b/sys/powerpc/powernv/opal_dev.c @@ -321,11 +321,12 @@ opal_settime(device_t dev, struct timespec *ts) hmsm |= ((uint64_t)bin2bcd(ct.min) << 48); hmsm |= ((uint64_t)bin2bcd(ct.hour) << 56); - hmsm = htobe64(hmsm); - ymd = htobe32(ymd); - + /* + * We do NOT swap endian here, because the values are being sent + * via registers instead of indirect via memory. + */ do { - rv = opal_call(OPAL_RTC_WRITE, vtophys(&ymd), vtophys(&hmsm)); + rv = opal_call(OPAL_RTC_WRITE, ymd, hmsm); if (rv == OPAL_BUSY_EVENT) { rv = opal_call(OPAL_POLL_EVENTS, 0); pause("opalrtc", 1);