Skip to contentSkip to conversation

watchdog - v4.1 merge window

GIT PULL Wim Van Sebroeck 1 participant 1 message Apr 22, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

Please pull from 'master' branch of
git://www.linux-watchdog.org/linux-watchdog.git

This contains following changes:
* Octeon: convert to watchdog-API and apply some fixes
* Cadence wdt: remove dependency on ARCH
* Add DT bindings for qcom + msm
* bcm281xx: Remove use of seq_printf return value
* stmp3xxx_rtc_wdt + pnx4008_wdt: fix broken email addresses

This will update the following files:

 Documentation/devicetree/bindings/arm/msm/timer.txt |   16 +
 arch/arm/boot/dts/qcom-ipq8064.dtsi                 |   14 +
 drivers/watchdog/Kconfig                            |    2 
 drivers/watchdog/bcm_kona_wdt.c                     |   27 +-
 drivers/watchdog/octeon-wdt-main.c                  |  201 ++++----------------
 drivers/watchdog/pnx4008_wdt.c                      |    2 
 drivers/watchdog/qcom-wdt.c                         |   21 +-
 drivers/watchdog/stmp3xxx_rtc_wdt.c                 |    4 
 8 files changed, 109 insertions(+), 178 deletions(-)

with these Changes:

commit cf82f52d3619d2e15c83ec9a03c6ce8cdf6c6b58

Author: Wolfram Sang <[email protected]>
Date:   Mon Apr 20 15:51:44 2015 +0200

watchdog: stmp3xxx_rtc_wdt: fix broken email address

My Pengutronix address is not valid anymore, redirect people to the Pengutronix kernel team.

commit e8cc53665728860a56dbbd56bfc32ac934efb70a

Author: Wolfram Sang <[email protected]>
Date:   Mon Apr 20 15:51:43 2015 +0200

watchdog: pnx4008_wdt: fix broken email address

My Pengutronix address is not valid anymore, redirect people to the Pengutronix kernel team.

commit 3a30c07e712df895981deac0782655997942bc75

Author: Aaro Koskinen <[email protected]>
Date:   Sat Mar 28 20:05:40 2015 +0200

watchdog: octeon: use fixed length string for register names

Use fixed length string for register names. This saves 416 bytes in text size.

commit 8692cf0ad31b3654c798c23de01e4c23c4536dea

Author: Aaro Koskinen <[email protected]>
Date:   Sat Mar 28 20:05:39 2015 +0200

watchdog: octeon: fix some trivial coding style issues

Fix some trivial coding style issues to reduce noise from static analyzers.

commit 3d588c93c040c4aacca81b15a7aa9761357ecdc4

Author: Aaro Koskinen <[email protected]>
Date:   Sat Mar 28 20:05:38 2015 +0200

watchdog: octeon: convert to WATCHDOG_CORE API

Convert OCTEON watchdog to WATCHDOG_CORE API. This enables support for multiple watchdogs on OCTEON boards.

commit 6290d8c826023a633da3e675784b5f317a9600f0

Author: Michal Simek <[email protected]>
Date:   Mon Mar 9 09:50:12 2015 +0100

watchdog: cadence: Remove Kconfig dependency on ARCH

Remove Kconfig dependency and enable driver for all ARCHs.

commit cf79fb14d09f8a9aaadfce59d01cfedf4f96d99d

Author: Mathieu Olivari <[email protected]>
Date:   Fri Feb 20 18:19:36 2015 -0800

ARM: msm: add watchdog entries to DT timer binding doc

The watchdog has been reworked to use the same DT node as the timer. This change is updating the device tree doc accordingly.

commit 4ba1c98b552c58b1a29bd943aef51b1788465b2d

Author: Mathieu Olivari <[email protected]>
Date:   Fri Feb 20 18:19:35 2015 -0800

ARM: qcom: add description of KPSS WDT for IPQ8064

Add the watchdog related entries to the Krait Processor Sub-system (KPSS) timer IPQ8064 devicetree section. Also, add a fixed-clock description of SLEEP_CLK, which will do for now.

commit 0dfd582e026af8a37917164aaba7227fa812e5c2

Author: Mathieu Olivari <[email protected]>
Date:   Fri Feb 20 18:19:34 2015 -0800

watchdog: qcom: use timer devicetree binding

MSM watchdog configuration happens in the same register block as the timer, so we'll use the same binding as the existing timer.

The qcom-wdt will now be probed when devicetree has an entry compatible with "qcom,kpss-timer" or "qcom-scss-timer".

