linux/drivers/watchdog/bcm2835_wdt.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Watchdog driver for Broadcom BCM2835
 *
 * "bcm2708_wdog" driver written by Luke Diamand that was obtained from
 * branch "rpi-3.6.y" of git://github.com/raspberrypi/linux.git was used
 * as a hardware reference for the Broadcom BCM2835 watchdog timer.
 *
 * Copyright (C) 2013 Lubomir Rintel <[email protected]>
 *
 */

#include <linux/delay.h>
#include <linux/types.h>
#include <linux/mfd/bcm2835-pm.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/watchdog.h>
#include <linux/platform_device.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>

#define PM_RSTC
#define PM_RSTS
#define PM_WDOG

#define PM_PASSWORD

#define PM_WDOG_TIME_SET
#define PM_RSTC_WRCFG_CLR
#define PM_RSTS_HADWRH_SET
#define PM_RSTC_WRCFG_SET
#define PM_RSTC_WRCFG_FULL_RESET
#define PM_RSTC_RESET

/*
 * The Raspberry Pi firmware uses the RSTS register to know which partition
 * to boot from. The partition value is spread into bits 0, 2, 4, 6, 8, 10.
 * Partition 63 is a special partition used by the firmware to indicate halt.
 */
#define PM_RSTS_RASPBERRYPI_HALT

#define SECS_TO_WDOG_TICKS(x)
#define WDOG_TICKS_TO_SECS(x)
#define WDOG_TICKS_TO_MSECS(x)

struct bcm2835_wdt {};

static struct bcm2835_wdt *bcm2835_power_off_wdt;

static unsigned int heartbeat;
static bool nowayout = WATCHDOG_NOWAYOUT;

static bool bcm2835_wdt_is_running(struct bcm2835_wdt *wdt)
{}

static int bcm2835_wdt_start(struct watchdog_device *wdog)
{}

static int bcm2835_wdt_stop(struct watchdog_device *wdog)
{}

static unsigned int bcm2835_wdt_get_timeleft(struct watchdog_device *wdog)
{}

static void __bcm2835_restart(struct bcm2835_wdt *wdt)
{}

static int bcm2835_restart(struct watchdog_device *wdog,
			   unsigned long action, void *data)
{}

static const struct watchdog_ops bcm2835_wdt_ops =;

static const struct watchdog_info bcm2835_wdt_info =;

static struct watchdog_device bcm2835_wdt_wdd =;

/*
 * We can't really power off, but if we do the normal reset scheme, and
 * indicate to bootcode.bin not to reboot, then most of the chip will be
 * powered off.
 */
static void bcm2835_power_off(void)
{}

static int bcm2835_wdt_probe(struct platform_device *pdev)
{}

static void bcm2835_wdt_remove(struct platform_device *pdev)
{}

static struct platform_driver bcm2835_wdt_driver =;
module_platform_driver();

module_param(heartbeat, uint, 0);
MODULE_PARM_DESC();

module_param(nowayout, bool, 0);
MODULE_PARM_DESC();

MODULE_ALIAS();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();