From: Rosen Penev <rosenp@gmail.com>
To: linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCHv3 2/2] watchdog: pika_wdt: enable COMPILE_TEST builds
Date: Mon, 8 Jun 2026 14:04:02 -0700 [thread overview]
Message-ID: <20260608210402.31545-3-rosenp@gmail.com> (raw)
In-Reply-To: <20260608210402.31545-1-rosenp@gmail.com>
Replace powerpc-specific I/O accessors (in_be32/out_be32) with
generic ones (ioread32be/iowrite32be) so the driver can be
compile-tested on other architectures. Relax the Kconfig
dependency accordingly and add the required HAS_IOMEM.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/watchdog/Kconfig | 3 ++-
drivers/watchdog/pika_wdt.c | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 8319c503319a..855736eaca2c 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -2040,7 +2040,8 @@ config 8xxx_WDT
config PIKA_WDT
tristate "PIKA FPGA Watchdog"
- depends on WARP || (PPC64 && COMPILE_TEST)
+ depends on WARP || COMPILE_TEST
+ depends on HAS_IOMEM
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 d567103ec5e4..e599aff8329b 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);
}
/*
@@ -243,7 +243,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");
@@ -265,7 +265,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
next prev parent reply other threads:[~2026-06-08 21:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 21:04 [PATCHv3 0/2] watchdog: pika_wdt: portability and timer lifecycle fixes Rosen Penev
2026-06-08 21:04 ` [PATCHv3 1/2] watchdog: pika_wdt: fix timer lifecycle bugs Rosen Penev
2026-06-08 22:52 ` Guenter Roeck
2026-06-08 21:04 ` Rosen Penev [this message]
2026-06-08 22:55 ` [PATCHv3 2/2] watchdog: pika_wdt: enable COMPILE_TEST builds Guenter Roeck
2026-06-08 23:46 ` Rosen Penev
2026-06-09 3:09 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260608210402.31545-3-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome