aboutsummaryrefslogtreecommitdiff
path: root/drivers/watchdog
AgeCommit message (Collapse)Author
2023-01-20watchdog: Clean up defaults for imx_watchdog / ulp_wdogTom Rini
In imx_watchdog, clean up the comment to just note the range now, as we do not need to set the default here as Kconfig does this for us. For ulp_wdog, set the default value via Kconfig instead. Cc: Stefan Roese <sr@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-12-23global: Migrate CONFIG_DW_WDT_CLOCK_KHZ to CFGTom Rini
Perform a simple rename of CONFIG_DW_WDT_CLOCK_KHZ to CFG_DW_WDT_CLOCK_KHZ Signed-off-by: Tom Rini <trini@konsulko.com>
2022-11-22watchdog: Drop GD_FLG_WDT_READY as it's not used any moreStefan Roese
Since commit c2fd0ca1a822 ("watchdog: Integrate watchdog triggering into the cyclic framework") GD_FLG_WDT_READY has become write-only. This patch now removes this flag completely. The vacant spot in gd_flags is filled with the newly introduced GD_FLG_CYCLIC_RUNNING flag. Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Stefan Roese <sr@denx.de>
2022-11-22watchdog: designware: make reset really optionalQuentin Schulz
Checking for DM_RESET is not enough since not all watchdog implementations use a reset lane. Such is the case for Rockchip implementation for example. Since reset_assert_bulk will only succeed if the resets property exists in the watchdog DT node, it needs to be called only if a reset property is present. This adds a condition on the resets property presence in the watchdog DT node before assuming a reset lane needs to be fetched with reset_assert_bulk, by calling ofnode_read_prop. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2022-10-31arm: bcmbca: replace ARCH_BCM6753 symbols in Kconfig with BCM6855William Zhang
As CONFIG_ARCH_BCM6753 is replaced with CONFIG_BCM6855, update the driver Kconfig to use the new config symbol. Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-10-31arm: bcmbca: replace ARCH_BCM6858 symbols in Kconfig with BCM6858William Zhang
As CONFIG_ARCH_BCM6858 is replaced with CONFIG_BCM6858, update the driver Kconfig to use the new config symbol. Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-10-31arm: bcmbca: replace ARCH_BCM68360 symbols in Kconfig with BCM6856William Zhang
As CONFIG_ARCH_BCM68360 is replaced with CONFIG_BCM6856, update the driver Kconfig to use the new config symbol. Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-10-31arm: bcmbca: replace ARCH_BCM63158 symbols in Kconfig with BCM63158William Zhang
As CONFIG_ARCH_BCM63158 is replaced with CONFIG_BCM63158, update the Kconfig to use the new config symbol. Signed-off-by: William Zhang <william.zhang@broadcom.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-10-24watchdog: ulp_wdog: add driver model for ulp watchdog driverAlice Guo
Enable driver model for ulp watchdog timer. When CONFIG_WDT=y and the status of device node is "okay", initr_watchdog will be called and finally calls ulp_wdt_probe() and ulp_wdt_start(). Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-10-24watchdog: ulp_wdog: enable watchdog interrupt on imx93Alice Guo
The reset source of the external PMIC on i.MX93 is WDOG_ANY PAD and the source of WDOG_ANY PAD is interrupt. Therefore, using PMIC to reset needs to enable the watchdog interrupt. Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-10-24watchdog: ulp_wdog: Update watchdog driver for imx93Alice Guo
The WDOG clocks are sourced from the fixed 32KHz (lpo_clk).When the timeout period exceeds 2 seconds, the value written to the TOVAL register is larger than 16-bit can represent. Enabling watchdog prescaler to solve this problem. Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-10-24ulp_wdog: Update ulp wdog driver for 32bits commandYe Li
To use 32bits refresh and unlock command as default, check the CMD32EN bit to select the corresponding commands. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-10-24sandbox: add SIGALRM-based watchdog deviceRasmus Villemoes
In order to test that U-Boot actually maintains the watchdog device(s) during long-running busy-loops, such as those where we wait for the user to stop autoboot, we need a watchdog device that actually does something during those loops; we cannot test that behaviour via the DM test framework. So introduce a relatively simple watchdog device which is simply based on calling the host OS' alarm() function; that has the nice property that a new call to alarm() simply sets a new deadline, and alarm(0) cancels any existing alarm. These properties are precisely what we need to implement start/reset/stop. We install our own handler so that we get a known message printed if and when the watchdog fires, and by just invoking that handler directly, we get expire_now for free. The actual calls to the various OS functions (alarm, signal, raise) need to be done in os.c, and since the driver code cannot get access to the values of SIGALRM or SIG_DFL (that would require including a host header, and that's only os.c which can do that), we cannot simply do trivial wrappers for signal() and raise(), but instead create specialized functions just for use by this driver. Apart from enabling this driver for sandbox{,64}_defconfig, also enable the wdt command which was useful for hand-testing this new driver (especially with running u-boot under strace). Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2022-10-24watchdog: introduce a u-boot,autostart propertyRasmus Villemoes
This is a companion to u-boot,noautostart. If one has a single watchdog device that one does want to have auto-started, but several others that one doesn't, the only way currently is to set the CONFIG_WATCHDOG_AUTOSTART and then use the opt-out for the majority. The main motivation for this is to add an autostarted watchdog device to the sandbox (to test a fix) without having to set AUTOSTART in sandbox_defconfig and add the noautostart property to the existing devices. But it's also nice for symmetry, and the logic in init_watchdog_dev() becomes simpler to read because we avoid all the negations. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2022-10-24wdt: nuvoton: add expire function for generic resetJim Liu
Add expire_now function for generic sysreset request Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-10-18watchdog: omap_wdt: Switch required include for watchdog definesTom Rini
All of the required values for using the omap_wdt.c driver are found in <asm/ti-common/omap_wdt.h> and this is what is indirectly pulled in via <asm/arch/hardware.h> when it exists. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-10-03Merge branch 'next'Tom Rini
2022-09-27watchdog: max6370: use __udelay() to avoid recursionPali Rohár
The udelay() function in lib/time.c contains a WATCHDOG_RESET() call. So use __udelay() in max6370_wdt.c to prevent recursion. Fixes: 0a095fc53b15 ("watchdog: Add MAX6370 watchdog timer driver") Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-09-27watchdog: gpio_wdt: use __udelay() to avoid recursionRasmus Villemoes
The udelay() function in lib/time.c contains a WATCHDOG_RESET() call. The only reason this doesn't lead to a catastrophic infinite recursion is due to the rate-limiting in wdt-uclass.c: if (time_after_eq(now, priv->next_reset)) { priv->next_reset = now + priv->reset_period; wdt_reset(dev); } But this would fall apart if ->next_reset was updated after calling the device's reset method. This is needlessly fragile, and it's easy enough to avoid that recursion in the first place by just using __udelay() directly. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de>
2022-09-23watchdog: mediatek: add support for MediaTek MT7986 SoCWeijie Gao
Add watchdog support for MediaTek MT7986 SoC Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2022-09-18watchdog: Integrate watchdog triggering into the cyclic frameworkStefan Roese
This patch integrates the watchdog triggering into the recently added cyclic infrastructure. Each watchdog device that shall be triggered registers it's own cyclic function. This way, multiple watchdog devices are still supported, each via a cyclic function with separate trigger intervals. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
2022-07-22Merge https://source.denx.de/u-boot/custodians/u-boot-watchdogTom Rini
- octeontx_wdt: Add MIPS Octeon support (Stefan) - watchdog: add amlogic watchdog support (Philippe) - watchdog: add pulse support to gpio watchdog driver (Paul)
2022-07-21treewide: Fix Marek's name and change my e-mail addressMarek Behún
Fix diacritics in some instances of my name and change my e-mail address to kabel@kernel.org. Add corresponding .mailmap entries. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-07-21watchdog: add pulse support to gpio watchdog driverPaul Doelle
A common external watchdog circuit is kept alive by triggering a short pulse on the reset pin. This patch adds support for this use case, while making the algorithm configurable in the devicetree. The "linux,wdt-gpio" driver being modified is based off the equivalent driver in the Linux kernel, which provides support for this algorithm. This patch brings parity to this driver, and is kept aligned with the functionality and devicetree configuration in the kernel. It should be noted that this adds a required property named 'hw_algo' to the devicetree binding, following suit with the kernel. I'm happy to make this backward-compatible if preferred. Signed-off-by: Paul Doelle <paaull.git@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-07-21watchdog: add amlogic watchdog supportPhilippe Boos
Add support for hardware watchdog timer for Amlogic SoCs. This driver has been heavily inspired by his Linux equivalent (meson_gxbb_wdt.c). Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Philippe Boos <pboos@baylibre.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-07-21watchdog: octeontx_wdt: Add MIPS Octeon supportStefan Roese
This patch adds support for the Marvell Octeon watchdog driver, which currently only support the ARM64 Octeon TX & TX2 platforms. Since the IP is pretty similar, it makes sense to extend this driver to also support the MIPS Octeon SoC. A follow-up patch will enable this watchdog support on the EBB7304 eval board. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Aaron Williams <awilliams@marvell.com> Cc: Chandrakala Chavva <cchavva@marvell.com>
2022-07-13watchdog: add support for MediaTek MT7621 SoCWeijie Gao
This patch makes mt7621_wdt driver available for MediaTek MT7621 SoC Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2022-07-05watchdog: designware: Make this depend on WDTTom Rini
As this driver can dynamically determine the values set in CONFIG_DW_WDT_BASE when using WDT, so make this depend on WDT rather than migrate CONFIG_DW_WDT_BASE to Kconfig. Cc: Chee Tien Fong <tien.fong.chee@intel.com> Cc: Chin-Liang See <chin.liang.see@intel.com> Cc: Dinh Nguyen <dinh.nguyen@intel.com> Cc: Holger Brunck <holger.brunck@hitachienergy.com> Cc: Ley Foon Tan <ley.foon.tan@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Siew Chin Lim <elly.siew.chin.lim@intel.com> Cc: Stefan Roese <sr@denx.de> Cc: hee Hong Ang <chee.hong.ang@intel.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-05-06watchdog: Add MAX6370 watchdog timer driverPali Rohár
MAX6370 watchdog is available e.g. on Freescale P1/P2 RDB-PC boards. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-25nds32: Remove the architectureTom Rini
As removal of nds32 has been ack'd for the Linux kernel, remove support here as well. Cc: Rick Chen <rick@andestech.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Rick Chen <rick@andestech.com>
2022-04-22wdt: nuvoton: Add support for NuvotonJim Liu
Add watchdog controller driver for NPCM7xx/npcm8xx the wdt design of npcm750 and npcm845 is the same. so the driver can work on npcm750 and npcm845. about npcm845 wdt dtsi i will followed kernel dts name to use nuvoton,npcm750-wdt. Signed-off-by: Jim Liu <JJLIU0@nuvoton.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-03-14Merge tag 'v2022.04-rc4' into nextTom Rini
Prepare v2022.04-rc4
2022-03-08watchdog: rti_wdt: Add 10% safety margin to clock frequencyJan Kiszka
When running against RC_OSC_32k, the watchdog may suffer from running faster than expected, expiring earlier. The Linux kernel adds a 10% margin to the timeout calculation by slowing down the read clock rate accordingly. Do the same here, also to have comparable preset values for both drivers. Along this, fix the name of the local var holding to frequency - in Hz, not kHz. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Roese <sr@denx.de>
2022-03-08watchdog: armada_37xx: Probe driver also when watchdog is already runningPali Rohár
If Armada 37xx watchdog is started before U-Boot then CNTR_CTRL_ACTIVE bit is set, U-Boot armada-37xx-wdt.c driver fails to initialize and so U-Boot is unable to use or kick this watchdog. Do not check for CNTR_CTRL_ACTIVE bit and always initialize watchdog. Same behavior is implemented in Linux kernel driver. This change allows to activate watchdog in firmware which loads U-Boot. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-08drivers: watchdog: wdt-uclass.c: add a property u-boot, noautostartPhilippe Reynes
Since commit 492ee6b8d0e7 ("watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()"), all the watchdog are started when the config WATCHDOG_AUTOSTART. To avoid a binary choice none/all, a property u-boot,noautostart may be added in the watchdog node of the u-boot device tree to not autostart this watchdog. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-07watchdog: bcm6345: allow to use this driver on arm bcm6753Philippe Reynes
This IP is also used on some arm SoC, so we allow to use it on arm bcm6753 too. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-02-28watchdog: add sl28cpld watchdog driverMichael Walle
The watchdog timer is part of the sl28cpld management controller. The watchdog timer usually supervises the bootloader boot-up and if it bites the failsafe bootloader will be activated. Apart from that it supports the usual board level reset and one SMARC speciality: driving the WDT_TIMEOUT# signal. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2022-02-17watchdog: armada_37xx: Convert to official DT bindingsPali Rohár
Official DT bindings have only one reg property: watchdog address space. Convert armada-37xx-wdt.c driver to offical DT bindings and access sel_reg register via MVEBU_REGISTER() macro, as its value (required by U-Boot driver) is not in DT yet. In later stage can be driver cleaned to not use it. This change would allow U-Boot to use A3720 watchdog DTS structure from Linux kernel. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-13watchdog: Add a driver for the Apple watchdogMark Kettenis
This driver supports the watchdog timer found on Apple's M1 SoC. On systems that use these SoC, the watchdog timer is the primary way to reboot the system. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Sven Peter <sven@svenpeter.dev> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-on: Apple M1 Macbook Tested-by: Simon Glass <sjg@chromium.org>
2021-11-13sandbox: fix sandbox_wdt_expire_now()Heinrich Schuchardt
With CONFIG_SYSRESET_WATCHDOG=y the sandbox can use a watchdog based system reset. To make this work calling sandbox_wdt_expire_now() must lead to a reset. With this change we can test the development suggested in [PATCH 0/4] Improved sysreset/watchdog uclass integration https://lists.denx.de/pipermail/u-boot/2021-August/458656.html Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-11-11Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
- device-tree sync-up with Linux for ls1028a - fixes/update in fsl-ddr driver, fsl-validate, lx2162a, fsl-mc, spintable code, configs, qspi node, pci - enable EFI_SET_TIME support in sl28 - powerpc: Drop -mstring
2021-11-10watchdog: don't autostart watchdog on Sunxi boardsHeinrich Schuchardt
The Sunxi boards only support a 16 second watchdog timeout. This is too short to boot Linux. The UEFI specification requires 300 seconds as default timeout. Change the default for CONFIG_WATCHDOG_AUTOSTART for ARCH_SUNXI. Fixes: b147bd3607f8 ("sunxi: Enable watchdog timer support by default") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Tested-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-11-09watchdog: sp805_wdt: use correct compatible stringMichael Walle
According to the linux device tree specification the compatible string is: compatible = "arm,sp805", "arm,primecell"; Fix all users in u-boot. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-11-04watchdog: Automatically register device with sysresetSamuel Holland
Add an option to automatically register watchdog devices with the wdt_reboot driver for use with sysreset. This allows sysreset to be a drop-in replacement for platform-specific watchdog reset code, without needing any device tree changes. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-10-25watchdog: Add a driver for the sunxi watchdogSamuel Holland
This driver supports the sun4i/sun6i/sun20i watchdog timers. They have a maximum timeout of 16 seconds. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-10-03watchdog: rti_wdt: Add support for loading firmwareJan Kiszka
To avoid the need of extra boot scripting on AM65x for loading a watchdog firmware, add the required rproc init and loading logic for the first R5F core to the watchdog start handler. In case the R5F cluster is in lock-step mode, also initialize the second core. The firmware itself is embedded into U-Boot binary to ease access to it and ensure it is properly hashed in case of secure boot. One possible firmware source is https://github.com/siemens/k3-rti-wdt. The board is responsible for providing the firmware as additional loadable via the U-Boot fit image. The driver will pick up its location from /fit-images/k3-rti-wdt-firmware then. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2021-10-01arm: Remove zmx25 board and ARCH_MX25Tom Rini
This board has not been converted to CONFIG_DM by the deadline. Remove it. As this is the last ARCH_MX25 platform, remove those references as well. Cc: Matthias Weisser <weisserm@arcor.de> Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-30Merge tag 'xilinx-for-v2022.01-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2022.01-rc1 zynq: - Enable capsule update for qspi and mmc - Update zed DT qspi compatible string zynqmp: - Add missing modeboot for EMMC - Add missing nand DT properties - List all eeproms for SC on vck190 - Add vck190 SC psu_init clk: - Handle only GATE type clock for Versal watchdog: - Update versal driver to handle system reset
2021-09-30WS cleanup: remove SPACE(s) followed by TABWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2021-09-30watchdog: versal: Add support for expire nowAshok Reddy Soma
Wdt expire command makes the wdt to count least possible ticks(1) and expires immediately. Add expire_now option to the xlnx_wwdt_ops and implement it by calling xlnx_wwdt_start() with minimum possible count(1). Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Link: https://lore.kernel.org/r/1632808919-8600-3-git-send-email-ashok.reddy.soma@xilinx.com Signed-off-by: Michal Simek <michal.simek@xilinx.com>