commit e1dbde29609a4f829589f0e48361470327ae3f62

Author: Joe Perches <[email protected]>
Date:   Sat Feb 21 18:53:48 2015 -0800

watchdog: bcm281xx: Remove use of seq_printf return value

The seq_printf return value, because it's frequently misused, will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")

Acked-by Guenter Roeck <linux~roeck-us.net>

For completeness, I added the overal diff below.

Greetings,
Wim.

================================================================================

Documentation/devicetree/bindings/arm/msm/timer.txt +13 -3
index 74607b6..5e10c34 100644
@@ -9,11 +9,17 @@ Properties:
                "qcom,scss-timer" - scorpion subsystem
 
 - interrupts : Interrupts for the debug timer, the first general purpose
-               timer, and optionally a second general purpose timer in that
-               order.
+               timer, and optionally a second general purpose timer, and
+               optionally as well, 2 watchdog interrupts, in that order.
 
 - reg : Specifies the base address of the timer registers.
 
+- clocks: Reference to the parent clocks, one per output clock. The parents
+          must appear in the same order as the clock names.
+
+- clock-names: The name of the clocks as free-form strings. They should be in
+               the same order as the clocks.
+
 - clock-frequency : The frequency of the debug timer and the general purpose
                     timer(s) in Hz in that order.
 
@@ -29,9 +35,13 @@ Example:
                compatible = "qcom,scss-timer", "qcom,msm-timer";
                interrupts = <1 1 0x301>,
                             <1 2 0x301>,
-                            <1 3 0x301>;
+                            <1 3 0x301>,
+                            <1 4 0x301>,
+                            <1 5 0x301>;
                reg = <0x0200a000 0x100>;
                clock-frequency = <19200000>,
                                  <32768>;
+               clocks = <&sleep_clk>;
+               clock-names = "sleep";
                cpu-offset = <0x40000>;
        };
arch/arm/boot/dts/qcom-ipq8064.dtsi +13 -1
index cb225da..d01f618 100644
@@ -60,6 +60,14 @@
 		};
 	};
 
+	clocks {
+		sleep_clk: sleep_clk {
+			compatible = "fixed-clock";
+			clock-frequency = <32768>;
+			#clock-cells = <0>;
+		};
+	};
+
 	soc: soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -89,10 +97,14 @@
 			compatible = "qcom,kpss-timer", "qcom,msm-timer";
 			interrupts = <1 1 0x301>,
 				     <1 2 0x301>,
-				     <1 3 0x301>;
+				     <1 3 0x301>,
+				     <1 4 0x301>,
+				     <1 5 0x301>;
 			reg = <0x0200a000 0x100>;
 			clock-frequency = <25000000>,
 					  <32768>;
+			clocks = <&sleep_clk>;
+			clock-names = "sleep";
 			cpu-offset = <0x80000>;
 		};
 
drivers/watchdog/Kconfig +1 -1
index 16f2023..7acc71e 100644
@@ -169,7 +169,6 @@ config AT91SAM9X_WATCHDOG
 
 config CADENCE_WATCHDOG
 	tristate "Cadence Watchdog Timer"
-	depends on ARM
 	select WATCHDOG_CORE
 	help
 	  Say Y here if you want to include support for the watchdog
@@ -1190,6 +1189,7 @@ config OCTEON_WDT
 	tristate "Cavium OCTEON SOC family Watchdog Timer"
 	depends on CAVIUM_OCTEON_SOC
 	default y
+	select WATCHDOG_CORE
 	select EXPORT_UASM if OCTEON_WDT = m
 	help
 	  Hardware driver for OCTEON's on chip watchdog timer.
