Lines Matching +full:bcm2835 +full:- +full:pm
1 // SPDX-License-Identifier: GPL-2.0+
3 * Watchdog driver for Broadcom BCM2835
6 * branch "rpi-3.6.y" of git://github.com/raspberrypi/linux.git was used
7 * as a hardware reference for the Broadcom BCM2835 watchdog timer.
15 #include <linux/mfd/bcm2835-pm.h>
61 cur = readl(wdt->base + PM_RSTC); in bcm2835_wdt_is_running()
72 spin_lock_irqsave(&wdt->lock, flags); in bcm2835_wdt_start()
74 writel_relaxed(PM_PASSWORD | (SECS_TO_WDOG_TICKS(wdog->timeout) & in bcm2835_wdt_start()
75 PM_WDOG_TIME_SET), wdt->base + PM_WDOG); in bcm2835_wdt_start()
76 cur = readl_relaxed(wdt->base + PM_RSTC); in bcm2835_wdt_start()
78 PM_RSTC_WRCFG_FULL_RESET, wdt->base + PM_RSTC); in bcm2835_wdt_start()
80 spin_unlock_irqrestore(&wdt->lock, flags); in bcm2835_wdt_start()
89 writel_relaxed(PM_PASSWORD | PM_RSTC_RESET, wdt->base + PM_RSTC); in bcm2835_wdt_stop()
97 uint32_t ret = readl_relaxed(wdt->base + PM_WDOG); in bcm2835_wdt_get_timeleft()
106 writel_relaxed(10 | PM_PASSWORD, wdt->base + PM_WDOG); in __bcm2835_restart()
107 val = readl_relaxed(wdt->base + PM_RSTC); in __bcm2835_restart()
110 writel_relaxed(val, wdt->base + PM_RSTC); in __bcm2835_restart()
137 .identity = "Broadcom BCM2835 Watchdog timer",
163 val = readl_relaxed(wdt->base + PM_RSTS); in bcm2835_power_off()
165 writel_relaxed(val, wdt->base + PM_RSTS); in bcm2835_power_off()
173 struct bcm2835_pm *pm = dev_get_drvdata(pdev->dev.parent); in bcm2835_wdt_probe() local
174 struct device *dev = &pdev->dev; in bcm2835_wdt_probe()
180 return -ENOMEM; in bcm2835_wdt_probe()
182 spin_lock_init(&wdt->lock); in bcm2835_wdt_probe()
184 wdt->base = pm->base; in bcm2835_wdt_probe()
209 if (of_device_is_system_power_controller(pdev->dev.parent->of_node)) { in bcm2835_wdt_probe()
218 dev_info(dev, "Broadcom BCM2835 watchdog timer"); in bcm2835_wdt_probe()
232 .name = "bcm2835-wdt",
244 MODULE_ALIAS("platform:bcm2835-wdt");
246 MODULE_DESCRIPTION("Driver for Broadcom BCM2835 watchdog timer");