Lines Matching +full:wdt +full:- +full:enable +full:- +full:once

1 // SPDX-License-Identifier: GPL-2.0-or-later
38 unsigned int enable; member
44 .enable = BIT(22),
50 .enable = BIT(19),
67 tc_reboot |= meson_wdt->data->enable; in meson_wdt_restart()
70 writel(tc_reboot, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_restart()
81 writel(0, meson_wdt->wdt_base + MESON_WDT_RESET); in meson_wdt_ping()
92 reg = readl(meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_change_timeout()
93 reg &= ~meson_wdt->data->terminal_count_mask; in meson_wdt_change_timeout()
94 reg |= MESON_SEC_TO_TC(timeout, meson_wdt->data->count_unit); in meson_wdt_change_timeout()
95 writel(reg, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_change_timeout()
101 wdt_dev->timeout = timeout; in meson_wdt_set_timeout()
114 reg = readl(meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_stop()
115 reg &= ~meson_wdt->data->enable; in meson_wdt_stop()
116 writel(reg, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_stop()
126 meson_wdt_change_timeout(wdt_dev, meson_wdt->wdt_dev.timeout); in meson_wdt_start()
129 reg = readl(meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_start()
130 reg |= meson_wdt->data->enable; in meson_wdt_start()
131 writel(reg, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_start()
153 { .compatible = "amlogic,meson6-wdt", .data = &meson6_wdt_data },
154 { .compatible = "amlogic,meson8-wdt", .data = &meson6_wdt_data },
155 { .compatible = "amlogic,meson8b-wdt", .data = &meson8b_wdt_data },
156 { .compatible = "amlogic,meson8m2-wdt", .data = &meson8b_wdt_data },
163 struct device *dev = &pdev->dev; in meson_wdt_probe()
169 return -ENOMEM; in meson_wdt_probe()
171 meson_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0); in meson_wdt_probe()
172 if (IS_ERR(meson_wdt->wdt_base)) in meson_wdt_probe()
173 return PTR_ERR(meson_wdt->wdt_base); in meson_wdt_probe()
175 meson_wdt->data = device_get_match_data(dev); in meson_wdt_probe()
177 meson_wdt->wdt_dev.parent = dev; in meson_wdt_probe()
178 meson_wdt->wdt_dev.info = &meson_wdt_info; in meson_wdt_probe()
179 meson_wdt->wdt_dev.ops = &meson_wdt_ops; in meson_wdt_probe()
180 meson_wdt->wdt_dev.max_timeout = in meson_wdt_probe()
181 meson_wdt->data->terminal_count_mask / meson_wdt->data->count_unit; in meson_wdt_probe()
182 meson_wdt->wdt_dev.min_timeout = MESON_WDT_MIN_TIMEOUT; in meson_wdt_probe()
183 meson_wdt->wdt_dev.timeout = min_t(unsigned int, in meson_wdt_probe()
185 meson_wdt->wdt_dev.max_timeout); in meson_wdt_probe()
187 watchdog_set_drvdata(&meson_wdt->wdt_dev, meson_wdt); in meson_wdt_probe()
189 watchdog_init_timeout(&meson_wdt->wdt_dev, timeout, dev); in meson_wdt_probe()
190 watchdog_set_nowayout(&meson_wdt->wdt_dev, nowayout); in meson_wdt_probe()
191 watchdog_set_restart_priority(&meson_wdt->wdt_dev, 128); in meson_wdt_probe()
193 meson_wdt_stop(&meson_wdt->wdt_dev); in meson_wdt_probe()
195 watchdog_stop_on_reboot(&meson_wdt->wdt_dev); in meson_wdt_probe()
196 err = devm_watchdog_register_device(dev, &meson_wdt->wdt_dev); in meson_wdt_probe()
201 meson_wdt->wdt_dev.timeout, nowayout); in meson_wdt_probe()
221 "Watchdog cannot be stopped once started (default="