Lines Matching +full:tegra30 +full:- +full:timer
1 // SPDX-License-Identifier: GPL-2.0
19 * Base of the WDT registers, from the timer base address. There are
21 * timer), at bases 0x100 + (WDT ID) * 0x20, where WDT ID is 0 through 4.
28 * Register base of the timer that's selected for pairing with the watchdog.
29 * This driver arbitrarily uses timer 5, which is currently unused by
31 * needs to change, take care that the new timer is not used by the
54 /* Timer registers */
91 writel(val, wdt->tmr_regs + TIMER_PTV); in tegra_wdt_start()
101 (wdd->timeout << WDT_CFG_PERIOD_SHIFT) | in tegra_wdt_start()
103 writel(val, wdt->wdt_regs + WDT_CFG); in tegra_wdt_start()
105 writel(WDT_CMD_START_COUNTER, wdt->wdt_regs + WDT_CMD); in tegra_wdt_start()
114 writel(WDT_UNLOCK_PATTERN, wdt->wdt_regs + WDT_UNLOCK); in tegra_wdt_stop()
115 writel(WDT_CMD_DISABLE_COUNTER, wdt->wdt_regs + WDT_CMD); in tegra_wdt_stop()
116 writel(0, wdt->tmr_regs + TIMER_PTV); in tegra_wdt_stop()
125 writel(WDT_CMD_START_COUNTER, wdt->wdt_regs + WDT_CMD); in tegra_wdt_ping()
133 wdd->timeout = timeout; in tegra_wdt_set_timeout()
150 val = readl(wdt->wdt_regs + WDT_STS); in tegra_wdt_get_timeleft()
162 return (((3 - exp) * wdd->timeout) + count) / 4; in tegra_wdt_get_timeleft()
184 struct device *dev = &pdev->dev; in tegra_wdt_probe()
190 /* This is the timer base. */ in tegra_wdt_probe()
201 return -ENOMEM; in tegra_wdt_probe()
204 wdt->wdt_regs = regs + WDT_BASE; in tegra_wdt_probe()
205 wdt->tmr_regs = regs + WDT_TIMER_BASE; in tegra_wdt_probe()
208 wdd = &wdt->wdd; in tegra_wdt_probe()
209 wdd->timeout = heartbeat; in tegra_wdt_probe()
210 wdd->info = &tegra_wdt_info; in tegra_wdt_probe()
211 wdd->ops = &tegra_wdt_ops; in tegra_wdt_probe()
212 wdd->min_timeout = MIN_WDT_TIMEOUT; in tegra_wdt_probe()
213 wdd->max_timeout = MAX_WDT_TIMEOUT; in tegra_wdt_probe()
214 wdd->parent = dev; in tegra_wdt_probe()
237 if (watchdog_active(&wdt->wdd)) in tegra_wdt_suspend()
238 tegra_wdt_stop(&wdt->wdd); in tegra_wdt_suspend()
247 if (watchdog_active(&wdt->wdd)) in tegra_wdt_resume()
248 tegra_wdt_start(&wdt->wdd); in tegra_wdt_resume()
254 { .compatible = "nvidia,tegra30-timer", },
265 .name = "tegra-wdt",