From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>
Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru>,
Serge Semin <fancer.lancer@gmail.com>,
Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>,
Ekaterina Skachko <Ekaterina.Skachko@baikalelectronics.ru>,
Vadim Vlasov <V.Vlasov@baikalelectronics.ru>,
Alexey Kolotnikov <Alexey.Kolotnikov@baikalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Paul Burton <paulburton@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>, Arnd Bergmann <arnd@arndb.de>,
Philipp Zabel <p.zabel@pengutronix.de>,
Rob Herring <robh+dt@kernel.org>, <linux-mips@vger.kernel.org>,
<linux-watchdog@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 0/7] watchdog: dw_wdt: Take Baikal-T1 DW WDT peculiarities into account
Date: Sun, 10 May 2020 13:58:00 +0300 [thread overview]
Message-ID: <20200510105807.880-1-Sergey.Semin@baikalelectronics.ru> (raw)
In-Reply-To: <20200306132758.703FC8030704@mail.baikalelectronics.ru>
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 and added the controller registers dump DebugFS node
to ease the driver debug procedure.
This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4:
base-commit: 0e698dfa2822 ("Linux 5.7-rc4")
tag: v5.7-rc4
Changelog v2:
- Rearrange SoBs.
- Discard BE copyright header from the binding file.
- Replace "additionalProperties: false" with "unevaluatedProperties: false"
property in the binding.
- Move the APB3 clocks support declared in the dt binding file into a
dedicated patch.
- Move $ref to the root level of the "snps,watchdog-tops" property
so does the constraints.
- Make Pre-timeout IRQs support being optional.
- Add "ms" suffix to the methods returning msec and convert the methods
with no "ms" suffix to return a timeout in sec.
- Make sure minimum timeout is at least 1 sec.
- Refactor the timeouts calculation procedure to to retain the timeouts in
the ascending order.
- Make sure there is no integer overflow in milliseconds calculation. It
is saved in a dedicated uint field of the timeout structure.
- Discard timeout/pretimeout/ping/enable DebugFS nodes. Registers state
dump node is only left.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: 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: Alexey Kolotnikov <Alexey.Kolotnikov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-watchdog@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Serge Semin (7):
dt-bindings: watchdog: Convert DW WDT binding to DT schema
dt-bindings: watchdog: dw-wdt: Support devices with asynch clocks
dt-bindings: watchdog: dw-wdt: Add watchdog TOPs array property
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 | 91 ++++
drivers/watchdog/dw_wdt.c | 437 ++++++++++++++++--
3 files changed, 495 insertions(+), 57 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
next prev parent reply other threads:[~2020-05-10 10:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Serge Semin [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200510105807.880-1-Sergey.Semin@baikalelectronics.ru \
--to=sergey.semin@baikalelectronics.ru \
--cc=Alexey.Kolotnikov@baikalelectronics.ru \
--cc=Alexey.Malahov@baikalelectronics.ru \
--cc=Ekaterina.Skachko@baikalelectronics.ru \
--cc=Maxim.Kaurkin@baikalelectronics.ru \
--cc=Pavel.Parkhomenko@baikalelectronics.ru \
--cc=Ramil.Zaripov@baikalelectronics.ru \
--cc=V.Vlasov@baikalelectronics.ru \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=p.zabel@pengutronix.de \
--cc=paulburton@kernel.org \
--cc=ralf@linux-mips.org \
--cc=robh+dt@kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).