All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] timer: tegra: Bind watchdog driver when timer node is processed
@ 2025-08-26  9:39 Lukasz Majewski
  2025-08-26  9:39 ` [PATCH 2/2] watchdog: Add implementation of NVIDIA's Tegra 30 watchdog driver Lukasz Majewski
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Lukasz Majewski @ 2025-08-26  9:39 UTC (permalink / raw)
  To: Thierry Reding, Svyatoslav Ryhel; +Cc: Tom Rini, u-boot, Lukasz Majewski

The Tegra30 SoC is a bit special, as it doesn't have the separate IP block
to provide watchdog functionality.

Instead, timer IP block allows such functionality when properly configured.

As in the tegra30.dtsi there is a timer node, which "covers" all timers,
with 'nvidia,tegra30-timer' compatibility it was necessary to manually
bind U-Boot's WDT driver (based on WDT_UCLASS).

Signed-off-by: Lukasz Majewski <lukma@nabladev.com>
---
 drivers/timer/tegra-timer.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/timer/tegra-timer.c b/drivers/timer/tegra-timer.c
index 3545424889d..361539efa43 100644
--- a/drivers/timer/tegra-timer.c
+++ b/drivers/timer/tegra-timer.c
@@ -11,6 +11,8 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
 
+#include <dm/lists.h>
+
 #define TEGRA_OSC_CLK_ENB_L_SET		(NV_PA_CLK_RST_BASE + 0x320)
 #define TEGRA_OSC_SET_CLK_ENB_TMR	BIT(5)
 
@@ -106,6 +108,21 @@ static int tegra_timer_probe(struct udevice *dev)
 	return 0;
 }
 
+static int tegra_timer_bind(struct udevice *dev)
+{
+	/*
+	 * In Tegra 30 SoC the Watchdog is accomplished
+	 * by the timer IP block (timer5).
+	 */
+	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,
 };
@@ -124,6 +141,7 @@ U_BOOT_DRIVER(tegra_timer) = {
 	.id		= UCLASS_TIMER,
 	.of_match	= tegra_timer_ids,
 	.probe		= tegra_timer_probe,
+	.bind		= tegra_timer_bind,
 	.ops		= &tegra_timer_ops,
 	.flags		= DM_FLAG_PRE_RELOC,
 };
-- 
2.39.5


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

end of thread, other threads:[~2025-09-17 14:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26  9:39 [PATCH 1/2] timer: tegra: Bind watchdog driver when timer node is processed Lukasz Majewski
2025-08-26  9:39 ` [PATCH 2/2] watchdog: Add implementation of NVIDIA's Tegra 30 watchdog driver Lukasz Majewski
2025-09-17 14:01   ` Svyatoslav Ryhel
2025-08-26 10:10 ` [PATCH 1/2] timer: tegra: Bind watchdog driver when timer node is processed Svyatoslav Ryhel
2025-09-08 12:41   ` Łukasz Majewski
2025-09-08 13:55     ` Svyatoslav Ryhel
2025-09-09 10:15       ` Łukasz Majewski
2025-09-09 11:26         ` Svyatoslav Ryhel
2025-09-09 15:39           ` Tom Rini
2025-09-09 15:44             ` Svyatoslav Ryhel
2025-09-09 15:47               ` Tom Rini
2025-09-09 16:08                 ` Svyatoslav Ryhel
2025-09-10  8:51                   ` Francesco Dolcini
2025-09-10 12:28                     ` Łukasz Majewski
2025-09-10 14:07                       ` Francesco Dolcini
2025-09-11  6:46                         ` Łukasz Majewski
2025-09-10  6:52                 ` Łukasz Majewski
2025-09-17 12:46 ` Łukasz Majewski
2025-09-17 13:40   ` Svyatoslav Ryhel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.