linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] watchdog: dw_wdt: Take Baikal-T1 DW WDT peculiarities into account
@ 2020-03-06 13:27 Sergey.Semin
  2020-05-10 10:58 ` [PATCH v2 " Serge Semin
  0 siblings, 1 reply; 16+ messages in thread
From: Sergey.Semin @ 2020-03-06 13:27 UTC (permalink / raw)
  Cc: Serge Semin, Serge Semin, Alexey Malahov, Maxim Kaurkin,
	Pavel Parkhomenko, Ramil Zaripov, Ekaterina Skachko,
	Vadim Vlasov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle,
	Wim Van Sebroeck, Guenter Roeck, Philipp Zabel, Rob Herring,
	Mark Rutland, linux-watchdog, devicetree, linux-kernel

From: Serge Semin <fancer.lancer@gmail.com>

There were a few features enabled at the time of the Baikal-T1 SoC DW WDT
IP synthesis, which weren't taken into account in the DW WDT driver available
in the kernel. First of all the SoC engineers synthesized the watchdog core
with WDT_USE_FIX_TOP set to false (don't really know why, but they did).
Due to this the timer reset values weren't fixed as the driver expected
but were initialized with a pre-defined values selected by the engineers.
Secondly the driver expected that the watchdog APB bus and the timer had
synchronous reference clocks, while Baikal-T1 SoC DW WDT was created with
asynchronous ones. So the driver should enable two clock devices: APB bus
clocks and a separate timer reference clock. Finally DW Watchdog Timer is
capable of generating a pre-timeout interrupt if corresponding config is
enabled. The problem was that the pre-timeout IRQ happens when the set
timeout elapses, while the actual WDT expiration and subsequent reboot take
place in the next timeout. This makes the pre-timeout functionality
implementation a bit tricky, since in this case we would have to find a
WDT timeout twice smaller the requested timeout. All of the changes described
above are provided by the patches in this patchset.

In addition traditionally we replaced the legacy plain text-based dt-binding
file with yaml-based one, made some cleanups in the watchdog core code (just
replaced time-unit numerical literals with corresponding macro) and added
DebugFS nodes to ease the driver debug procedure.

This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4:
commit 98d54f81e36b ("Linux 5.6-rc4").

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru>
Cc: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>
Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
Cc: Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru>
Cc: Vadim Vlasov <V.Vlasov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-watchdog@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Serge Semin (7):
  dt-bindings: watchdog: dw-wdt: Replace legacy bindings file with
    YAML-based one
  dt-bindings: watchdog: dw-wdt: Add watchdog TOPs array property
  watchdog: watchdog_dev: Use generic msec-per-sec macro
  watchdog: dw_wdt: Support devices with non-fixed TOP values
  watchdog: dw_wdt: Support devices with asynch clocks
  watchdog: dw_wdt: Add pre-timeouts support
  watchdog: dw_wdt: Add DebugFS files

 .../devicetree/bindings/watchdog/dw_wdt.txt   |  24 -
 .../bindings/watchdog/snps,dw-wdt.yaml        |  96 ++++
 drivers/watchdog/dw_wdt.c                     | 460 ++++++++++++++++--
 drivers/watchdog/watchdog_dev.c               |   4 +-
 4 files changed, 523 insertions(+), 61 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/dw_wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml

-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-05-18 21:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 13:27 [PATCH 0/7] watchdog: dw_wdt: Take Baikal-T1 DW WDT peculiarities into account Sergey.Semin
2020-05-10 10:58 ` [PATCH v2 " Serge Semin
2020-05-10 10:58   ` [PATCH v2 1/7] dt-bindings: watchdog: Convert DW WDT binding to DT schema Serge Semin
2020-05-18 20:35     ` Rob Herring
2020-05-10 10:58   ` [PATCH v2 2/7] dt-bindings: watchdog: dw-wdt: Support devices with asynch clocks Serge Semin
2020-05-11  8:25     ` Sergei Shtylyov
2020-05-11  8:28       ` Sergei Shtylyov
2020-05-12 17:16         ` Serge Semin
2020-05-18 20:36     ` Rob Herring
2020-05-10 10:58   ` [PATCH v2 3/7] dt-bindings: watchdog: dw-wdt: Add watchdog TOPs array property Serge Semin
2020-05-18 20:40     ` Rob Herring
2020-05-18 21:42       ` Serge Semin
2020-05-10 10:58   ` [PATCH v2 4/7] watchdog: dw_wdt: Support devices with non-fixed TOP values Serge Semin
2020-05-10 10:58   ` [PATCH v2 5/7] watchdog: dw_wdt: Support devices with asynch clocks Serge Semin
2020-05-10 10:58   ` [PATCH v2 6/7] watchdog: dw_wdt: Add pre-timeouts support Serge Semin
2020-05-10 10:58   ` [PATCH v2 7/7] watchdog: dw_wdt: Add DebugFS files Serge Semin

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).