linux/drivers/watchdog/i6300esb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	i6300esb:	Watchdog timer driver for Intel 6300ESB chipset
 *
 *	(c) Copyright 2004 Google Inc.
 *	(c) Copyright 2005 David Härdeman <[email protected]>
 *
 *	based on i810-tco.c which is in turn based on softdog.c
 *
 *	The timer is implemented in the following I/O controller hubs:
 *	(See the intel documentation on http://developer.intel.com.)
 *	6300ESB chip : document number 300641-004
 *
 *  2004YYZZ Ross Biro
 *	Initial version 0.01
 *  2004YYZZ Ross Biro
 *	Version 0.02
 *  20050210 David Härdeman <[email protected]>
 *	Ported driver to kernel 2.6
 *  20171016 Radu Rendec <[email protected]>
 *	Change driver to use the watchdog subsystem
 *	Add support for multiple 6300ESB devices
 */

/*
 *      Includes, defines, variables, module parameters, ...
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/uaccess.h>
#include <linux/io.h>

/* Module and version information */
#define ESB_MODULE_NAME

/* PCI configuration registers */
#define ESB_CONFIG_REG
#define ESB_LOCK_REG

/* Memory mapped registers */
#define ESB_TIMER1_REG(w)
#define ESB_TIMER2_REG(w)
#define ESB_GINTSR_REG(w)
#define ESB_RELOAD_REG(w)

/* Lock register bits */
#define ESB_WDT_FUNC
#define ESB_WDT_ENABLE
#define ESB_WDT_LOCK

/* Config register bits */
#define ESB_WDT_REBOOT
#define ESB_WDT_FREQ
#define ESB_WDT_INTTYPE

/* Reload register bits */
#define ESB_WDT_TIMEOUT
#define ESB_WDT_RELOAD

/* Magic constants */
#define ESB_UNLOCK1
#define ESB_UNLOCK2

/* module parameters */
/* 30 sec default heartbeat (1 < heartbeat < 2*1023) */
#define ESB_HEARTBEAT_MIN
#define ESB_HEARTBEAT_MAX
#define ESB_HEARTBEAT_DEFAULT
#define ESB_HEARTBEAT_RANGE
static int heartbeat; /* in seconds */
module_param(heartbeat, int, 0);
MODULE_PARM_DESC();

static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC();

/* internal variables */
struct esb_dev {};

#define to_esb_dev(wptr)

/*
 * Some i6300ESB specific functions
 */

/*
 * Prepare for reloading the timer by unlocking the proper registers.
 * This is performed by first writing 0x80 followed by 0x86 to the
 * reload register. After this the appropriate registers can be written
 * to once before they need to be unlocked again.
 */
static inline void esb_unlock_registers(struct esb_dev *edev)
{}

static int esb_timer_start(struct watchdog_device *wdd)
{}

static int esb_timer_stop(struct watchdog_device *wdd)
{}

static int esb_timer_keepalive(struct watchdog_device *wdd)
{}

static int esb_timer_set_heartbeat(struct watchdog_device *wdd,
		unsigned int time)
{}

/*
 * Watchdog Subsystem Interfaces
 */

static struct watchdog_info esb_info =;

static const struct watchdog_ops esb_ops =;

/*
 * Data for PCI driver interface
 */
static const struct pci_device_id esb_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, esb_pci_tbl);

/*
 *      Init & exit routines
 */

static unsigned char esb_getdevice(struct esb_dev *edev)
{}

static void esb_initdevice(struct esb_dev *edev)
{}

static int esb_probe(struct pci_dev *pdev,
		const struct pci_device_id *ent)
{}

static void esb_remove(struct pci_dev *pdev)
{}

static struct pci_driver esb_driver =;

module_pci_driver();

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