summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorKuan-Wei Chiu <[email protected]>2026-05-16 16:39:55 +0900
committerTom Rini <[email protected]>2026-05-22 16:47:54 -0600
commit5116fed77dee99a513f17f18be0dbf2e63363eef (patch)
tree96010f47993b984dda7cbcf9bbad5a2734af59cb /drivers/rtc
parent0bcd158db30aa14aa6add56060626388079c50cf (diff)
rtc: goldfish: Use __raw_readl() and __raw_writel()
In QEMU, the Goldfish RTC is explicitly instantiated as a big-endian device on the m68k virt machine (via the 'big-endian=true' property). Currently, this driver uses ioread32() and iowrite32(), which works by luck because the underlying readl() and writel() are currently broken on m68k. Use __raw_readl() and __raw_writel() instead to avoid breaking this driver when the endianness of readl() and writel() is fixed. Signed-off-by: Kuan-Wei Chiu <[email protected]> Tested-by: Daniel Palmer <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Daniel Palmer <[email protected]>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/goldfish_rtc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/goldfish_rtc.c b/drivers/rtc/goldfish_rtc.c
index d2991ca6719..4892a63f8d8 100644
--- a/drivers/rtc/goldfish_rtc.c
+++ b/drivers/rtc/goldfish_rtc.c
@@ -40,8 +40,8 @@ static int goldfish_rtc_get(struct udevice *dev, struct rtc_time *time)
u64 time_low;
u64 now;
- time_low = ioread32(base + GOLDFISH_TIME_LOW);
- time_high = ioread32(base + GOLDFISH_TIME_HIGH);
+ time_low = __raw_readl(base + GOLDFISH_TIME_LOW);
+ time_high = __raw_readl(base + GOLDFISH_TIME_HIGH);
now = (time_high << 32) | time_low;
do_div(now, 1000000000U);
@@ -62,8 +62,8 @@ static int goldfish_rtc_set(struct udevice *dev, const struct rtc_time *time)
return -EINVAL;
now = rtc_mktime(time) * 1000000000ULL;
- iowrite32(now >> 32, base + GOLDFISH_TIME_HIGH);
- iowrite32(now, base + GOLDFISH_TIME_LOW);
+ __raw_writel(now >> 32, base + GOLDFISH_TIME_HIGH);
+ __raw_writel(now, base + GOLDFISH_TIME_LOW);
if (time->tm_isdst > 0)
priv->isdst = 1;