* [PATCH v4 00/18] Armada 370/XP watchdog support
@ 2014-01-22 23:04 Ezequiel Garcia
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:04 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
After some lengthy discussion on the [v2] and [v3] patchsets, here's a new
round. I hope I haven't forgotten anything.
[v2] http://www.spinics.net/lists/arm-kernel/msg302104.html
[v3] http://www.spinics.net/lists/arm-kernel/msg302245.html
The main changes from v3 are:
* It wasn't nice to break DT compatibility by adding a second resource
requirement, so we provided a fallback to use the RSTOUT address.
All in all, the solution doesn't look too bad.
* Added a full watchdog stop at driver probe time, *before* the call
to request_irq().
Notice that currently the request_irq() doesn't seem to clear the
pending interruption. This means the BRIDGE_CAUSE clear removal is
still not safe.
This should be fixed sooner than later and, of course, before this
gets merged.
* Rework the interruption request, to use devm_request_irq() and
avoid dealing with IRQ releasing.
* Added proper clock error handling and fixed the probe() error path.
* Typos and minor issues got fixed
Thanks to everyone who has helped reviewing the previous sets! It's certainly
easier to move forward when you get so much nice feedback...
Ezequiel Garcia (18):
ARM: Introduce atomic MMIO modify
clocksource: orion: Use atomic access for shared registers
watchdog: orion: Add clock error handling
watchdog: orion: Use atomic access for shared registers
watchdog: orion: Remove unused macros
watchdog: orion: Make sure the watchdog is initially stopped
watchdog: orion: Handle IRQ
watchdog: orion: Make RSTOUT register a separate resource
watchdog: orion: Remove unneeded BRIDGE_CAUSE clear
watchdog: orion: Introduce an orion_watchdog device structure
watchdog: orion: Introduce per-compatible of_device_id data
watchdog: orion: Add per-compatible clock initialization
watchdog: orion: Add per-compatible watchdog start implementation
watchdog: orion: Add support for Armada 370 and Armada XP SoC
ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree
ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree
watchdog: orion: Enable the build on ARCH_MVEBU
ARM: mvebu: Enable watchdog support in defconfig
.../devicetree/bindings/watchdog/marvel.txt | 8 +-
arch/arm/boot/dts/armada-370-xp.dtsi | 4 +
arch/arm/boot/dts/armada-370.dtsi | 5 +
arch/arm/boot/dts/armada-xp.dtsi | 6 +
arch/arm/boot/dts/kirkwood.dtsi | 2 +-
arch/arm/configs/mvebu_defconfig | 2 +
arch/arm/include/asm/io.h | 6 +
arch/arm/kernel/io.c | 35 ++
arch/arm/mach-dove/include/mach/bridge-regs.h | 1 +
arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 1 +
arch/arm/mach-mv78xx0/include/mach/bridge-regs.h | 1 +
arch/arm/mach-orion5x/include/mach/bridge-regs.h | 1 +
arch/arm/plat-orion/common.c | 10 +-
drivers/clocksource/time-orion.c | 28 +-
drivers/watchdog/Kconfig | 2 +-
drivers/watchdog/orion_wdt.c | 370 ++++++++++++++++-----
16 files changed, 373 insertions(+), 109 deletions(-)
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH v4 01/18] ARM: Introduce atomic MMIO modify
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-22 23:04 ` Ezequiel Garcia
[not found] ` <1390431915-5115-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:04 ` [PATCH v4 02/18] clocksource: orion: Use atomic access for shared registers Ezequiel Garcia
` (18 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:04 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Some SoC have MMIO regions that are shared across orthogonal
subsystems. This commit implements a possible solution for the
thread-safe access of such regions through a spinlock-protected API.
Concurrent access is protected with a single spinlock for the
entire MMIO address space. While this protects shared-registers,
it also serializes access to unrelated/unshared registers.
We add relaxed and non-relaxed variants, by using writel_relaxed and writel,
respectively. The rationale for this is that some users may not require
register write completion but only thread-safe access to a register.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm/include/asm/io.h | 6 ++++++
arch/arm/kernel/io.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index fbeb39c..8aa4cca 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -38,6 +38,12 @@
#define isa_bus_to_virt phys_to_virt
/*
+ * Atomic MMIO-wide IO modify
+ */
+extern void atomic_io_modify(void __iomem *reg, u32 mask, u32 set);
+extern void atomic_io_modify_relaxed(void __iomem *reg, u32 mask, u32 set);
+
+/*
* Generic IO read/write. These perform native-endian accesses. Note
* that some architectures will want to re-define __raw_{read,write}w.
*/
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
index dcd5b4d..9203cf8 100644
--- a/arch/arm/kernel/io.c
+++ b/arch/arm/kernel/io.c
@@ -1,6 +1,41 @@
#include <linux/export.h>
#include <linux/types.h>
#include <linux/io.h>
+#include <linux/spinlock.h>
+
+static DEFINE_RAW_SPINLOCK(__io_lock);
+
+/*
+ * Generic atomic MMIO modify.
+ *
+ * Allows thread-safe access to registers shared by unrelated subsystems.
+ * The access is protected by a single MMIO-wide lock.
+ */
+void atomic_io_modify_relaxed(void __iomem *reg, u32 mask, u32 set)
+{
+ unsigned long flags;
+ u32 value;
+
+ raw_spin_lock_irqsave(&__io_lock, flags);
+ value = readl_relaxed(reg) & ~mask;
+ value |= (set & mask);
+ writel_relaxed(value, reg);
+ raw_spin_unlock_irqrestore(&__io_lock, flags);
+}
+EXPORT_SYMBOL(atomic_io_modify_relaxed);
+
+void atomic_io_modify(void __iomem *reg, u32 mask, u32 set)
+{
+ unsigned long flags;
+ u32 value;
+
+ raw_spin_lock_irqsave(&__io_lock, flags);
+ value = readl_relaxed(reg) & ~mask;
+ value |= (set & mask);
+ writel(value, reg);
+ raw_spin_unlock_irqrestore(&__io_lock, flags);
+}
+EXPORT_SYMBOL(atomic_io_modify);
/*
* Copy data from IO memory space to "real" memory space.
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 02/18] clocksource: orion: Use atomic access for shared registers
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:04 ` [PATCH v4 01/18] ARM: Introduce atomic MMIO modify Ezequiel Garcia
@ 2014-01-22 23:04 ` Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 03/18] watchdog: orion: Add clock error handling Ezequiel Garcia
` (17 subsequent siblings)
19 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:04 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Replace the driver-specific thread-safe shared register API
by the recently introduced atomic_io_clear_set().
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/clocksource/time-orion.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/drivers/clocksource/time-orion.c b/drivers/clocksource/time-orion.c
index 9c7f018..3f14e56 100644
--- a/drivers/clocksource/time-orion.c
+++ b/drivers/clocksource/time-orion.c
@@ -35,20 +35,6 @@
#define ORION_ONESHOT_MAX 0xfffffffe
static void __iomem *timer_base;
-static DEFINE_SPINLOCK(timer_ctrl_lock);
-
-/*
- * Thread-safe access to TIMER_CTRL register
- * (shared with watchdog timer)
- */
-void orion_timer_ctrl_clrset(u32 clr, u32 set)
-{
- spin_lock(&timer_ctrl_lock);
- writel((readl(timer_base + TIMER_CTRL) & ~clr) | set,
- timer_base + TIMER_CTRL);
- spin_unlock(&timer_ctrl_lock);
-}
-EXPORT_SYMBOL(orion_timer_ctrl_clrset);
/*
* Free-running clocksource handling.
@@ -68,7 +54,8 @@ static int orion_clkevt_next_event(unsigned long delta,
{
/* setup and enable one-shot timer */
writel(delta, timer_base + TIMER1_VAL);
- orion_timer_ctrl_clrset(TIMER1_RELOAD_EN, TIMER1_EN);
+ atomic_io_modify(timer_base + TIMER_CTRL,
+ TIMER1_RELOAD_EN | TIMER1_EN, TIMER1_EN);
return 0;
}
@@ -80,10 +67,13 @@ static void orion_clkevt_mode(enum clock_event_mode mode,
/* setup and enable periodic timer at 1/HZ intervals */
writel(ticks_per_jiffy - 1, timer_base + TIMER1_RELOAD);
writel(ticks_per_jiffy - 1, timer_base + TIMER1_VAL);
- orion_timer_ctrl_clrset(0, TIMER1_RELOAD_EN | TIMER1_EN);
+ atomic_io_modify(timer_base + TIMER_CTRL,
+ TIMER1_RELOAD_EN | TIMER1_EN,
+ TIMER1_RELOAD_EN | TIMER1_EN);
} else {
/* disable timer */
- orion_timer_ctrl_clrset(TIMER1_RELOAD_EN | TIMER1_EN, 0);
+ atomic_io_modify(timer_base + TIMER_CTRL,
+ TIMER1_RELOAD_EN | TIMER1_EN, 0);
}
}
@@ -131,7 +121,9 @@ static void __init orion_timer_init(struct device_node *np)
/* setup timer0 as free-running clocksource */
writel(~0, timer_base + TIMER0_VAL);
writel(~0, timer_base + TIMER0_RELOAD);
- orion_timer_ctrl_clrset(0, TIMER0_RELOAD_EN | TIMER0_EN);
+ atomic_io_modify(timer_base + TIMER_CTRL,
+ TIMER0_RELOAD_EN | TIMER0_EN,
+ TIMER0_RELOAD_EN | TIMER0_EN);
clocksource_mmio_init(timer_base + TIMER0_VAL, "orion_clocksource",
clk_get_rate(clk), 300, 32,
clocksource_mmio_readl_down);
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 03/18] watchdog: orion: Add clock error handling
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:04 ` [PATCH v4 01/18] ARM: Introduce atomic MMIO modify Ezequiel Garcia
2014-01-22 23:04 ` [PATCH v4 02/18] clocksource: orion: Use atomic access for shared registers Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-4-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 04/18] watchdog: orion: Use atomic access for shared registers Ezequiel Garcia
` (16 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
This commit adds a check for clk_prepare_enable success and introduces
an error path to disable the clock properly.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index f7722a4..7f19fa3 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -151,17 +151,24 @@ static int orion_wdt_probe(struct platform_device *pdev)
clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "Orion Watchdog missing clock\n");
- return -ENODEV;
+ return PTR_ERR(clk);
}
- clk_prepare_enable(clk);
+ ret = clk_prepare_enable(clk);
+ if (ret)
+ return ret;
wdt_tclk = clk_get_rate(clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -ENODEV;
+ if (!res) {
+ ret = -ENODEV;
+ goto disable_clk;
+ }
+
wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
- if (!wdt_reg)
- return -ENOMEM;
+ if (!wdt_reg) {
+ ret = -ENOMEM;
+ goto disable_clk;
+ }
wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
@@ -171,14 +178,16 @@ static int orion_wdt_probe(struct platform_device *pdev)
watchdog_set_nowayout(&orion_wdt, nowayout);
ret = watchdog_register_device(&orion_wdt);
- if (ret) {
- clk_disable_unprepare(clk);
- return ret;
- }
+ if (ret)
+ goto disable_clk;
pr_info("Initial timeout %d sec%s\n",
orion_wdt.timeout, nowayout ? ", nowayout" : "");
return 0;
+
+disable_clk:
+ clk_disable_unprepare(clk);
+ return ret;
}
static int orion_wdt_remove(struct platform_device *pdev)
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 04/18] watchdog: orion: Use atomic access for shared registers
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (2 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 03/18] watchdog: orion: Add clock error handling Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-5-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 05/18] watchdog: orion: Remove unused macros Ezequiel Garcia
` (15 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Since the timer control register is shared with the clocksource driver,
use the recently introduced atomic_io_clear_set() to access such register.
Given the watchdog core already provides serialization for all the
watchdog ops, this commit allows to remove the spinlock entirely.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 42 +++++-------------------------------------
1 file changed, 5 insertions(+), 37 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 7f19fa3..b92a991 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -20,7 +20,6 @@
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/io.h>
-#include <linux/spinlock.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/of.h>
@@ -46,25 +45,16 @@ static unsigned int wdt_max_duration; /* (seconds) */
static struct clk *clk;
static unsigned int wdt_tclk;
static void __iomem *wdt_reg;
-static DEFINE_SPINLOCK(wdt_lock);
static int orion_wdt_ping(struct watchdog_device *wdt_dev)
{
- spin_lock(&wdt_lock);
-
/* Reload watchdog duration */
writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL);
-
- spin_unlock(&wdt_lock);
return 0;
}
static int orion_wdt_start(struct watchdog_device *wdt_dev)
{
- u32 reg;
-
- spin_lock(&wdt_lock);
-
/* Set watchdog duration */
writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL);
@@ -72,48 +62,26 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
writel(~WDT_INT_REQ, BRIDGE_CAUSE);
/* Enable watchdog timer */
- reg = readl(wdt_reg + TIMER_CTRL);
- reg |= WDT_EN;
- writel(reg, wdt_reg + TIMER_CTRL);
+ atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN);
/* Enable reset on watchdog */
- reg = readl(RSTOUTn_MASK);
- reg |= WDT_RESET_OUT_EN;
- writel(reg, RSTOUTn_MASK);
-
- spin_unlock(&wdt_lock);
+ atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
return 0;
}
static int orion_wdt_stop(struct watchdog_device *wdt_dev)
{
- u32 reg;
-
- spin_lock(&wdt_lock);
-
/* Disable reset on watchdog */
- reg = readl(RSTOUTn_MASK);
- reg &= ~WDT_RESET_OUT_EN;
- writel(reg, RSTOUTn_MASK);
+ atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, 0);
/* Disable watchdog timer */
- reg = readl(wdt_reg + TIMER_CTRL);
- reg &= ~WDT_EN;
- writel(reg, wdt_reg + TIMER_CTRL);
-
- spin_unlock(&wdt_lock);
+ atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0);
return 0;
}
static unsigned int orion_wdt_get_timeleft(struct watchdog_device *wdt_dev)
{
- unsigned int time_left;
-
- spin_lock(&wdt_lock);
- time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk;
- spin_unlock(&wdt_lock);
-
- return time_left;
+ return readl(wdt_reg + WDT_VAL) / wdt_tclk;
}
static int orion_wdt_set_timeout(struct watchdog_device *wdt_dev,
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 05/18] watchdog: orion: Remove unused macros
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (3 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 04/18] watchdog: orion: Use atomic access for shared registers Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-6-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 06/18] watchdog: orion: Make sure the watchdog is initially stopped Ezequiel Garcia
` (14 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
These are not used anywhere so it's safe to remove them.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index b92a991..6746033 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -33,8 +33,6 @@
#define WDT_VAL 0x0024
#define WDT_MAX_CYCLE_COUNT 0xffffffff
-#define WDT_IN_USE 0
-#define WDT_OK_TO_CLOSE 1
#define WDT_RESET_OUT_EN BIT(1)
#define WDT_INT_REQ BIT(3)
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 06/18] watchdog: orion: Make sure the watchdog is initially stopped
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (4 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 05/18] watchdog: orion: Remove unused macros Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-7-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 07/18] watchdog: orion: Handle IRQ Ezequiel Garcia
` (13 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Having the watchdog initially fully stopped is important to avoid
any spurious watchdog triggers, in case the registers are not in
its reset state.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 6746033..2dbeee9 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -142,6 +142,9 @@ static int orion_wdt_probe(struct platform_device *pdev)
orion_wdt.max_timeout = wdt_max_duration;
watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev);
+ /* Let's make sure the watchdog is fully stopped */
+ orion_wdt_stop(&orion_wdt);
+
watchdog_set_nowayout(&orion_wdt, nowayout);
ret = watchdog_register_device(&orion_wdt);
if (ret)
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 07/18] watchdog: orion: Handle IRQ
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (5 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 06/18] watchdog: orion: Make sure the watchdog is initially stopped Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-8-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource Ezequiel Garcia
` (12 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
DT-enabled where an irqchip driver for the brigde interrupt controller is
available can handle the watchdog IRQ properly. Therefore, we request
the interruption and add a dummy handler that merely calls panic().
This is done in order to have an initial 'ack' of the interruption,
which clears the watchdog state.
Furthermore, since some platforms don't have such IRQ, this commit
makes the interruption specification optional.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
.../devicetree/bindings/watchdog/marvel.txt | 2 ++
drivers/watchdog/orion_wdt.c | 24 +++++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
index 5dc8d30..0731fbd 100644
--- a/Documentation/devicetree/bindings/watchdog/marvel.txt
+++ b/Documentation/devicetree/bindings/watchdog/marvel.txt
@@ -7,6 +7,7 @@ Required Properties:
Optional properties:
+- interrupts : Contains the IRQ for watchdog expiration
- timeout-sec : Contains the watchdog timeout in seconds
Example:
@@ -14,6 +15,7 @@ Example:
wdt@20300 {
compatible = "marvell,orion-wdt";
reg = <0x20300 0x28>;
+ interrupts = <3>;
timeout-sec = <10>;
status = "okay";
};
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 2dbeee9..f5e7b17 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/watchdog.h>
#include <linux/init.h>
+#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
@@ -109,10 +110,16 @@ static struct watchdog_device orion_wdt = {
.min_timeout = 1,
};
+static irqreturn_t orion_wdt_irq(int irq, void *devid)
+{
+ panic("Watchdog Timeout");
+ return IRQ_HANDLED;
+}
+
static int orion_wdt_probe(struct platform_device *pdev)
{
struct resource *res;
- int ret;
+ int ret, irq;
clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
@@ -145,6 +152,21 @@ static int orion_wdt_probe(struct platform_device *pdev)
/* Let's make sure the watchdog is fully stopped */
orion_wdt_stop(&orion_wdt);
+ /* It's important to request the IRQ once the watchdog is disabled */
+ irq = platform_get_irq(pdev, 0);
+ if (irq >= 0) {
+ /*
+ * Not all supported platforms specify an interruption for the
+ * watchdog, so let's make it optional.
+ */
+ ret = devm_request_irq(&pdev->dev, irq, orion_wdt_irq, 0,
+ pdev->name, &orion_wdt);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to request IRQ\n");
+ goto disable_clk;
+ }
+ }
+
watchdog_set_nowayout(&orion_wdt, nowayout);
ret = watchdog_register_device(&orion_wdt);
if (ret)
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (6 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 07/18] watchdog: orion: Handle IRQ Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-9-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 09/18] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear Ezequiel Garcia
` (11 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
In order to support other SoC, it's required to distinguish
the 'control' timer register, from the 'rstout' register
that enables system reset on watchdog expiration.
To prevent a compatibility break, this commit adds a fallback
to a hardcoded RSTOUT address.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
.../devicetree/bindings/watchdog/marvel.txt | 6 ++-
arch/arm/mach-dove/include/mach/bridge-regs.h | 1 +
arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 1 +
arch/arm/mach-mv78xx0/include/mach/bridge-regs.h | 1 +
arch/arm/mach-orion5x/include/mach/bridge-regs.h | 1 +
arch/arm/plat-orion/common.c | 10 +++--
drivers/watchdog/orion_wdt.c | 44 +++++++++++++++++++++-
7 files changed, 56 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
index 0731fbd..1544fe9 100644
--- a/Documentation/devicetree/bindings/watchdog/marvel.txt
+++ b/Documentation/devicetree/bindings/watchdog/marvel.txt
@@ -3,7 +3,9 @@
Required Properties:
- Compatibility : "marvell,orion-wdt"
-- reg : Address of the timer registers
+- reg : Should contain two entries: first one with the
+ timer control address, second one with the
+ rstout enable address.
Optional properties:
@@ -14,7 +16,7 @@ Example:
wdt@20300 {
compatible = "marvell,orion-wdt";
- reg = <0x20300 0x28>;
+ reg = <0x20300 0x28>, <0x20108 0x4>;
interrupts = <3>;
timeout-sec = <10>;
status = "okay";
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
index 5362df3..f4a5b34 100644
--- a/arch/arm/mach-dove/include/mach/bridge-regs.h
+++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
@@ -21,6 +21,7 @@
#define CPU_CTRL_PCIE1_LINK 0x00000008
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
+#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
#define SOFT_RESET_OUT_EN 0x00000004
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 8b9d1c9..60f6421 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -21,6 +21,7 @@
#define CPU_RESET 0x00000002
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
+#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
#define SOFT_RESET_OUT_EN 0x00000004
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
index 5f03484..e20d6da 100644
--- a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
+++ b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
@@ -15,6 +15,7 @@
#define L2_WRITETHROUGH 0x00020000
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
+#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
#define SOFT_RESET_OUT_EN 0x00000004
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
index f727d03..5766e3f 100644
--- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
+++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
@@ -18,6 +18,7 @@
#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104)
#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108)
+#define RSTOUTn_MASK_PHYS (ORION5X_BRIDGE_PHYS_BASE + 0x108)
#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c)
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index c66d163..3375037 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -594,14 +594,16 @@ void __init orion_spi_1_init(unsigned long mapbase)
/*****************************************************************************
* Watchdog
****************************************************************************/
-static struct resource orion_wdt_resource =
- DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
+static struct resource orion_wdt_resource[] = {
+ DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
+ DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
+};
static struct platform_device orion_wdt_device = {
.name = "orion_wdt",
.id = -1,
- .num_resources = 1,
- .resource = &orion_wdt_resource,
+ .num_resources = ARRAY_SIZE(orion_wdt_resource),
+ .resource = orion_wdt_resource,
};
void __init orion_wdt_init(void)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index f5e7b17..ba8eea9d 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -26,6 +26,12 @@
#include <linux/of.h>
#include <mach/bridge-regs.h>
+/* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */
+#define ORION_RSTOUT_MASK_OFFSET 0x20108
+
+/* Internal registers can be configured at any 1 MiB aligned address */
+#define INTERNAL_REGS_MASK ~(SZ_1M - 1)
+
/*
* Watchdog timer block registers.
*/
@@ -44,6 +50,7 @@ static unsigned int wdt_max_duration; /* (seconds) */
static struct clk *clk;
static unsigned int wdt_tclk;
static void __iomem *wdt_reg;
+static void __iomem *wdt_rstout;
static int orion_wdt_ping(struct watchdog_device *wdt_dev)
{
@@ -64,14 +71,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN);
/* Enable reset on watchdog */
- atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
+ atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
return 0;
}
static int orion_wdt_stop(struct watchdog_device *wdt_dev)
{
/* Disable reset on watchdog */
- atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, 0);
+ atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, 0);
/* Disable watchdog timer */
atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0);
@@ -116,6 +123,33 @@ static irqreturn_t orion_wdt_irq(int irq, void *devid)
return IRQ_HANDLED;
}
+/*
+ * The original devicetree binding for this driver specified only
+ * one memory resource, so in order to keep DT backwards compatibility
+ * we try to fallback to a hardcoded register address, if the resource
+ * is missing from the devicetree.
+ */
+static void __iomem *try_rstout_ioremap(struct platform_device *pdev,
+ phys_addr_t internal_regs)
+{
+ struct resource *res;
+ phys_addr_t rstout;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ if (res)
+ return devm_ioremap(&pdev->dev, res->start,
+ resource_size(res));
+
+ /* This workaround works only for "orion-wdt", DT-enabled */
+ if (!of_device_is_compatible(pdev->dev.of_node, "marvell,orion-wdt"))
+ return NULL;
+
+ rstout = internal_regs + ORION_RSTOUT_MASK_OFFSET;
+
+ WARN(1, FW_BUG "falling back to harcoded RSTOUT reg 0x%x\n", rstout);
+ return devm_ioremap(&pdev->dev, rstout, 0x4);
+}
+
static int orion_wdt_probe(struct platform_device *pdev)
{
struct resource *res;
@@ -143,6 +177,12 @@ static int orion_wdt_probe(struct platform_device *pdev)
goto disable_clk;
}
+ wdt_rstout = try_rstout_ioremap(pdev, res->start & INTERNAL_REGS_MASK);
+ if (!wdt_rstout) {
+ ret = -ENODEV;
+ goto disable_clk;
+ }
+
wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
orion_wdt.timeout = wdt_max_duration;
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 09/18] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (7 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-10-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 10/18] watchdog: orion: Introduce an orion_watchdog device structure Ezequiel Garcia
` (10 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
After adding the IRQ request, the BRIDGE_CAUSE bit should be cleared by the
bridge interrupt controller. There's no longer a need to do it in the watchdog
driver, so we can simply remove it.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index ba8eea9d..80f6a77 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -24,7 +24,6 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/of.h>
-#include <mach/bridge-regs.h>
/* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */
#define ORION_RSTOUT_MASK_OFFSET 0x20108
@@ -42,7 +41,6 @@
#define WDT_MAX_CYCLE_COUNT 0xffffffff
#define WDT_RESET_OUT_EN BIT(1)
-#define WDT_INT_REQ BIT(3)
static bool nowayout = WATCHDOG_NOWAYOUT;
static int heartbeat = -1; /* module parameter (seconds) */
@@ -64,9 +62,6 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
/* Set watchdog duration */
writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL);
- /* Clear watchdog timer interrupt */
- writel(~WDT_INT_REQ, BRIDGE_CAUSE);
-
/* Enable watchdog timer */
atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN);
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 10/18] watchdog: orion: Introduce an orion_watchdog device structure
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (8 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 09/18] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-11-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 11/18] watchdog: orion: Introduce per-compatible of_device_id data Ezequiel Garcia
` (9 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
In order to prepare to support multiple compatible-strings, this
commit adds a device structure to hold the driver's state.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 104 ++++++++++++++++++++++++++-----------------
1 file changed, 64 insertions(+), 40 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 80f6a77..96dba41 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -44,45 +44,56 @@
static bool nowayout = WATCHDOG_NOWAYOUT;
static int heartbeat = -1; /* module parameter (seconds) */
-static unsigned int wdt_max_duration; /* (seconds) */
-static struct clk *clk;
-static unsigned int wdt_tclk;
-static void __iomem *wdt_reg;
-static void __iomem *wdt_rstout;
+
+struct orion_watchdog {
+ struct watchdog_device wdt;
+ void __iomem *reg;
+ void __iomem *rstout;
+ unsigned long clk_rate;
+ struct clk *clk;
+};
static int orion_wdt_ping(struct watchdog_device *wdt_dev)
{
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
/* Reload watchdog duration */
- writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL);
+ writel(dev->clk_rate * wdt_dev->timeout, dev->reg + WDT_VAL);
return 0;
}
static int orion_wdt_start(struct watchdog_device *wdt_dev)
{
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+
/* Set watchdog duration */
- writel(wdt_tclk * wdt_dev->timeout, wdt_reg + WDT_VAL);
+ writel(dev->clk_rate * wdt_dev->timeout, dev->reg + WDT_VAL);
/* Enable watchdog timer */
- atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN);
+ atomic_io_modify(dev->reg + TIMER_CTRL, WDT_EN, WDT_EN);
/* Enable reset on watchdog */
- atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
+ atomic_io_modify(dev->rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
+
return 0;
}
static int orion_wdt_stop(struct watchdog_device *wdt_dev)
{
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+
/* Disable reset on watchdog */
- atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, 0);
+ atomic_io_modify(dev->rstout, WDT_RESET_OUT_EN, 0);
/* Disable watchdog timer */
- atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0);
+ atomic_io_modify(dev->reg + TIMER_CTRL, WDT_EN, 0);
+
return 0;
}
static unsigned int orion_wdt_get_timeleft(struct watchdog_device *wdt_dev)
{
- return readl(wdt_reg + WDT_VAL) / wdt_tclk;
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+ return readl(dev->reg + WDT_VAL) / dev->clk_rate;
}
static int orion_wdt_set_timeout(struct watchdog_device *wdt_dev,
@@ -106,12 +117,6 @@ static const struct watchdog_ops orion_wdt_ops = {
.get_timeleft = orion_wdt_get_timeleft,
};
-static struct watchdog_device orion_wdt = {
- .info = &orion_wdt_info,
- .ops = &orion_wdt_ops,
- .min_timeout = 1,
-};
-
static irqreturn_t orion_wdt_irq(int irq, void *devid)
{
panic("Watchdog Timeout");
@@ -147,18 +152,29 @@ static void __iomem * try_rstout_ioremap(struct platform_device *pdev,
static int orion_wdt_probe(struct platform_device *pdev)
{
+ struct orion_watchdog *dev;
+ unsigned int wdt_max_duration; /* (seconds) */
struct resource *res;
int ret, irq;
- clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(clk)) {
+ dev = devm_kzalloc(&pdev->dev, sizeof(struct orion_watchdog),
+ GFP_KERNEL);
+ if (!dev)
+ return -ENOMEM;
+
+ dev->wdt.info = &orion_wdt_info;
+ dev->wdt.ops = &orion_wdt_ops;
+ dev->wdt.min_timeout = 1;
+
+ dev->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(dev->clk)) {
dev_err(&pdev->dev, "Orion Watchdog missing clock\n");
- return PTR_ERR(clk);
+ return PTR_ERR(dev->clk);
}
- ret = clk_prepare_enable(clk);
+ ret = clk_prepare_enable(dev->clk);
if (ret)
return ret;
- wdt_tclk = clk_get_rate(clk);
+ dev->clk_rate = clk_get_rate(dev->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -166,26 +182,30 @@ static int orion_wdt_probe(struct platform_device *pdev)
goto disable_clk;
}
- wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
- if (!wdt_reg) {
+ dev->reg = devm_ioremap(&pdev->dev, res->start,
+ resource_size(res));
+ if (!dev->reg) {
ret = -ENOMEM;
goto disable_clk;
}
- wdt_rstout = try_rstout_ioremap(pdev, res->start & INTERNAL_REGS_MASK);
- if (!wdt_rstout) {
+ dev->rstout = try_rstout_ioremap(pdev, res->start & INTERNAL_REGS_MASK);
+ if (!dev->rstout) {
ret = -ENODEV;
goto disable_clk;
}
- wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
+ wdt_max_duration = WDT_MAX_CYCLE_COUNT / dev->clk_rate;
+
+ dev->wdt.timeout = wdt_max_duration;
+ dev->wdt.max_timeout = wdt_max_duration;
+ watchdog_init_timeout(&dev->wdt, heartbeat, &pdev->dev);
- orion_wdt.timeout = wdt_max_duration;
- orion_wdt.max_timeout = wdt_max_duration;
- watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev);
+ platform_set_drvdata(pdev, &dev->wdt);
+ watchdog_set_drvdata(&dev->wdt, dev);
/* Let's make sure the watchdog is fully stopped */
- orion_wdt_stop(&orion_wdt);
+ orion_wdt_stop(&dev->wdt);
/* It's important to request the IRQ once the watchdog is disabled */
irq = platform_get_irq(pdev, 0);
@@ -195,37 +215,41 @@ static int orion_wdt_probe(struct platform_device *pdev)
* watchdog, so let's make it optional.
*/
ret = devm_request_irq(&pdev->dev, irq, orion_wdt_irq, 0,
- pdev->name, &orion_wdt);
+ pdev->name, dev);
if (ret < 0) {
dev_err(&pdev->dev, "failed to request IRQ\n");
goto disable_clk;
}
}
- watchdog_set_nowayout(&orion_wdt, nowayout);
- ret = watchdog_register_device(&orion_wdt);
+ watchdog_set_nowayout(&dev->wdt, nowayout);
+ ret = watchdog_register_device(&dev->wdt);
if (ret)
goto disable_clk;
pr_info("Initial timeout %d sec%s\n",
- orion_wdt.timeout, nowayout ? ", nowayout" : "");
+ dev->wdt.timeout, nowayout ? ", nowayout" : "");
return 0;
disable_clk:
- clk_disable_unprepare(clk);
+ clk_disable_unprepare(dev->clk);
return ret;
}
static int orion_wdt_remove(struct platform_device *pdev)
{
- watchdog_unregister_device(&orion_wdt);
- clk_disable_unprepare(clk);
+ struct watchdog_device *wdt_dev = platform_get_drvdata(pdev);
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+
+ watchdog_unregister_device(wdt_dev);
+ clk_disable_unprepare(dev->clk);
return 0;
}
static void orion_wdt_shutdown(struct platform_device *pdev)
{
- orion_wdt_stop(&orion_wdt);
+ struct watchdog_device *wdt_dev = platform_get_drvdata(pdev);
+ orion_wdt_stop(wdt_dev);
}
static const struct of_device_id orion_wdt_of_match_table[] = {
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 11/18] watchdog: orion: Introduce per-compatible of_device_id data
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (9 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 10/18] watchdog: orion: Introduce an orion_watchdog device structure Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-12-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 12/18] watchdog: orion: Add per-compatible clock initialization Ezequiel Garcia
` (8 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
This commit adds an orion_watchdog_data structure to hold compatible-data
information. This allows to remove the driver-wide definition and to
be able to add support for multiple compatible-strings in the future.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 58 +++++++++++++++++++++++++++++++-------------
1 file changed, 41 insertions(+), 17 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 96dba41..c978bcd 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -24,6 +24,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/of.h>
+#include <linux/of_device.h>
/* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */
#define ORION_RSTOUT_MASK_OFFSET 0x20108
@@ -35,29 +36,33 @@
* Watchdog timer block registers.
*/
#define TIMER_CTRL 0x0000
-#define WDT_EN 0x0010
-#define WDT_VAL 0x0024
#define WDT_MAX_CYCLE_COUNT 0xffffffff
-#define WDT_RESET_OUT_EN BIT(1)
-
static bool nowayout = WATCHDOG_NOWAYOUT;
static int heartbeat = -1; /* module parameter (seconds) */
+struct orion_watchdog_data {
+ int wdt_counter_offset;
+ int wdt_enable_bit;
+ int rstout_enable_bit;
+};
+
struct orion_watchdog {
struct watchdog_device wdt;
void __iomem *reg;
void __iomem *rstout;
unsigned long clk_rate;
struct clk *clk;
+ const struct orion_watchdog_data *data;
};
static int orion_wdt_ping(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
/* Reload watchdog duration */
- writel(dev->clk_rate * wdt_dev->timeout, dev->reg + WDT_VAL);
+ writel(dev->clk_rate * wdt_dev->timeout,
+ dev->reg + dev->data->wdt_counter_offset);
return 0;
}
@@ -66,13 +71,16 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
/* Set watchdog duration */
- writel(dev->clk_rate * wdt_dev->timeout, dev->reg + WDT_VAL);
+ writel(dev->clk_rate * wdt_dev->timeout,
+ dev->reg + dev->data->wdt_counter_offset);
/* Enable watchdog timer */
- atomic_io_modify(dev->reg + TIMER_CTRL, WDT_EN, WDT_EN);
+ atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit,
+ dev->data->wdt_enable_bit);
/* Enable reset on watchdog */
- atomic_io_modify(dev->rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
+ atomic_io_modify(dev->rstout, dev->data->rstout_enable_bit,
+ dev->data->rstout_enable_bit);
return 0;
}
@@ -82,10 +90,10 @@ static int orion_wdt_stop(struct watchdog_device *wdt_dev)
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
/* Disable reset on watchdog */
- atomic_io_modify(dev->rstout, WDT_RESET_OUT_EN, 0);
+ atomic_io_modify(dev->rstout, dev->data->rstout_enable_bit, 0);
/* Disable watchdog timer */
- atomic_io_modify(dev->reg + TIMER_CTRL, WDT_EN, 0);
+ atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit, 0);
return 0;
}
@@ -93,7 +101,7 @@ static int orion_wdt_stop(struct watchdog_device *wdt_dev)
static unsigned int orion_wdt_get_timeleft(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
- return readl(dev->reg + WDT_VAL) / dev->clk_rate;
+ return readl(dev->reg + dev->data->wdt_counter_offset) / dev->clk_rate;
}
static int orion_wdt_set_timeout(struct watchdog_device *wdt_dev,
@@ -150,9 +158,25 @@ static void __iomem * try_rstout_ioremap(struct platform_device *pdev,
return devm_ioremap(&pdev->dev, rstout, 0x4);
}
+static const struct orion_watchdog_data orion_data = {
+ .rstout_enable_bit = BIT(1),
+ .wdt_enable_bit = BIT(4),
+ .wdt_counter_offset = 0x24,
+};
+
+static const struct of_device_id orion_wdt_of_match_table[] = {
+ {
+ .compatible = "marvell,orion-wdt",
+ .data = &orion_data,
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table);
+
static int orion_wdt_probe(struct platform_device *pdev)
{
struct orion_watchdog *dev;
+ const struct of_device_id *match;
unsigned int wdt_max_duration; /* (seconds) */
struct resource *res;
int ret, irq;
@@ -162,9 +186,15 @@ static int orion_wdt_probe(struct platform_device *pdev)
if (!dev)
return -ENOMEM;
+ match = of_match_device(orion_wdt_of_match_table, &pdev->dev);
+ if (!match)
+ /* Default legacy match */
+ match = &orion_wdt_of_match_table[0];
+
dev->wdt.info = &orion_wdt_info;
dev->wdt.ops = &orion_wdt_ops;
dev->wdt.min_timeout = 1;
+ dev->data = match->data;
dev->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(dev->clk)) {
@@ -252,12 +282,6 @@ static void orion_wdt_shutdown(struct platform_device *pdev)
orion_wdt_stop(wdt_dev);
}
-static const struct of_device_id orion_wdt_of_match_table[] = {
- { .compatible = "marvell,orion-wdt", },
- {},
-};
-MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table);
-
static struct platform_driver orion_wdt_driver = {
.probe = orion_wdt_probe,
.remove = orion_wdt_remove,
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 12/18] watchdog: orion: Add per-compatible clock initialization
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (10 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 11/18] watchdog: orion: Introduce per-compatible of_device_id data Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-13-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 13/18] watchdog: orion: Add per-compatible watchdog start implementation Ezequiel Garcia
` (7 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Following the introduction of the compatible-data field,
it's now possible to further abstract the clock initialization.
This will allow to support SoC with a different clock setup.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index c978bcd..5ce5d48 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -42,10 +42,14 @@
static bool nowayout = WATCHDOG_NOWAYOUT;
static int heartbeat = -1; /* module parameter (seconds) */
+struct orion_watchdog;
+
struct orion_watchdog_data {
int wdt_counter_offset;
int wdt_enable_bit;
int rstout_enable_bit;
+ int (*clock_init) (struct platform_device *,
+ struct orion_watchdog *);
};
struct orion_watchdog {
@@ -57,6 +61,22 @@ struct orion_watchdog {
const struct orion_watchdog_data *data;
};
+static int orion_wdt_clock_init(struct platform_device *pdev,
+ struct orion_watchdog *dev)
+{
+ int ret;
+
+ dev->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(dev->clk))
+ return PTR_ERR(dev->clk);
+ ret = clk_prepare_enable(dev->clk);
+ if (ret)
+ return ret;
+
+ dev->clk_rate = clk_get_rate(dev->clk);
+ return 0;
+}
+
static int orion_wdt_ping(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -162,6 +182,7 @@ static const struct orion_watchdog_data orion_data = {
.rstout_enable_bit = BIT(1),
.wdt_enable_bit = BIT(4),
.wdt_counter_offset = 0x24,
+ .clock_init = orion_wdt_clock_init,
};
static const struct of_device_id orion_wdt_of_match_table[] = {
@@ -196,15 +217,11 @@ static int orion_wdt_probe(struct platform_device *pdev)
dev->wdt.min_timeout = 1;
dev->data = match->data;
- dev->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(dev->clk)) {
- dev_err(&pdev->dev, "Orion Watchdog missing clock\n");
- return PTR_ERR(dev->clk);
- }
- ret = clk_prepare_enable(dev->clk);
- if (ret)
+ ret = dev->data->clock_init(pdev, dev);
+ if (ret) {
+ dev_err(&pdev->dev, "cannot initialize clock\n");
return ret;
- dev->clk_rate = clk_get_rate(dev->clk);
+ }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 13/18] watchdog: orion: Add per-compatible watchdog start implementation
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (11 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 12/18] watchdog: orion: Add per-compatible clock initialization Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-14-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 14/18] watchdog: orion: Add support for Armada 370 and Armada XP SoC Ezequiel Garcia
` (6 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
To handle differences between SoCs this commit adds per-compatible
string start() function for the watchdog kick-off. This is preparation
work and makes no functionality changes to the current driver.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 5ce5d48..471d6d9 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -50,6 +50,7 @@ struct orion_watchdog_data {
int rstout_enable_bit;
int (*clock_init) (struct platform_device *,
struct orion_watchdog *);
+ int (*start) (struct watchdog_device *);
};
struct orion_watchdog {
@@ -86,7 +87,7 @@ static int orion_wdt_ping(struct watchdog_device *wdt_dev)
return 0;
}
-static int orion_wdt_start(struct watchdog_device *wdt_dev)
+static int orion_start(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -105,6 +106,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
return 0;
}
+static int orion_wdt_start(struct watchdog_device *wdt_dev)
+{
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+
+ /* There are some per-SoC quirks to handle */
+ return dev->data->start(wdt_dev);
+}
+
static int orion_wdt_stop(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -183,6 +192,7 @@ static const struct orion_watchdog_data orion_data = {
.wdt_enable_bit = BIT(4),
.wdt_counter_offset = 0x24,
.clock_init = orion_wdt_clock_init,
+ .start = orion_start,
};
static const struct of_device_id orion_wdt_of_match_table[] = {
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 14/18] watchdog: orion: Add support for Armada 370 and Armada XP SoC
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (12 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 13/18] watchdog: orion: Add per-compatible watchdog start implementation Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
[not found] ` <1390431915-5115-15-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:05 ` [PATCH v4 15/18] ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree Ezequiel Garcia
` (5 subsequent siblings)
19 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Using the added infrastructure for handling SoC differences,
this commit adds support for the watchdog controller available
in Armada 370 and Armada XP SoCs.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/orion_wdt.c | 94 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 471d6d9..90e8b53 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -36,9 +36,17 @@
* Watchdog timer block registers.
*/
#define TIMER_CTRL 0x0000
+#define TIMER_A370_STATUS 0x04
#define WDT_MAX_CYCLE_COUNT 0xffffffff
+#define WDT_A370_RATIO_MASK(v) ((v) << 16)
+#define WDT_A370_RATIO_SHIFT 5
+#define WDT_A370_RATIO (1 << WDT_A370_RATIO_SHIFT)
+
+#define WDT_AXP_FIXED_ENABLE_BIT BIT(10)
+#define WDT_A370_EXPIRED BIT(31)
+
static bool nowayout = WATCHDOG_NOWAYOUT;
static int heartbeat = -1; /* module parameter (seconds) */
@@ -78,6 +86,48 @@ static int orion_wdt_clock_init(struct platform_device *pdev,
return 0;
}
+static int armada370_wdt_clock_init(struct platform_device *pdev,
+ struct orion_watchdog *dev)
+{
+ int ret;
+
+ dev->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(dev->clk))
+ return PTR_ERR(dev->clk);
+ ret = clk_prepare_enable(dev->clk);
+ if (ret)
+ return ret;
+
+ /* Setup watchdog input clock */
+ atomic_io_modify(dev->reg + TIMER_CTRL,
+ WDT_A370_RATIO_MASK(WDT_A370_RATIO_SHIFT),
+ WDT_A370_RATIO_MASK(WDT_A370_RATIO_SHIFT));
+
+ dev->clk_rate = clk_get_rate(dev->clk) / WDT_A370_RATIO;
+ return 0;
+}
+
+static int armadaxp_wdt_clock_init(struct platform_device *pdev,
+ struct orion_watchdog *dev)
+{
+ int ret;
+
+ dev->clk = of_clk_get_by_name(pdev->dev.of_node, "fixed");
+ if (IS_ERR(dev->clk))
+ return PTR_ERR(dev->clk);
+ ret = clk_prepare_enable(dev->clk);
+ if (ret)
+ return ret;
+
+ /* Enable the fixed watchdog clock input */
+ atomic_io_modify(dev->reg + TIMER_CTRL,
+ WDT_AXP_FIXED_ENABLE_BIT,
+ WDT_AXP_FIXED_ENABLE_BIT);
+
+ dev->clk_rate = clk_get_rate(dev->clk);
+ return 0;
+}
+
static int orion_wdt_ping(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -87,6 +137,26 @@ static int orion_wdt_ping(struct watchdog_device *wdt_dev)
return 0;
}
+static int armada370_start(struct watchdog_device *wdt_dev)
+{
+ struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+
+ /* Set watchdog duration */
+ writel(dev->clk_rate * wdt_dev->timeout,
+ dev->reg + dev->data->wdt_counter_offset);
+
+ /* Clear the watchdog expiration bit */
+ atomic_io_modify(dev->reg + TIMER_A370_STATUS, WDT_A370_EXPIRED, 0);
+
+ /* Enable watchdog timer */
+ atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit,
+ dev->data->wdt_enable_bit);
+
+ atomic_io_modify(dev->rstout, dev->data->rstout_enable_bit,
+ dev->data->rstout_enable_bit);
+ return 0;
+}
+
static int orion_start(struct watchdog_device *wdt_dev)
{
struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -195,11 +265,35 @@ static const struct orion_watchdog_data orion_data = {
.start = orion_start,
};
+static const struct orion_watchdog_data armada370_data = {
+ .rstout_enable_bit = BIT(8),
+ .wdt_enable_bit = BIT(8),
+ .wdt_counter_offset = 0x34,
+ .clock_init = armada370_wdt_clock_init,
+ .start = armada370_start,
+};
+
+static const struct orion_watchdog_data armadaxp_data = {
+ .rstout_enable_bit = BIT(8),
+ .wdt_enable_bit = BIT(8),
+ .wdt_counter_offset = 0x34,
+ .clock_init = armadaxp_wdt_clock_init,
+ .start = armada370_start,
+};
+
static const struct of_device_id orion_wdt_of_match_table[] = {
{
.compatible = "marvell,orion-wdt",
.data = &orion_data,
},
+ {
+ .compatible = "marvell,armada-370-wdt",
+ .data = &armada370_data,
+ },
+ {
+ .compatible = "marvell,armada-xp-wdt",
+ .data = &armadaxp_data,
+ },
{},
};
MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table);
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 15/18] ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (13 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 14/18] watchdog: orion: Add support for Armada 370 and Armada XP SoC Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 16/18] ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree Ezequiel Garcia
` (4 subsequent siblings)
19 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Add the DT nodes to enable watchdog support available in Armada 370
and Armada XP SoCs.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm/boot/dts/armada-370-xp.dtsi | 4 ++++
arch/arm/boot/dts/armada-370.dtsi | 5 +++++
arch/arm/boot/dts/armada-xp.dtsi | 6 ++++++
3 files changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 7f10f62..96e0389 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -151,6 +151,10 @@
interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
};
+ watchdog@20300 {
+ reg = <0x20300 0x34>, <0x20704 0x4>;
+ };
+
sata@a0000 {
compatible = "marvell,orion-sata";
reg = <0xa0000 0x5000>;
diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi
index 7a4b82e..aebed9e 100644
--- a/arch/arm/boot/dts/armada-370.dtsi
+++ b/arch/arm/boot/dts/armada-370.dtsi
@@ -168,6 +168,11 @@
clocks = <&coreclk 2>;
};
+ watchdog@20300 {
+ compatible = "marvell,armada-370-wdt";
+ clocks = <&coreclk 2>;
+ };
+
coreclk: mvebu-sar@18230 {
compatible = "marvell,armada-370-core-clock";
reg = <0x18230 0x08>;
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index 281c644..8c6c06c 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -74,6 +74,12 @@
clock-names = "nbclk", "fixed";
};
+ watchdog@20300 {
+ compatible = "marvell,armada-xp-wdt";
+ clocks = <&coreclk 2>, <&refclk>;
+ clock-names = "nbclk", "fixed";
+ };
+
coreclk: mvebu-sar@18230 {
compatible = "marvell,armada-xp-core-clock";
reg = <0x18230 0x08>;
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 16/18] ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (14 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 15/18] ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 17/18] watchdog: orion: Enable the build on ARCH_MVEBU Ezequiel Garcia
` (3 subsequent siblings)
19 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
In order to support multiplatform builds the watchdog devicetree binding
was modified and now the 'reg' property is specified to need two
entries. This commit adds the second entry as-per the new specification.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm/boot/dts/kirkwood.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 8b73c80..80a56b0 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -165,7 +165,7 @@
wdt: watchdog-timer@20300 {
compatible = "marvell,orion-wdt";
- reg = <0x20300 0x28>;
+ reg = <0x20300 0x28>, <0x20108 0x4>;
interrupt-parent = <&bridge_intc>;
interrupts = <3>;
clocks = <&gate_clk 7>;
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 17/18] watchdog: orion: Enable the build on ARCH_MVEBU
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (15 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 16/18] ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 18/18] ARM: mvebu: Enable watchdog support in defconfig Ezequiel Garcia
` (2 subsequent siblings)
19 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
After adding support for Armada 370/XP SoC let's enable the build on
these platforms.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/watchdog/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 5be6e91..8b79012 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -282,7 +282,7 @@ config DAVINCI_WATCHDOG
config ORION_WATCHDOG
tristate "Orion watchdog"
- depends on ARCH_ORION5X || ARCH_KIRKWOOD || ARCH_DOVE
+ depends on ARCH_ORION5X || ARCH_KIRKWOOD || ARCH_DOVE || ARCH_MVEBU
select WATCHDOG_CORE
help
Say Y here if to include support for the watchdog timer
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH v4 18/18] ARM: mvebu: Enable watchdog support in defconfig
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (16 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 17/18] watchdog: orion: Enable the build on ARCH_MVEBU Ezequiel Garcia
@ 2014-01-22 23:05 ` Ezequiel Garcia
2014-01-23 22:40 ` [PATCH v4 00/18] Armada 370/XP watchdog support Sebastian Hesselbarth
2014-01-25 16:57 ` Ezequiel Garcia
19 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-22 23:05 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper, Ezequiel Garcia
Now that we have proper support for Armada 370/XP watchdog
let's enable it in the defconfig.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm/configs/mvebu_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index 594d706..84ec924 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -60,6 +60,8 @@ CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_THERMAL=y
CONFIG_ARMADA_THERMAL=y
+CONFIG_WATCHDOG=y
+CONFIG_ORION_WATCHDOG=y
CONFIG_USB_SUPPORT=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [PATCH v4 00/18] Armada 370/XP watchdog support
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (17 preceding siblings ...)
2014-01-22 23:05 ` [PATCH v4 18/18] ARM: mvebu: Enable watchdog support in defconfig Ezequiel Garcia
@ 2014-01-23 22:40 ` Sebastian Hesselbarth
[not found] ` <52E19A44.7040308-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-25 16:57 ` Ezequiel Garcia
19 siblings, 1 reply; 42+ messages in thread
From: Sebastian Hesselbarth @ 2014-01-23 22:40 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Arnd Bergmann, Daniel Lezcano,
Fabio Estevam, Andrew Lunn, Thomas Petazzoni, Gregory Clement,
Tawfik Bayouk, Lior Amsalem, Guenter Roeck, Jason Cooper
On 01/23/2014 12:04 AM, Ezequiel Garcia wrote:
> After some lengthy discussion on the [v2] and [v3] patchsets, here's a new
> round. I hope I haven't forgotten anything.
>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
on Dove.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 00/18] Armada 370/XP watchdog support
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
` (18 preceding siblings ...)
2014-01-23 22:40 ` [PATCH v4 00/18] Armada 370/XP watchdog support Sebastian Hesselbarth
@ 2014-01-25 16:57 ` Ezequiel Garcia
19 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-25 16:57 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Guenter Roeck, Jason Cooper
On Wed, Jan 22, 2014 at 08:04:57PM -0300, Ezequiel Garcia wrote:
[..]
>
> Thanks to everyone who has helped reviewing the previous sets! It's certainly
> easier to move forward when you get so much nice feedback...
>
> Ezequiel Garcia (18):
> ARM: Introduce atomic MMIO modify
> clocksource: orion: Use atomic access for shared registers
> watchdog: orion: Add clock error handling
> watchdog: orion: Use atomic access for shared registers
> watchdog: orion: Remove unused macros
> watchdog: orion: Make sure the watchdog is initially stopped
> watchdog: orion: Handle IRQ
> watchdog: orion: Make RSTOUT register a separate resource
> watchdog: orion: Remove unneeded BRIDGE_CAUSE clear
> watchdog: orion: Introduce an orion_watchdog device structure
> watchdog: orion: Introduce per-compatible of_device_id data
> watchdog: orion: Add per-compatible clock initialization
> watchdog: orion: Add per-compatible watchdog start implementation
> watchdog: orion: Add support for Armada 370 and Armada XP SoC
> ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree
> ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree
> watchdog: orion: Enable the build on ARCH_MVEBU
> ARM: mvebu: Enable watchdog support in defconfig
>
[..]
If at all possible I'd like to get some acks or reviews from the people
that has followed, reviewed and discussed this series with me.
Jason, Arnd, Andrew?
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 00/18] Armada 370/XP watchdog support
[not found] ` <52E19A44.7040308-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-01-25 17:09 ` Ezequiel Garcia
2014-01-27 14:49 ` Ezequiel Garcia
1 sibling, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-25 17:09 UTC (permalink / raw)
To: Sebastian Hesselbarth
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Arnd Bergmann, Daniel Lezcano, Fabio Estevam,
Andrew Lunn, Thomas Petazzoni, Gregory Clement, Tawfik Bayouk,
Lior Amsalem, Guenter Roeck, Jason Cooper
On Thu, Jan 23, 2014 at 11:40:04PM +0100, Sebastian Hesselbarth wrote:
> On 01/23/2014 12:04 AM, Ezequiel Garcia wrote:
> > After some lengthy discussion on the [v2] and [v3] patchsets, here's a new
> > round. I hope I haven't forgotten anything.
> >
>
> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> on Dove.
Great, thanks a lot!
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 03/18] watchdog: orion: Add clock error handling
[not found] ` <1390431915-5115-4-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:12 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:12 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> This commit adds a check for clk_prepare_enable success and introduces
> an error path to disable the clock properly.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 04/18] watchdog: orion: Use atomic access for shared registers
[not found] ` <1390431915-5115-5-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:12 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:12 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> Since the timer control register is shared with the clocksource driver,
> use the recently introduced atomic_io_clear_set() to access such register.
> Given the watchdog core already provides serialization for all the
> watchdog ops, this commit allows to remove the spinlock entirely.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 05/18] watchdog: orion: Remove unused macros
[not found] ` <1390431915-5115-6-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:13 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:13 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> These are not used anywhere so it's safe to remove them.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 06/18] watchdog: orion: Make sure the watchdog is initially stopped
[not found] ` <1390431915-5115-7-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:13 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:13 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> Having the watchdog initially fully stopped is important to avoid
> any spurious watchdog triggers, in case the registers are not in
> its reset state.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 07/18] watchdog: orion: Handle IRQ
[not found] ` <1390431915-5115-8-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:15 ` Guenter Roeck
2014-01-26 8:04 ` Thomas Petazzoni
1 sibling, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:15 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> DT-enabled where an irqchip driver for the brigde interrupt controller is
> available can handle the watchdog IRQ properly. Therefore, we request
> the interruption and add a dummy handler that merely calls panic().
>
> This is done in order to have an initial 'ack' of the interruption,
> which clears the watchdog state.
>
> Furthermore, since some platforms don't have such IRQ, this commit
> makes the interruption specification optional.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
> .../devicetree/bindings/watchdog/marvel.txt | 2 ++
> drivers/watchdog/orion_wdt.c | 24 +++++++++++++++++++++-
> 2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
> index 5dc8d30..0731fbd 100644
> --- a/Documentation/devicetree/bindings/watchdog/marvel.txt
> +++ b/Documentation/devicetree/bindings/watchdog/marvel.txt
> @@ -7,6 +7,7 @@ Required Properties:
>
> Optional properties:
>
> +- interrupts : Contains the IRQ for watchdog expiration
> - timeout-sec : Contains the watchdog timeout in seconds
>
> Example:
> @@ -14,6 +15,7 @@ Example:
> wdt@20300 {
> compatible = "marvell,orion-wdt";
> reg = <0x20300 0x28>;
> + interrupts = <3>;
> timeout-sec = <10>;
> status = "okay";
> };
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 2dbeee9..f5e7b17 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -19,6 +19,7 @@
> #include <linux/platform_device.h>
> #include <linux/watchdog.h>
> #include <linux/init.h>
> +#include <linux/interrupt.h>
> #include <linux/io.h>
> #include <linux/clk.h>
> #include <linux/err.h>
> @@ -109,10 +110,16 @@ static struct watchdog_device orion_wdt = {
> .min_timeout = 1,
> };
>
> +static irqreturn_t orion_wdt_irq(int irq, void *devid)
> +{
> + panic("Watchdog Timeout");
> + return IRQ_HANDLED;
> +}
> +
> static int orion_wdt_probe(struct platform_device *pdev)
> {
> struct resource *res;
> - int ret;
> + int ret, irq;
>
> clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(clk)) {
> @@ -145,6 +152,21 @@ static int orion_wdt_probe(struct platform_device *pdev)
> /* Let's make sure the watchdog is fully stopped */
> orion_wdt_stop(&orion_wdt);
>
> + /* It's important to request the IRQ once the watchdog is disabled */
s/once/only after/
> + irq = platform_get_irq(pdev, 0);
> + if (irq >= 0) {
> + /*
> + * Not all supported platforms specify an interruption for the
s/interruption/interrupt pin/ (or interrupt)
Nitpicks, so
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource
[not found] ` <1390431915-5115-9-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:19 ` Guenter Roeck
[not found] ` <52E4003E.4070106-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-01-26 8:17 ` Thomas Petazzoni
1 sibling, 1 reply; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:19 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> In order to support other SoC, it's required to distinguish
> the 'control' timer register, from the 'rstout' register
> that enables system reset on watchdog expiration.
>
> To prevent a compatibility break, this commit adds a fallback
> to a hardcoded RSTOUT address.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
> .../devicetree/bindings/watchdog/marvel.txt | 6 ++-
> arch/arm/mach-dove/include/mach/bridge-regs.h | 1 +
> arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 1 +
> arch/arm/mach-mv78xx0/include/mach/bridge-regs.h | 1 +
> arch/arm/mach-orion5x/include/mach/bridge-regs.h | 1 +
> arch/arm/plat-orion/common.c | 10 +++--
> drivers/watchdog/orion_wdt.c | 44 +++++++++++++++++++++-
> 7 files changed, 56 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
> index 0731fbd..1544fe9 100644
> --- a/Documentation/devicetree/bindings/watchdog/marvel.txt
> +++ b/Documentation/devicetree/bindings/watchdog/marvel.txt
> @@ -3,7 +3,9 @@
> Required Properties:
>
> - Compatibility : "marvell,orion-wdt"
> -- reg : Address of the timer registers
> +- reg : Should contain two entries: first one with the
> + timer control address, second one with the
> + rstout enable address.
>
> Optional properties:
>
> @@ -14,7 +16,7 @@ Example:
>
> wdt@20300 {
> compatible = "marvell,orion-wdt";
> - reg = <0x20300 0x28>;
> + reg = <0x20300 0x28>, <0x20108 0x4>;
> interrupts = <3>;
> timeout-sec = <10>;
> status = "okay";
> diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
> index 5362df3..f4a5b34 100644
> --- a/arch/arm/mach-dove/include/mach/bridge-regs.h
> +++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
> @@ -21,6 +21,7 @@
> #define CPU_CTRL_PCIE1_LINK 0x00000008
>
> #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
> +#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
> #define SOFT_RESET_OUT_EN 0x00000004
>
> #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
> diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> index 8b9d1c9..60f6421 100644
> --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> @@ -21,6 +21,7 @@
> #define CPU_RESET 0x00000002
>
> #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
> +#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
> #define SOFT_RESET_OUT_EN 0x00000004
>
> #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
> diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
> index 5f03484..e20d6da 100644
> --- a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
> +++ b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
> @@ -15,6 +15,7 @@
> #define L2_WRITETHROUGH 0x00020000
>
> #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
> +#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
> #define SOFT_RESET_OUT_EN 0x00000004
>
> #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
> diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
> index f727d03..5766e3f 100644
> --- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
> +++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
> @@ -18,6 +18,7 @@
> #define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104)
>
> #define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108)
> +#define RSTOUTn_MASK_PHYS (ORION5X_BRIDGE_PHYS_BASE + 0x108)
>
> #define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c)
>
> diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> index c66d163..3375037 100644
> --- a/arch/arm/plat-orion/common.c
> +++ b/arch/arm/plat-orion/common.c
> @@ -594,14 +594,16 @@ void __init orion_spi_1_init(unsigned long mapbase)
> /*****************************************************************************
> * Watchdog
> ****************************************************************************/
> -static struct resource orion_wdt_resource =
> - DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
> +static struct resource orion_wdt_resource[] = {
> + DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
> + DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
> +};
>
> static struct platform_device orion_wdt_device = {
> .name = "orion_wdt",
> .id = -1,
> - .num_resources = 1,
> - .resource = &orion_wdt_resource,
> + .num_resources = ARRAY_SIZE(orion_wdt_resource),
> + .resource = orion_wdt_resource,
> };
>
> void __init orion_wdt_init(void)
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index f5e7b17..ba8eea9d 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -26,6 +26,12 @@
> #include <linux/of.h>
> #include <mach/bridge-regs.h>
>
> +/* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */
> +#define ORION_RSTOUT_MASK_OFFSET 0x20108
> +
> +/* Internal registers can be configured at any 1 MiB aligned address */
> +#define INTERNAL_REGS_MASK ~(SZ_1M - 1)
> +
> /*
> * Watchdog timer block registers.
> */
> @@ -44,6 +50,7 @@ static unsigned int wdt_max_duration; /* (seconds) */
> static struct clk *clk;
> static unsigned int wdt_tclk;
> static void __iomem *wdt_reg;
> +static void __iomem *wdt_rstout;
>
> static int orion_wdt_ping(struct watchdog_device *wdt_dev)
> {
> @@ -64,14 +71,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
> atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN);
>
> /* Enable reset on watchdog */
> - atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
> + atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
> return 0;
> }
>
> static int orion_wdt_stop(struct watchdog_device *wdt_dev)
> {
> /* Disable reset on watchdog */
> - atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, 0);
> + atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, 0);
>
> /* Disable watchdog timer */
> atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0);
> @@ -116,6 +123,33 @@ static irqreturn_t orion_wdt_irq(int irq, void *devid)
> return IRQ_HANDLED;
> }
>
> +/*
> + * The original devicetree binding for this driver specified only
> + * one memory resource, so in order to keep DT backwards compatibility
> + * we try to fallback to a hardcoded register address, if the resource
> + * is missing from the devicetree.
> + */
> +static void __iomem *try_rstout_ioremap(struct platform_device *pdev,
> + phys_addr_t internal_regs)
> +{
> + struct resource *res;
> + phys_addr_t rstout;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (res)
> + return devm_ioremap(&pdev->dev, res->start,
> + resource_size(res));
> +
> + /* This workaround works only for "orion-wdt", DT-enabled */
> + if (!of_device_is_compatible(pdev->dev.of_node, "marvell,orion-wdt"))
> + return NULL;
> +
> + rstout = internal_regs + ORION_RSTOUT_MASK_OFFSET;
> +
> + WARN(1, FW_BUG "falling back to harcoded RSTOUT reg 0x%x\n", rstout);
WARN seems to be a bit excessive here. Is that on purpose (sorry if that was discussed and I missed it) ?
Assuming it is on purpose
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 09/18] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear
[not found] ` <1390431915-5115-10-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:20 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:20 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> After adding the IRQ request, the BRIDGE_CAUSE bit should be cleared by the
> bridge interrupt controller. There's no longer a need to do it in the watchdog
> driver, so we can simply remove it.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 10/18] watchdog: orion: Introduce an orion_watchdog device structure
[not found] ` <1390431915-5115-11-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:21 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:21 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> In order to prepare to support multiple compatible-strings, this
> commit adds a device structure to hold the driver's state.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 11/18] watchdog: orion: Introduce per-compatible of_device_id data
[not found] ` <1390431915-5115-12-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:23 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:23 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> This commit adds an orion_watchdog_data structure to hold compatible-data
> information. This allows to remove the driver-wide definition and to
> be able to add support for multiple compatible-strings in the future.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 12/18] watchdog: orion: Add per-compatible clock initialization
[not found] ` <1390431915-5115-13-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:24 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:24 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> Following the introduction of the compatible-data field,
> it's now possible to further abstract the clock initialization.
> This will allow to support SoC with a different clock setup.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 13/18] watchdog: orion: Add per-compatible watchdog start implementation
[not found] ` <1390431915-5115-14-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:24 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:24 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> To handle differences between SoCs this commit adds per-compatible
> string start() function for the watchdog kick-off. This is preparation
> work and makes no functionality changes to the current driver.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 14/18] watchdog: orion: Add support for Armada 370 and Armada XP SoC
[not found] ` <1390431915-5115-15-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 18:25 ` Guenter Roeck
0 siblings, 0 replies; 42+ messages in thread
From: Guenter Roeck @ 2014-01-25 18:25 UTC (permalink / raw)
To: Ezequiel Garcia,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA
Cc: Wim Van Sebroeck, Jason Gunthorpe, Sebastian Hesselbarth,
Arnd Bergmann, Daniel Lezcano, Fabio Estevam, Andrew Lunn,
Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
Jason Cooper
On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> Using the added infrastructure for handling SoC differences,
> this commit adds support for the watchdog controller available
> in Armada 370 and Armada XP SoCs.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 01/18] ARM: Introduce atomic MMIO modify
[not found] ` <1390431915-5115-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2014-01-25 20:32 ` Jason Cooper
0 siblings, 0 replies; 42+ messages in thread
From: Jason Cooper @ 2014-01-25 20:32 UTC (permalink / raw)
To: Ezequiel Garcia, Russell King - ARM Linux
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Thomas Petazzoni,
Gregory Clement, Tawfik Bayouk, Lior Amsalem, Guenter Roeck
Russell,
On Wed, Jan 22, 2014 at 08:04:58PM -0300, Ezequiel Garcia wrote:
> Some SoC have MMIO regions that are shared across orthogonal
> subsystems. This commit implements a possible solution for the
> thread-safe access of such regions through a spinlock-protected API.
>
> Concurrent access is protected with a single spinlock for the
> entire MMIO address space. While this protects shared-registers,
> it also serializes access to unrelated/unshared registers.
>
> We add relaxed and non-relaxed variants, by using writel_relaxed and writel,
> respectively. The rationale for this is that some users may not require
> register write completion but only thread-safe access to a register.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
> arch/arm/include/asm/io.h | 6 ++++++
> arch/arm/kernel/io.c | 35 +++++++++++++++++++++++++++++++++++
> 2 files changed, 41 insertions(+)
This has been in your patch tracker for a while:
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7930/1
When you requested Acks, we sent them:
http://www.spinics.net/lists/arm-kernel/msg300250.html
Is there anything more you need from us? The rest of this series
depends on this patch. Could you place it in a topic branch so we can
base the rest of the series off of it? Or, if you prefer, Ack it and
drop it from your patch tracker? I'm fine either way.
thx,
Jason.
>
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index fbeb39c..8aa4cca 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -38,6 +38,12 @@
> #define isa_bus_to_virt phys_to_virt
>
> /*
> + * Atomic MMIO-wide IO modify
> + */
> +extern void atomic_io_modify(void __iomem *reg, u32 mask, u32 set);
> +extern void atomic_io_modify_relaxed(void __iomem *reg, u32 mask, u32 set);
> +
> +/*
> * Generic IO read/write. These perform native-endian accesses. Note
> * that some architectures will want to re-define __raw_{read,write}w.
> */
> diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
> index dcd5b4d..9203cf8 100644
> --- a/arch/arm/kernel/io.c
> +++ b/arch/arm/kernel/io.c
> @@ -1,6 +1,41 @@
> #include <linux/export.h>
> #include <linux/types.h>
> #include <linux/io.h>
> +#include <linux/spinlock.h>
> +
> +static DEFINE_RAW_SPINLOCK(__io_lock);
> +
> +/*
> + * Generic atomic MMIO modify.
> + *
> + * Allows thread-safe access to registers shared by unrelated subsystems.
> + * The access is protected by a single MMIO-wide lock.
> + */
> +void atomic_io_modify_relaxed(void __iomem *reg, u32 mask, u32 set)
> +{
> + unsigned long flags;
> + u32 value;
> +
> + raw_spin_lock_irqsave(&__io_lock, flags);
> + value = readl_relaxed(reg) & ~mask;
> + value |= (set & mask);
> + writel_relaxed(value, reg);
> + raw_spin_unlock_irqrestore(&__io_lock, flags);
> +}
> +EXPORT_SYMBOL(atomic_io_modify_relaxed);
> +
> +void atomic_io_modify(void __iomem *reg, u32 mask, u32 set)
> +{
> + unsigned long flags;
> + u32 value;
> +
> + raw_spin_lock_irqsave(&__io_lock, flags);
> + value = readl_relaxed(reg) & ~mask;
> + value |= (set & mask);
> + writel(value, reg);
> + raw_spin_unlock_irqrestore(&__io_lock, flags);
> +}
> +EXPORT_SYMBOL(atomic_io_modify);
>
> /*
> * Copy data from IO memory space to "real" memory space.
> --
> 1.8.1.5
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 07/18] watchdog: orion: Handle IRQ
[not found] ` <1390431915-5115-8-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:15 ` Guenter Roeck
@ 2014-01-26 8:04 ` Thomas Petazzoni
2014-01-26 13:14 ` Ezequiel Garcia
1 sibling, 1 reply; 42+ messages in thread
From: Thomas Petazzoni @ 2014-01-26 8:04 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Gregory Clement,
Tawfik Bayouk, Lior Amsalem, Guenter Roeck, Jason Cooper
Dear Ezequiel Garcia,
On Wed, 22 Jan 2014 20:05:04 -0300, Ezequiel Garcia wrote:
> DT-enabled where an irqchip driver for the brigde interrupt controller is
> available can handle the watchdog IRQ properly. Therefore, we request
> the interruption and add a dummy handler that merely calls panic().
I don't quiite understand the first sentence of this commit log, and
the commit title looks wrong. Maybe a bad copy/paste or something?
>
> This is done in order to have an initial 'ack' of the interruption,
interruption -> interrupt
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource
[not found] ` <1390431915-5115-9-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:19 ` Guenter Roeck
@ 2014-01-26 8:17 ` Thomas Petazzoni
2014-01-26 13:18 ` Ezequiel Garcia
1 sibling, 1 reply; 42+ messages in thread
From: Thomas Petazzoni @ 2014-01-26 8:17 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Gregory Clement,
Tawfik Bayouk, Lior Amsalem, Guenter Roeck, Jason Cooper
Dear Ezequiel Garcia,
On Wed, 22 Jan 2014 20:05:05 -0300, Ezequiel Garcia wrote:
> +/* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */
> +#define ORION_RSTOUT_MASK_OFFSET 0x20108
> +
> +/* Internal registers can be configured at any 1 MiB aligned address */
> +#define INTERNAL_REGS_MASK ~(SZ_1M - 1)
I'm not a big fan of hardcoding the internal register window size in a
driver. I would have preferred to have used the offset between the
watchdog registers and the rstout register, but since this one is
*before* the watchdog registers, it would have to be a negative offset.
Not sure how to handle this.
> +/*
> + * The original devicetree binding for this driver specified only
> + * one memory resource, so in order to keep DT backwards compatibility
> + * we try to fallback to a hardcoded register address, if the resource
> + * is missing from the devicetree.
> + */
> +static void __iomem *try_rstout_ioremap(struct platform_device *pdev,
> + phys_addr_t internal_regs)
Why is it called "try" ? It actually does the mapping. So I would
prefer the function to be named:
orion_wdt_ioremap_rstout()
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 07/18] watchdog: orion: Handle IRQ
2014-01-26 8:04 ` Thomas Petazzoni
@ 2014-01-26 13:14 ` Ezequiel Garcia
2014-01-26 14:57 ` Thomas Petazzoni
0 siblings, 1 reply; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-26 13:14 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Gregory Clement,
Tawfik Bayouk, Lior Amsalem, Guenter Roeck, Jason Cooper
On Sun, Jan 26, 2014 at 09:04:12AM +0100, Thomas Petazzoni wrote:
> Dear Ezequiel Garcia,
>
> On Wed, 22 Jan 2014 20:05:04 -0300, Ezequiel Garcia wrote:
> > DT-enabled where an irqchip driver for the brigde interrupt controller is
> > available can handle the watchdog IRQ properly. Therefore, we request
> > the interruption and add a dummy handler that merely calls panic().
>
> I don't quiite understand the first sentence of this commit log, and
> the commit title looks wrong. Maybe a bad copy/paste or something?
>
Hm... yes it doesn't look right. It should read:
"DT-enabled platforms, where the irqchip driver for the brigde interrupt
controller is available, can handle the watchdog IRQ properly. Therefore,
we request the interrupt and add a dummy handler that merely calls panic()".
I guess we can re-phrase it be a bit more readable.
Why does th commit title looks wrong? By requesting the IRQ we are
"handling it", no?
> >
> > This is done in order to have an initial 'ack' of the interruption,
>
> interruption -> interrupt
>
Right.
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource
2014-01-26 8:17 ` Thomas Petazzoni
@ 2014-01-26 13:18 ` Ezequiel Garcia
0 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-26 13:18 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Gregory Clement,
Tawfik Bayouk, Lior Amsalem, Guenter Roeck, Jason Cooper
On Sun, Jan 26, 2014 at 09:17:53AM +0100, Thomas Petazzoni wrote:
[..]
> > +/*
> > + * The original devicetree binding for this driver specified only
> > + * one memory resource, so in order to keep DT backwards compatibility
> > + * we try to fallback to a hardcoded register address, if the resource
> > + * is missing from the devicetree.
> > + */
> > +static void __iomem *try_rstout_ioremap(struct platform_device *pdev,
> > + phys_addr_t internal_regs)
>
> Why is it called "try" ? It actually does the mapping. So I would
> prefer the function to be named:
>
> orion_wdt_ioremap_rstout()
>
Ah, yes. This is a left over from the previous attempt.
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource
[not found] ` <52E4003E.4070106-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2014-01-26 13:20 ` Ezequiel Garcia
0 siblings, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-26 13:20 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Thomas Petazzoni,
Gregory Clement, Tawfik Bayouk, Lior Amsalem, Jason Cooper
On Sat, Jan 25, 2014 at 10:19:42AM -0800, Guenter Roeck wrote:
> On 01/22/2014 03:05 PM, Ezequiel Garcia wrote:
> > In order to support other SoC, it's required to distinguish
> > the 'control' timer register, from the 'rstout' register
> > that enables system reset on watchdog expiration.
> >
> > To prevent a compatibility break, this commit adds a fallback
> > to a hardcoded RSTOUT address.
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> > ---
> > .../devicetree/bindings/watchdog/marvel.txt | 6 ++-
> > arch/arm/mach-dove/include/mach/bridge-regs.h | 1 +
> > arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 1 +
> > arch/arm/mach-mv78xx0/include/mach/bridge-regs.h | 1 +
> > arch/arm/mach-orion5x/include/mach/bridge-regs.h | 1 +
> > arch/arm/plat-orion/common.c | 10 +++--
> > drivers/watchdog/orion_wdt.c | 44 +++++++++++++++++++++-
> > 7 files changed, 56 insertions(+), 8 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/watchdog/marvel.txt b/Documentation/devicetree/bindings/watchdog/marvel.txt
> > index 0731fbd..1544fe9 100644
> > --- a/Documentation/devicetree/bindings/watchdog/marvel.txt
> > +++ b/Documentation/devicetree/bindings/watchdog/marvel.txt
> > @@ -3,7 +3,9 @@
> > Required Properties:
> >
> > - Compatibility : "marvell,orion-wdt"
> > -- reg : Address of the timer registers
> > +- reg : Should contain two entries: first one with the
> > + timer control address, second one with the
> > + rstout enable address.
> >
> > Optional properties:
> >
> > @@ -14,7 +16,7 @@ Example:
> >
> > wdt@20300 {
> > compatible = "marvell,orion-wdt";
> > - reg = <0x20300 0x28>;
> > + reg = <0x20300 0x28>, <0x20108 0x4>;
> > interrupts = <3>;
> > timeout-sec = <10>;
> > status = "okay";
> > diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
> > index 5362df3..f4a5b34 100644
> > --- a/arch/arm/mach-dove/include/mach/bridge-regs.h
> > +++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
> > @@ -21,6 +21,7 @@
> > #define CPU_CTRL_PCIE1_LINK 0x00000008
> >
> > #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
> > +#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
> > #define SOFT_RESET_OUT_EN 0x00000004
> >
> > #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
> > diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> > index 8b9d1c9..60f6421 100644
> > --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> > +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> > @@ -21,6 +21,7 @@
> > #define CPU_RESET 0x00000002
> >
> > #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
> > +#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
> > #define SOFT_RESET_OUT_EN 0x00000004
> >
> > #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
> > diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
> > index 5f03484..e20d6da 100644
> > --- a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
> > +++ b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
> > @@ -15,6 +15,7 @@
> > #define L2_WRITETHROUGH 0x00020000
> >
> > #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
> > +#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
> > #define SOFT_RESET_OUT_EN 0x00000004
> >
> > #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
> > diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
> > index f727d03..5766e3f 100644
> > --- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
> > +++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
> > @@ -18,6 +18,7 @@
> > #define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104)
> >
> > #define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108)
> > +#define RSTOUTn_MASK_PHYS (ORION5X_BRIDGE_PHYS_BASE + 0x108)
> >
> > #define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c)
> >
> > diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
> > index c66d163..3375037 100644
> > --- a/arch/arm/plat-orion/common.c
> > +++ b/arch/arm/plat-orion/common.c
> > @@ -594,14 +594,16 @@ void __init orion_spi_1_init(unsigned long mapbase)
> > /*****************************************************************************
> > * Watchdog
> > ****************************************************************************/
> > -static struct resource orion_wdt_resource =
> > - DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28);
> > +static struct resource orion_wdt_resource[] = {
> > + DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
> > + DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
> > +};
> >
> > static struct platform_device orion_wdt_device = {
> > .name = "orion_wdt",
> > .id = -1,
> > - .num_resources = 1,
> > - .resource = &orion_wdt_resource,
> > + .num_resources = ARRAY_SIZE(orion_wdt_resource),
> > + .resource = orion_wdt_resource,
> > };
> >
> > void __init orion_wdt_init(void)
> > diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> > index f5e7b17..ba8eea9d 100644
> > --- a/drivers/watchdog/orion_wdt.c
> > +++ b/drivers/watchdog/orion_wdt.c
> > @@ -26,6 +26,12 @@
> > #include <linux/of.h>
> > #include <mach/bridge-regs.h>
> >
> > +/* RSTOUT mask register physical address for Orion5x, Kirkwood and Dove */
> > +#define ORION_RSTOUT_MASK_OFFSET 0x20108
> > +
> > +/* Internal registers can be configured at any 1 MiB aligned address */
> > +#define INTERNAL_REGS_MASK ~(SZ_1M - 1)
> > +
> > /*
> > * Watchdog timer block registers.
> > */
> > @@ -44,6 +50,7 @@ static unsigned int wdt_max_duration; /* (seconds) */
> > static struct clk *clk;
> > static unsigned int wdt_tclk;
> > static void __iomem *wdt_reg;
> > +static void __iomem *wdt_rstout;
> >
> > static int orion_wdt_ping(struct watchdog_device *wdt_dev)
> > {
> > @@ -64,14 +71,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
> > atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, WDT_EN);
> >
> > /* Enable reset on watchdog */
> > - atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
> > + atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
> > return 0;
> > }
> >
> > static int orion_wdt_stop(struct watchdog_device *wdt_dev)
> > {
> > /* Disable reset on watchdog */
> > - atomic_io_modify(RSTOUTn_MASK, WDT_RESET_OUT_EN, 0);
> > + atomic_io_modify(wdt_rstout, WDT_RESET_OUT_EN, 0);
> >
> > /* Disable watchdog timer */
> > atomic_io_modify(wdt_reg + TIMER_CTRL, WDT_EN, 0);
> > @@ -116,6 +123,33 @@ static irqreturn_t orion_wdt_irq(int irq, void *devid)
> > return IRQ_HANDLED;
> > }
> >
> > +/*
> > + * The original devicetree binding for this driver specified only
> > + * one memory resource, so in order to keep DT backwards compatibility
> > + * we try to fallback to a hardcoded register address, if the resource
> > + * is missing from the devicetree.
> > + */
> > +static void __iomem *try_rstout_ioremap(struct platform_device *pdev,
> > + phys_addr_t internal_regs)
> > +{
> > + struct resource *res;
> > + phys_addr_t rstout;
> > +
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > + if (res)
> > + return devm_ioremap(&pdev->dev, res->start,
> > + resource_size(res));
> > +
> > + /* This workaround works only for "orion-wdt", DT-enabled */
> > + if (!of_device_is_compatible(pdev->dev.of_node, "marvell,orion-wdt"))
> > + return NULL;
> > +
> > + rstout = internal_regs + ORION_RSTOUT_MASK_OFFSET;
> > +
> > + WARN(1, FW_BUG "falling back to harcoded RSTOUT reg 0x%x\n", rstout);
>
> WARN seems to be a bit excessive here. Is that on purpose (sorry if that was discussed and I missed it) ?
>
> Assuming it is on purpose
>
> Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
>
Yes, it's on purpose. We want users to notice this and be aware they have
a broken dtb (hence the sign firmware bug).
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 07/18] watchdog: orion: Handle IRQ
2014-01-26 13:14 ` Ezequiel Garcia
@ 2014-01-26 14:57 ` Thomas Petazzoni
0 siblings, 0 replies; 42+ messages in thread
From: Thomas Petazzoni @ 2014-01-26 14:57 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Sebastian Hesselbarth, Arnd Bergmann,
Daniel Lezcano, Fabio Estevam, Andrew Lunn, Gregory Clement,
Tawfik Bayouk, Lior Amsalem, Guenter Roeck, Jason Cooper
Dear Ezequiel Garcia,
On Sun, 26 Jan 2014 10:14:46 -0300, Ezequiel Garcia wrote:
> > I don't quiite understand the first sentence of this commit log, and
> > the commit title looks wrong. Maybe a bad copy/paste or something?
> >
>
> Hm... yes it doesn't look right. It should read:
>
> "DT-enabled platforms, where the irqchip driver for the brigde interrupt
> controller is available, can handle the watchdog IRQ properly. Therefore,
> we request the interrupt and add a dummy handler that merely calls panic()".
Ok.
> I guess we can re-phrase it be a bit more readable.
>
> Why does th commit title looks wrong? By requesting the IRQ we are
> "handling it", no?
Right, but it looks "truncated". Maybe something like:
watchdog: orion: handle irq to avoid having to clear BRIDGE_CLAUSE
or something like that (adjust to the actual reality, I haven't
followed all the implications).
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH v4 00/18] Armada 370/XP watchdog support
[not found] ` <52E19A44.7040308-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-25 17:09 ` Ezequiel Garcia
@ 2014-01-27 14:49 ` Ezequiel Garcia
1 sibling, 0 replies; 42+ messages in thread
From: Ezequiel Garcia @ 2014-01-27 14:49 UTC (permalink / raw)
To: Sebastian Hesselbarth
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck,
Jason Gunthorpe, Arnd Bergmann, Daniel Lezcano, Fabio Estevam,
Andrew Lunn, Thomas Petazzoni, Gregory Clement, Tawfik Bayouk,
Lior Amsalem, Guenter Roeck, Jason Cooper
Hi Sebastian,
On Thu, Jan 23, 2014 at 11:40:04PM +0100, Sebastian Hesselbarth wrote:
> On 01/23/2014 12:04 AM, Ezequiel Garcia wrote:
> > After some lengthy discussion on the [v2] and [v3] patchsets, here's a new
> > round. I hope I haven't forgotten anything.
> >
>
> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
As currently Dove doesn't have watchdog support in the devicetree, I've added
it to the v5 (which I'll submit now) with your Tested-by on all the patchset.
Thanks a lot for the test,
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2014-01-27 14:49 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 23:04 [PATCH v4 00/18] Armada 370/XP watchdog support Ezequiel Garcia
[not found] ` <1390431915-5115-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-22 23:04 ` [PATCH v4 01/18] ARM: Introduce atomic MMIO modify Ezequiel Garcia
[not found] ` <1390431915-5115-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 20:32 ` Jason Cooper
2014-01-22 23:04 ` [PATCH v4 02/18] clocksource: orion: Use atomic access for shared registers Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 03/18] watchdog: orion: Add clock error handling Ezequiel Garcia
[not found] ` <1390431915-5115-4-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:12 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 04/18] watchdog: orion: Use atomic access for shared registers Ezequiel Garcia
[not found] ` <1390431915-5115-5-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:12 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 05/18] watchdog: orion: Remove unused macros Ezequiel Garcia
[not found] ` <1390431915-5115-6-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:13 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 06/18] watchdog: orion: Make sure the watchdog is initially stopped Ezequiel Garcia
[not found] ` <1390431915-5115-7-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:13 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 07/18] watchdog: orion: Handle IRQ Ezequiel Garcia
[not found] ` <1390431915-5115-8-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:15 ` Guenter Roeck
2014-01-26 8:04 ` Thomas Petazzoni
2014-01-26 13:14 ` Ezequiel Garcia
2014-01-26 14:57 ` Thomas Petazzoni
2014-01-22 23:05 ` [PATCH v4 08/18] watchdog: orion: Make RSTOUT register a separate resource Ezequiel Garcia
[not found] ` <1390431915-5115-9-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:19 ` Guenter Roeck
[not found] ` <52E4003E.4070106-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-01-26 13:20 ` Ezequiel Garcia
2014-01-26 8:17 ` Thomas Petazzoni
2014-01-26 13:18 ` Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 09/18] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear Ezequiel Garcia
[not found] ` <1390431915-5115-10-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:20 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 10/18] watchdog: orion: Introduce an orion_watchdog device structure Ezequiel Garcia
[not found] ` <1390431915-5115-11-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:21 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 11/18] watchdog: orion: Introduce per-compatible of_device_id data Ezequiel Garcia
[not found] ` <1390431915-5115-12-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:23 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 12/18] watchdog: orion: Add per-compatible clock initialization Ezequiel Garcia
[not found] ` <1390431915-5115-13-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:24 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 13/18] watchdog: orion: Add per-compatible watchdog start implementation Ezequiel Garcia
[not found] ` <1390431915-5115-14-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:24 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 14/18] watchdog: orion: Add support for Armada 370 and Armada XP SoC Ezequiel Garcia
[not found] ` <1390431915-5115-15-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-25 18:25 ` Guenter Roeck
2014-01-22 23:05 ` [PATCH v4 15/18] ARM: mvebu: Enable Armada 370/XP watchdog in the devicetree Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 16/18] ARM: kirkwood: Add RSTOUT 'reg' entry to devicetree Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 17/18] watchdog: orion: Enable the build on ARCH_MVEBU Ezequiel Garcia
2014-01-22 23:05 ` [PATCH v4 18/18] ARM: mvebu: Enable watchdog support in defconfig Ezequiel Garcia
2014-01-23 22:40 ` [PATCH v4 00/18] Armada 370/XP watchdog support Sebastian Hesselbarth
[not found] ` <52E19A44.7040308-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-25 17:09 ` Ezequiel Garcia
2014-01-27 14:49 ` Ezequiel Garcia
2014-01-25 16:57 ` Ezequiel Garcia
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).