From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 13/14] watchdog/mpcore_wdt: Start registers from 0x00 instead of 0x20
Date: Tue, 18 Jun 2013 20:50:37 +0530 [thread overview]
Message-ID: <79fc271d14f67b4787270cee02befa7597d96cb0.1371535243.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1371535241.git.viresh.kumar@linaro.org>
TWD_WDOG is at offset 0x20 from TWD base address. Current register offsets
contain this extra 0x20 offset, i.e. users were required to pass base address of
TWD instead of WDOG to WDOG driver.
Change this, so that users can pass base address of WDOG to WDOG driver instead
of TWD module. For this, subtract 0x20 from offsets of WDOG registers.
This could break any current users of TWD_WDOG, but i couldn't find any users of
this driver in current Linux tree. So, haven't fixed any platform code. If some
platforms are broken please report to me, so that we can get them fixed in this
patch only.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
arch/arm/include/asm/smp_twd.h | 19 -------------------
drivers/watchdog/mpcore_wdt.c | 24 +++++++++++++++++++++++-
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index a9791c5..c5d81a9 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -6,30 +6,11 @@
#define TWD_TIMER_CONTROL 0x08
#define TWD_TIMER_INTSTAT 0x0C
-#define TWD_WDOG_LOAD 0x20
-#define TWD_WDOG_COUNTER 0x24
-#define TWD_WDOG_CONTROL 0x28
-#define TWD_WDOG_INTSTAT 0x2C
-#define TWD_WDOG_RESETSTAT 0x30
-#define TWD_WDOG_DISABLE 0x34
-
-#define TWD_WDOG_LOAD_MIN 0x00000000
-#define TWD_WDOG_LOAD_MAX 0xFFFFFFFF
-
#define TWD_TIMER_CONTROL_ENABLE (1 << 0)
#define TWD_TIMER_CONTROL_ONESHOT (0 << 1)
#define TWD_TIMER_CONTROL_PERIODIC (1 << 1)
#define TWD_TIMER_CONTROL_IT_ENABLE (1 << 2)
-#define TWD_WDOG_CONTROL_ENABLE (1 << 0)
-#define TWD_WDOG_CONTROL_IRQ_ENABLE (1 << 2)
-#define TWD_WDOG_CONTROL_WDT_MODE (1 << 3)
-#define TWD_WDOG_CONTROL_WDT_PRESCALE(x) ((x) << 8)
-#define TWD_WDOG_CONTROL_PRESCALE_MIN 0x00
-#define TWD_WDOG_CONTROL_PRESCALE_MAX 0xFF
-
-#define TWD_WDOG_RESETSTAT_MASK 0x1
-
#include <linux/ioport.h>
struct twd_local_timer {
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
index 64878a7..d7ee4eb 100644
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
@@ -34,7 +34,29 @@
#include <linux/types.h>
#include <linux/watchdog.h>
-#include <asm/smp_twd.h>
+/*
+ * TWD_WDOG is at offset 0x20 from TWD base address. Following register offsets
+ * doesn't contain this extra 0x20 offset, i.e. users of TWD_WDOG must pass base
+ * address of WDOG to WDOG driver instead of TWD module.
+ */
+#define TWD_WDOG_LOAD 0x00
+#define TWD_WDOG_COUNTER 0x04
+#define TWD_WDOG_CONTROL 0x08
+#define TWD_WDOG_INTSTAT 0x0C
+#define TWD_WDOG_RESETSTAT 0x10
+#define TWD_WDOG_DISABLE 0x14
+
+#define TWD_WDOG_LOAD_MIN 0x00000000
+#define TWD_WDOG_LOAD_MAX 0xFFFFFFFF
+
+#define TWD_WDOG_CONTROL_ENABLE (1 << 0)
+#define TWD_WDOG_CONTROL_IRQ_ENABLE (1 << 2)
+#define TWD_WDOG_CONTROL_WDT_MODE (1 << 3)
+#define TWD_WDOG_CONTROL_WDT_PRESCALE(x) ((x) << 8)
+#define TWD_WDOG_CONTROL_PRESCALE_MIN 0x00
+#define TWD_WDOG_CONTROL_PRESCALE_MAX 0xFF
+
+#define TWD_WDOG_RESETSTAT_MASK 0x1
struct mpcore_wdt {
struct watchdog_device wdd;
--
1.7.12.rc2.18.g61b472e
next prev parent reply other threads:[~2013-06-18 15:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 15:20 [PATCH V3 00/14] watchdog: ARM mpcore Improvements Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 01/14] watchdog/mpcore_wdt: Mark it as BROKEN Viresh Kumar
2013-06-18 15:42 ` Guenter Roeck
2013-06-18 16:11 ` Marc Zyngier
2013-06-18 16:35 ` Olof Johansson
2013-06-19 3:10 ` Viresh Kumar
2013-06-19 7:56 ` Marc Zyngier
2013-06-19 8:15 ` Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 02/14] watchdog/mpcore_wdt: convert to watchdog core Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 03/14] watchdog/mpcore_wdt: Fix multiline comments Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 04/14] watchdog/mpcore_wdt: Arrange #includes in alphabetical order Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 05/14] watchdog/mpcore_wdt: Set default heartbeat in probe instead of init Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 06/14] watchdog/mpcore_wdt: convert to use module_platform_driver() Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 07/14] watchdog/mpcore_wdt: Add support for dev_pm_ops interface Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 08/14] watchdog/mpcore_wdt: disable wdt in suspend only if it is busy Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 09/14] watchdog/mpcore_wdt: replace (__raw_)readl/writel with lighter *_relaxed variants Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 10/14] watchdog/mpcore_wdt: Add support for WDIOC_GETBOOTSTATUS IOCTL Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 11/14] watchdog/mpcore_wdt: Add clock framework support Viresh Kumar
2013-06-18 15:20 ` [PATCH V3 12/14] watchdog/mpcore_wdt: use correct clk_rate to program timeout Viresh Kumar
2013-06-18 15:20 ` Viresh Kumar [this message]
2013-06-18 15:20 ` [PATCH V3 14/14] watchdog/mpcore_wdt: Add DT probing support for ARM mpcore watchdog Viresh Kumar
2013-06-18 16:03 ` [PATCH V3 00/14] watchdog: ARM mpcore Improvements Russell King - ARM Linux
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=79fc271d14f67b4787270cee02befa7597d96cb0.1371535243.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).