]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
timer: tegra: Bind watchdog to timer node
authorLukasz Majewski <lukma@nabladev.com>
Thu, 18 Sep 2025 08:42:06 +0000 (10:42 +0200)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Tue, 28 Oct 2025 09:27:43 +0000 (11:27 +0200)
Bind watchdog driver to the Tegra timer node since it uses one of the
timers to act as a watchdog and has no dedicated hardware block.

Signed-off-by: Lukasz Majewski <lukma@nabladev.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
drivers/timer/tegra-timer.c

index 3545424889d24b9c45f5cf10c8e1b6c8f6bc06b1..778b65b60621daeef3eeb662499723e33aa4ffaa 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <dm.h>
+#include <dm/lists.h>
 #include <errno.h>
 #include <timer.h>
 
@@ -106,6 +107,14 @@ static int tegra_timer_probe(struct udevice *dev)
        return 0;
 }
 
+static int tegra_timer_bind(struct udevice *dev)
+{
+       if (CONFIG_IS_ENABLED(WDT_TEGRA))
+               return device_bind_driver_to_node(dev, "tegra_wdt", "tegra-wdt",
+                                                 dev_ofnode(dev), NULL);
+       return 0;
+}
+
 static const struct timer_ops tegra_timer_ops = {
        .get_count = tegra_timer_get_count,
 };
@@ -123,6 +132,7 @@ U_BOOT_DRIVER(tegra_timer) = {
        .name           = "tegra_timer",
        .id             = UCLASS_TIMER,
        .of_match       = tegra_timer_ids,
+       .bind           = tegra_timer_bind,
        .probe          = tegra_timer_probe,
        .ops            = &tegra_timer_ops,
        .flags          = DM_FLAG_PRE_RELOC,