]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
timer: goldfish: Use __raw_readl()
authorKuan-Wei Chiu <visitorckw@gmail.com>
Sat, 16 May 2026 07:39:56 +0000 (16:39 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 22 May 2026 22:47:54 +0000 (16:47 -0600)
The Goldfish timer registers are native endian, so they act as
big-endian on the m68k virt machine. Currently, this driver uses
readl(), which works by luck because it's currently broken on m68k.

Use __raw_readl() instead to avoid breaking this driver when the
endianness of readl() is fixed.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Tested-by: Daniel Palmer <daniel@thingy.jp>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
drivers/timer/goldfish_timer.c

index 70673bbd93c27cc5280bb5e0a5d8e5e7a593eb6a..91277d7932ac7010678ef5708c44f9388104656e 100644 (file)
@@ -31,8 +31,8 @@ static u64 goldfish_timer_get_count(struct udevice *dev)
         * We must read LOW before HIGH to latch the high 32-bit value
         * and ensure a consistent 64-bit timestamp.
         */
-       low = readl(priv->base + TIMER_TIME_LOW);
-       high = readl(priv->base + TIMER_TIME_HIGH);
+       low = __raw_readl(priv->base + TIMER_TIME_LOW);
+       high = __raw_readl(priv->base + TIMER_TIME_HIGH);
 
        time = ((u64)high << 32) | low;