Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pull watchdog updates from Wim Van Sebroeck:
 "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"

* git://www.linux-watchdog.org/linux-watchdog:
  watchdog: stmp3xxx_rtc_wdt: fix broken email address
  watchdog: pnx4008_wdt: fix broken email address
  watchdog: octeon: use fixed length string for register names
  watchdog: octeon: fix some trivial coding style issues
  watchdog: octeon: convert to WATCHDOG_CORE API
  watchdog: cadence: Remove Kconfig dependency on ARCH
  ARM: msm: add watchdog entries to DT timer binding doc
  ARM: qcom: add description of KPSS WDT for IPQ8064
  watchdog: qcom: use timer devicetree binding
  watchdog: bcm281xx: Remove use of seq_printf return value
  • Loading branch information
Linus Torvalds committed Apr 22, 2015
2 parents b9bb6fb + cf82f52 commit 7dcca3e
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 178 deletions.
16 changes: 13 additions & 3 deletions Documentation/devicetree/bindings/arm/msm/timer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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>;
};
14 changes: 13 additions & 1 deletion arch/arm/boot/dts/qcom-ipq8064.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
};
};

clocks {
sleep_clk: sleep_clk {
compatible = "fixed-clock";
clock-frequency = <32768>;
#clock-cells = <0>;
};
};

soc: soc {
#address-cells = <1>;
#size-cells = <1>;
Expand Down Expand Up @@ -105,10 +113,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>;
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
27 changes: 16 additions & 11 deletions drivers/watchdog/bcm_kona_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,22 @@ 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);
cur_val = secure_register_read(wdt, SECWDOG_COUNT_REG);
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;

Expand All @@ -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)
Expand Down
Loading

0 comments on commit 7dcca3e

Please sign in to comment.