Daniel Palmer
ffd264bd15
watchdog: msc313e: Check if the WDT was running at boot
...
Check if the WDT was running at boot and set the running
flag if it was. This prevents the system from getting
rebooted if the userland daemon doesn't take over soon enough
or there isn't a userland daemon at all.
Signed-off-by: Daniel Palmer <daniel@0x0f.com >
Reviewed-by: Romain Perier <romain.perier@gmail.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211228073427.2443174-1-daniel@0x0f.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:38:51 +01:00
Sven Peter
4ed224aeaf
watchdog: Add Apple SoC watchdog driver
...
Add support for the watchdog timer found in Apple SoCs. This driver is
also required to reboot these machines.
Signed-off-by: Sven Peter <sven@svenpeter.dev >
Tested-by: Janne Grunau <j@jannau.net >
Reviewed-by: Hector Martin <marcan@marcan.st >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211211123633.4392-2-sven@svenpeter.dev
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:38:37 +01:00
Luca Weiss
b05e69f822
dt-bindings: watchdog: Add SM6350 and SM8250 compatible
...
Add devicetree compatible for the watchdog on SM6350 and SM8250 SoC.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com >
Acked-by: Konrad Dybcio <konrad.dybcio@somainline.org >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20211213082614.22651-8-luca.weiss@fairphone.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:38:37 +01:00
Sam Protsenko
f7bcb02390
watchdog: s3c2410: Fix getting the optional clock
...
"watchdog_src" clock is optional and may not be present for some SoCs
supported by this driver. Nevertheless, in case the clock is provided
but some error happens during its getting, that error should be handled
properly. Use devm_clk_get_optional() API for that. Also report possible
errors using dev_err_probe() to handle properly -EPROBE_DEFER error (if
clock provider is not ready by the time WDT probe function is executed).
Fixes: e249d01b5e ("watchdog: s3c2410: Support separate source clock")
Reported-by: kernel test robot <lkp@intel.com >
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Suggested-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Link: https://lore.kernel.org/r/20211212170247.30646-1-semen.protsenko@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:38:37 +01:00
Lad Prabhakar
a51f589693
watchdog: s3c2410: Use platform_get_irq() to get the interrupt
...
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypassed the hierarchical setup and messed up the
irq chaining.
In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Link: https://lore.kernel.org/r/20211216214747.10454-1-prabhakar.mahadev-lad.rj@bp.renesas.com
[groeck: Fixed context conflicts]
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:38:36 +01:00
Rob Herring
af5bb1c207
dt-bindings: watchdog: atmel: Add missing 'interrupts' property
...
With 'unevaluatedProperties' support implemented, the atmel,sama5d4-wdt
example has the following warning:
/home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.example.dt.yaml: watchdog@fc068640: Unevaluated properties are not allowed ('interrupts' was unexpected)
Document the missing 'interrupts' property.
Cc: Wim Van Sebroeck <wim@linux-watchdog.org >
Cc: Guenter Roeck <linux@roeck-us.net >
Cc: Nicolas Ferre <nicolas.ferre@microchip.com >
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com >
Cc: Ludovic Desroches <ludovic.desroches@microchip.com >
Cc: Eugen Hristev <eugen.hristev@microchip.com >
Cc: linux-watchdog@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org >
Acked-by: Guenter Roeck <linux@roeck-us.net >
Reviewed-by: Thierry Reding <treding@nvidia.com >
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com >
Link: https://lore.kernel.org/r/20211206174045.2294873-1-robh@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:16 +01:00
Tzung-Bi Shih
1bafac47a4
watchdog: mtk_wdt: use platform_get_irq_optional
...
The watchdog pre-timeout (bark) interrupt is optional. Use
platform_get_irq_optional() to avoid seeing such following
error message:
>>> mtk-wdt 10007000.watchdog: IRQ index 0 not found
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211208095555.4099551-1-tzungbi@google.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:16 +01:00
Biju Das
2cbc5cd0b5
watchdog: Add Watchdog Timer driver for RZ/G2L
...
Add Watchdog Timer driver for RZ/G2L SoC.
WDT IP block supports normal watchdog timer function and reset
request function due to CPU parity error.
This driver currently supports normal watchdog timer function
and later will add support for reset request function due to
CPU parity error.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211130195357.18626-3-biju.das.jz@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:15 +01:00
Biju Das
ab02a00c9e
dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L
...
Describe the WDT hardware in the RZ/G2L series.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211130195357.18626-2-biju.das.jz@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:15 +01:00
Andrej Picej
7d608c33cb
watchdog: da9063: Add hard dependency on I2C
...
Commit 5ea29919c294 ("watchdog: da9063: use atomic safe i2c transfer in
reset handler") implements atomic save i2c transfer which uses i2c
functions directly. Add I2C hard dependency which overrides COMPILE_TEST.
Reported-by: kernel test robot <lkp@intel.com >
Fixes: 968011a291 ("watchdog: da9063: use atomic safe i2c transfer in reset handler")
Signed-off-by: Andrej Picej <andrej.picej@norik.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211129134938.3273289-1-andrej.picej@norik.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:15 +01:00
Sander Vanheule
7d7267ae63
watchdog: Add Realtek Otto watchdog timer
...
Realtek MIPS SoCs (platform name Otto) have a watchdog timer with
pretimeout notifitication support. The WDT can (partially) hard reset,
or soft reset the SoC.
This driver implements all features as described in the devicetree
binding, except the phase2 interrupt, and also functions as a restart
handler. The cpu reset mode is considered to be a "warm" restart, since
this mode does not reset all peripherals. Being an embedded system
though, the "cpu" and "software" modes will still cause the bootloader
to run on restart.
It is not known how a forced system reset can be disabled on the
supported platforms. This means that the phase2 interrupt will only fire
at the same time as reset, so implementing phase2 is of little use.
Signed-off-by: Sander Vanheule <sander@svanheule.net >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/6d060bccbdcc709cfa79203485db85aad3c3beb5.1637252610.git.sander@svanheule.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:14 +01:00
Sander Vanheule
1da9bf7303
dt-bindings: watchdog: Realtek Otto WDT binding
...
Add a binding description for Realtek's watchdog timer as found on
several of their MIPS-based SoCs (codenamed Otto), such as the RTL838x,
RTL839x, and RTL930x series of switch SoCs.
Signed-off-by: Sander Vanheule <sander@svanheule.net >
Reviewed-by: Rob Herring <robh@kernel.org >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/d832d5b02976dd2c2674d46778f61e5cfcd9b651.1637252610.git.sander@svanheule.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2022-01-05 10:33:14 +01:00
Sam Protsenko
cd4eadf228
watchdog: s3c2410: Add Exynos850 support
...
Exynos850 is a bit different from SoCs already supported in WDT driver:
- AUTOMATIC_WDT_RESET_DISABLE register is removed, so its value is
always 0; .disable_auto_reset callback is not set for that reason
- MASK_WDT_RESET_REQUEST register is replaced with
CLUSTERx_NONCPU_IN_EN register; instead of masking (disabling) WDT
reset interrupt it's now enabled with the same value; .mask_reset
callback is reused for that functionality though
- To make WDT functional, WDT counter needs to be enabled in
CLUSTERx_NONCPU_OUT register; it's done using .enable_counter
callback
Also Exynos850 has two CPU clusters, each has its own dedicated WDT
instance. Different PMU registers and bits are used for each cluster. So
driver data is now modified in probe, adding needed info depending on
cluster index passed from device tree.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org >
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211121165647.26706-13-semen.protsenko@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:08:51 +01:00
Yunus Bas
968011a291
watchdog: da9063: use atomic safe i2c transfer in reset handler
...
This patch is based on commit 057b52b4b3 ("watchdog: da9062: make restart
handler atomic safe"), which uses the atomic transfer capability of the
i2c framework.
Signed-off-by: Yunus Bas <y.bas@phytec.de >
Signed-off-by: Andrej Picej <andrej.picej@norik.com >
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211124080654.2601135-1-andrej.picej@norik.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:03:03 +01:00
Changcheng Deng
1fc8a2c021
watchdog: davinci: Use div64_ul instead of do_div
...
do_div() does a 64-by-32 division. Here the divisor is an unsigned long
which on some platforms is 64 bit wide. So use div64_ul instead of do_div
to avoid a possible truncation.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211125014924.46297-1-deng.changcheng@zte.com.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:03:03 +01:00
Florian Fainelli
f8d9ba7fed
watchdog: Remove BCM63XX_WDT
...
Now that we can utilize the BCM7038_WDT driver, remove that one which
was not converted to the watchdog APIs. There are a couple of notable
differences with how the bcm7038_wdt driver proceeds:
- bcm63xx_wdt would register with the ad-hoc BCM63xx hardware timer API,
but this would only be used in order to catch the interrupt *before* a
SoC reset and make the kernel "die"
- bcm6xx_wdt would register a software timer and kick it every second in
order to pet the watchdog, thus offering a two step watchdog process.
This is not something that is brought over to the bcm7038_wdt as it is
deemed unnecessary. If user-space cannot pet the watchdog, but a
kernel timer can, the system is still in a bad shape anyway.
bcm7038_wdt is simpler in its behavior and behaves as a standard
watchdog driver and is not making use of any specific platform APIs,
therefore making it more maintainable and extensible.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112224636.395101-8-f.fainelli@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:03:03 +01:00
Florian Fainelli
b844f9181b
MIPS: BCM63XX: Provide platform data to watchdog device
...
In order to utilize the bcm7038_wdt.c driver which needs to know the
clock name to obtain, pass it via platform data using the
bcm7038_wdt_platform_data structure.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112224636.395101-7-f.fainelli@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:03:02 +01:00
Florian Fainelli
e764faef77
watchdog: bcm7038_wdt: Add platform device id for bcm63xx-wdt
...
In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce
a platform_device_id table that allows both names to be matched.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112224636.395101-6-f.fainelli@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:03:02 +01:00
Florian Fainelli
bc0bf9e9ac
watchdog: Allow building BCM7038_WDT for BCM63XX
...
CONFIG_BCM63XX denotes the legacy MIPS-based DSL SoCs which utilize the
same piece of hardware as a watchdog, make it possible to select that
driver for those platforms.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112224636.395101-5-f.fainelli@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 14:03:01 +01:00
Florian Fainelli
d6b9c679bb
watchdog: bcm7038_wdt: Support platform data configuration
...
The BCM7038 watchdog driver needs to be able to obtain a specific clock
name on BCM63xx platforms which is the "periph" clock ticking at 50MHz.
make it possible to specify the clock name to obtain via platform data.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112224636.395101-4-f.fainelli@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 13:59:07 +01:00
Florian Fainelli
17fffe91ba
dt-bindings: watchdog: Add BCM6345 compatible to BCM7038 binding
...
The BCM7038 watchdog binding is updated to include a "brcm,bcm6345-wdt"
compatible string which is the first instance of a DSL (BCM63xx) SoC
seeing the integration of such a watchdog timer block.
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112224636.395101-3-f.fainelli@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 13:59:06 +01:00
Rafał Miłecki
9439c9fde8
dt-bindings: watchdog: convert Broadcom's WDT to the json-schema
...
This helps validating DTS files.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20211115055354.6089-1-zajec5@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 13:59:06 +01:00
Artem Lapkin
aeaacc064d
watchdog: meson_gxbb_wdt: remove stop_on_reboot
...
Remove watchdog_stop_on_reboot()
The Meson platform still has some hardware drivers problems for some
configurations which can freeze devices on shutdown/reboot.
Remove watchdog_stop_on_reboot() to catch this situation and ensure that
the reboot happens anyway. Users who still want to stop the watchdog on
reboot can still do so using the watchdog.stop_on_reboot=1 module
parameter.
https://lore.kernel.org/linux-watchdog/20210729072308.1908904-1-art@khadas.com/T/#t
Signed-off-by: Artem Lapkin <art@khadas.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211110022518.1676834-1-art@khadas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 13:59:06 +01:00
Luca Ceresoli
15ebdc43d7
watchdog: Kconfig: fix help text indentation
...
Some entries indent their help text with 1 tab + 1 space or 1 tab only
instead of 1 tab + 2 spaces. Add the missing spaces.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net >
Acked-by: Randy Dunlap <rdunlap@infradead.org >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211111225852.3128201-7-luca@lucaceresoli.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 13:59:05 +01:00
Jacky Bai
5c9348157b
dt-bindings: watchdog: imx7ulp-wdt: Add imx8ulp compatible string
...
The wdog on i.MX8ULP is derived from i.MX7ULP, it uses two compatible
strings, so update the compatible string for i.MX8ULP.
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com >
Acked-by: Rob Herring <robh@kernel.org >
Signed-off-by: Jacky Bai <ping.bai@nxp.com >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Guenter Roeck <linux@roeck-us.net >
Link: https://lore.kernel.org/r/20211112082930.3809351-7-peng.fan@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org >
2021-12-28 13:59:05 +01:00