timer: tegra: Bind watchdog driver when timer node is processed
Subsystems (2)
PATCH v2 1/2 timer: tegra: Bind watchdog driver when timer node is processed
The Tegra 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.
This patch manually binds U-Boot's WDT driver (based on WDT_UCLASS).
---
Changes for v2:
- Replace "Tegra T30" with just "Tegra" in comment as all Tegra SoCs are using the same programming paradign
- Update the commit message
--- drivers/timer/tegra-timer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/timer/tegra-timer.c +18 -0
@@ -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 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, };
Signature · 1 line
2.39.5
PATCH v2 2/2 watchdog: Add implementation of NVIDIA's Tegra watchdog driver
This commit provides support for Tegra watchdog functionality. The WATCHDOG index 0 in conjunction with TIMER 5 has been used. as the same setup is used in the Linux kernel driver.
---
Changes for v2:
- Remove () from defines and use hex lower case numbers
- Move check for timeout range validity before first register write
- Remove "nvidia,tegra30-timer" device compatibility check
--- drivers/watchdog/Kconfig | 7 +++ drivers/watchdog/Makefile | 1 + drivers/watchdog/tegra_wdt.c | 118 +++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 drivers/watchdog/tegra_wdt.c
drivers/watchdog/Kconfig +7 -0
@@ -454,6 +454,13 @@ config WDT_TANGIER Intel Tangier SoC. If you're using a board with Intel Tangier SoC, say Y here. +config WDT_TEGRA + bool "Tegra watchdog" + depends on WDT && ARCH_TEGRA + help + Select this to enable support for the watchdog timer + embedded in NVIDIA Tegra SoCs. + config WDT_ARM_SMC bool "ARM SMC watchdog timer support" depends on WDT && ARM_SMCCC
drivers/watchdog/Makefile +1 -0
@@ -53,6 +53,7 @@ obj-$(CONFIG_WDT_STARFIVE) += starfive_wdt.o obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o obj-$(CONFIG_WDT_SUNXI) += sunxi_wdt.o obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o +obj-$(CONFIG_WDT_TEGRA) += tegra_wdt.o obj-$(CONFIG_WDT_XILINX) += xilinx_wwdt.o obj-$(CONFIG_WDT_ADI) += adi_wdt.o obj-$(CONFIG_WDT_QCOM) += qcom-wdt.o
drivers/watchdog/tegra_wdt.c new file +118 -0
118 lines not on this page · raw message
Signature · 1 line
2.39.5
Re: [PATCH v2 2/2] watchdog: Add implementation of NVIDIA's Tegra watchdog driver
чт, 18 вер. 2025 р. о 11:44 Lukasz Majewski <[email protected]> пише:
Quoted 11 lines
This commit provides support for Tegra watchdog functionality. The WATCHDOG index 0 in conjunction with TIMER 5 has been used. as the same setup is used in the Linux kernel driver.
Signed-off-by Lukasz Majewski <[email protected]>---
Changes for v2:
- Remove () from defines and use hex lower case numbers
- Move check for timeout range validity before first register write
- Remove "nvidia,tegra30-timer" device compatibility check
Quoted 7 lines
--- drivers/watchdog/Kconfig | 7 +++ drivers/watchdog/Makefile | 1 + drivers/watchdog/tegra_wdt.c | 118 +++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 drivers/watchdog/tegra_wdt.c
With minor adjustments applied to u-boot-tegra/staging, thank you!
Additional modification to colibri_t30_defconfig would not be needed.
чт, 18 вер. 2025 р. о 11:44 Lukasz Majewski <[email protected]> пише:
Quoted 11 lines
The Tegra 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.
This patch manually binds U-Boot's WDT driver (based on
WDT_UCLASS).Signed-off-by Lukasz Majewski <[email protected]>---
Quoted 8 lines
Changes for v2:
- Replace "Tegra T30" with just "Tegra" in comment as all Tegra SoCs are using the same programming paradign
- Update the commit message--- drivers/timer/tegra-timer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
With minor adjustments applied to u-boot-tegra/staging, thank you!