// SPDX-License-Identifier: GPL-2.0-or-later /* * mpc8xxx_wdt.c - MPC8xx/MPC83xx/MPC86xx watchdog userspace interface * * Authors: Dave Updegraff <dave@cray.org> * Kumar Gala <galak@kernel.crashing.org> * Attribution: from 83xx_wst: Florian Schirmer <jolt@tuxbox.org> * ..and from sc520_wdt * Copyright (c) 2008 MontaVista Software, Inc. * Anton Vorontsov <avorontsov@ru.mvista.com> * * Note: it appears that you can only actually ENABLE or DISABLE the thing * once after POR. Once enabled, you cannot disable, and vice versa.
*/
wdt_type = of_device_get_match_data(dev); if (!wdt_type) return -EINVAL;
if (!freq || freq == -1) return -EINVAL;
ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); if (!ddata) return -ENOMEM;
ddata->base = devm_platform_ioremap_resource(ofdev, 0); if (IS_ERR(ddata->base)) return PTR_ERR(ddata->base);
enabled = in_be32(&ddata->base->swcrr) & SWCRR_SWEN; if (!enabled && wdt_type->hw_enabled) {
dev_info(dev, "could not be enabled in software\n"); return -ENODEV;
}
res = platform_get_resource(ofdev, IORESOURCE_MEM, 1); if (res) { bool status;
u32 __iomem *rsr = ioremap(res->start, resource_size(res));
if (!rsr) return -ENOMEM;
status = in_be32(rsr) & wdt_type->rsr_mask;
ddata->wdd.bootstatus = status ? WDIOF_CARDRESET : 0; /* clear reset status bits related to watchdog timer */
out_be32(rsr, wdt_type->rsr_mask);
iounmap(rsr);
dev_info(dev, "Last boot was %scaused by watchdog\n",
status ? "" : "not ");
}
/* * If the watchdog was previously enabled or we're running on * MPC8xxx, we should ping the wdt from the kernel until the * userspace handles it.
*/ if (enabled)
mpc8xxx_wdt_start(&ddata->wdd);
MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
MODULE_DESCRIPTION("Driver for watchdog timer in MPC8xx/MPC83xx/MPC86xx " "uProcessors");
MODULE_LICENSE("GPL");
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.