[PATCH] watchdog: pika_wdt: replace in_be32/out_be32 with ioread32be/iowrite32be

From: Rosen Penev

Date: Mon Jun 01 2026 - 23:56:54 EST


Convert the ppc4xx-specific in_be32/out_be32 to the portable
ioread32be/iowrite32be. Also relax the Kconfig dependency from
(PPC64 && COMPILE_TEST) to just COMPILE_TEST to get build coverage.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
drivers/watchdog/Kconfig | 2 +-
drivers/watchdog/pika_wdt.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 8319c503319a..7c5d6f642a96 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -2040,7 +2040,7 @@ config 8xxx_WDT

config PIKA_WDT
tristate "PIKA FPGA Watchdog"
- depends on WARP || (PPC64 && COMPILE_TEST)
+ depends on WARP || COMPILE_TEST
default WARP
help
This enables the watchdog in the PIKA FPGA. Currently used on
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c
index 87b8988d2520..2d3c201540a9 100644
--- a/drivers/watchdog/pika_wdt.c
+++ b/drivers/watchdog/pika_wdt.c
@@ -77,10 +77,10 @@ static inline void pikawdt_reset(void)
* seconds. Valid ranges are 1 to 15 seconds. The value can
* be modified dynamically.
*/
- unsigned reset = in_be32(pikawdt_private.fpga + 0x14);
+ unsigned reset = ioread32be(pikawdt_private.fpga + 0x14);
/* enable with max timeout - 15 seconds */
reset |= (1 << 7) + (WDT_HW_TIMEOUT << 8);
- out_be32(pikawdt_private.fpga + 0x14, reset);
+ iowrite32be(reset, pikawdt_private.fpga + 0x14);
}

/*
@@ -242,7 +242,7 @@ static int __init pikawdt_init(void)
return -ENOMEM;
}

- ident.firmware_version = in_be32(pikawdt_private.fpga + 0x1c) & 0xffff;
+ ident.firmware_version = ioread32be(pikawdt_private.fpga + 0x1c) & 0xffff;

/* POST information is in the sd area. */
np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd");
@@ -264,7 +264,7 @@ static int __init pikawdt_init(void)
* Bit 31, WDOG: Set to 1 when the last reset was caused by a watchdog
* timeout.
*/
- post1 = in_be32(fpga + 0x40);
+ post1 = ioread32be(fpga + 0x40);
if (post1 & 0x80000000)
pikawdt_private.bootstatus = WDIOF_CARDRESET;

--
2.54.0