drivers/watchdog/bcm_kona_wdt.c +16 -11
index 4e37db3..22d8ae6 100644
@@ -99,12 +99,14 @@ static int secure_register_read(struct bcm_kona_wdt *wdt, uint32_t offset)
 
 static int bcm_kona_wdt_dbg_show(struct seq_file *s, void *data)
 {
-	int ctl_val, cur_val, ret;
+	int ctl_val, cur_val;
 	unsigned long flags;
 	struct bcm_kona_wdt *wdt = s->private;
 
-	if (!wdt)
-		return seq_puts(s, "No device pointer\n");
+	if (!wdt) {
+		seq_puts(s, "No device pointer\n");
+		return 0;
+	}
 
 	spin_lock_irqsave(&wdt->lock, flags);
 	ctl_val = secure_register_read(wdt, SECWDOG_CTRL_REG);
@@ -112,7 +114,7 @@ static int bcm_kona_wdt_dbg_show(struct seq_file *s, void *data)
 	spin_unlock_irqrestore(&wdt->lock, flags);
 
 	if (ctl_val < 0 || cur_val < 0) {
-		ret = seq_puts(s, "Error accessing hardware\n");
+		seq_puts(s, "Error accessing hardware\n");
 	} else {
 		int ctl, cur, ctl_sec, cur_sec, res;
 
@@ -121,15 +123,18 @@ static int bcm_kona_wdt_dbg_show(struct seq_file *s, void *data)
 		cur = cur_val & SECWDOG_COUNT_MASK;
 		ctl_sec = TICKS_TO_SECS(ctl, wdt);
 		cur_sec = TICKS_TO_SECS(cur, wdt);
-		ret = seq_printf(s, "Resolution: %d / %d\n"
-				"Control: %d s / %d (%#x) ticks\n"
-				"Current: %d s / %d (%#x) ticks\n"
-				"Busy count: %lu\n", res,
-				wdt->resolution, ctl_sec, ctl, ctl, cur_sec,
-				cur, cur, wdt->busy_count);
+		seq_printf(s,
+			   "Resolution: %d / %d\n"
+			   "Control: %d s / %d (%#x) ticks\n"
+			   "Current: %d s / %d (%#x) ticks\n"
+			   "Busy count: %lu\n",
+			   res, wdt->resolution,
+			   ctl_sec, ctl, ctl,
+			   cur_sec, cur, cur,
+			   wdt->busy_count);
 	}
 
-	return ret;
+	return 0;
 }
 
 static int bcm_kona_dbg_open(struct inode *inode, struct file *file)
drivers/watchdog/octeon-wdt-main.c +48 -153

302 lines not on this page · raw message

drivers/watchdog/pnx4008_wdt.c +1 -1
index 55e2201..b9c6049 100644
@@ -216,7 +216,7 @@ static struct platform_driver platform_wdt_driver = {
 module_platform_driver(platform_wdt_driver);
 
 MODULE_AUTHOR("MontaVista Software, Inc. <[email protected]>");
-MODULE_AUTHOR("Wolfram Sang <[email protected]>");
+MODULE_AUTHOR("Wolfram Sang <[email protected]>");
 MODULE_DESCRIPTION("PNX4008 Watchdog Driver");
 
 module_param(heartbeat, uint, 0);
drivers/watchdog/qcom-wdt.c +15 -6
index aa85618..aa03ca8 100644
@@ -20,9 +20,9 @@
 #include <linux/reboot.h>
 #include <linux/watchdog.h>
 
-#define WDT_RST		0x0
-#define WDT_EN		0x8
-#define WDT_BITE_TIME	0x24
+#define WDT_RST		0x38
+#define WDT_EN		0x40
+#define WDT_BITE_TIME	0x5C
 
 struct qcom_wdt {
 	struct watchdog_device	wdd;
@@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
 {
 	struct qcom_wdt *wdt;
 	struct resource *res;
+	struct device_node *np = pdev->dev.of_node;
+	u32 percpu_offset;
 	int ret;
 
 	wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
@@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	/* We use CPU0's DGT for the watchdog */
+	if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
+		percpu_offset = 0;
+
+	res->start += percpu_offset;
+	res->end += percpu_offset;
+
 	wdt->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(wdt->base))
 		return PTR_ERR(wdt->base);
@@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id qcom_wdt_of_table[] = {
-	{ .compatible = "qcom,kpss-wdt-msm8960", },
-	{ .compatible = "qcom,kpss-wdt-apq8064", },
-	{ .compatible = "qcom,kpss-wdt-ipq8064", },
+	{ .compatible = "qcom,kpss-timer" },
+	{ .compatible = "qcom,scss-timer" },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);
drivers/watchdog/stmp3xxx_rtc_wdt.c +2 -2
index a62b1b6..e7f0d5b 100644
@@ -1,7 +1,7 @@
 /*
  * Watchdog driver for the RTC based watchdog in STMP3xxx and i.MX23/28
  *
- * Author: Wolfram Sang <[email protected]>
+ * Author: Wolfram Sang <[email protected]>
  *
  * Copyright (C) 2011-12 Wolfram Sang, Pengutronix
  *
@@ -129,4 +129,4 @@ module_platform_driver(stmp3xxx_wdt_driver);
 
 MODULE_DESCRIPTION("STMP3XXX RTC Watchdog Driver");
 MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Wolfram Sang <[email protected]>");
+MODULE_AUTHOR("Wolfram Sang <[email protected]>");