Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
sc520_wdt.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/fs.h>
#include <linux/ioport.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/io.h>
#include <linux/uaccess.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define WDT_INTERVAL   (HZ/4+1)
 
#define WATCHDOG_TIMEOUT   30 /* 30 sec default timeout */
 
#define MMCR_BASE   0xfffef000 /* The default base address */
 
#define OFFS_WDTMRCTL   0xCB0 /* Watchdog Timer Control Register */
 
#define WDT_EXP_SEL_01   0x0001 /* [01] Time-out = 496 us (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_02   0x0002 /* [02] Time-out = 508 ms (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_03   0x0004 /* [03] Time-out = 1.02 s (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_04   0x0008 /* [04] Time-out = 2.03 s (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_05   0x0010 /* [05] Time-out = 4.07 s (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_06   0x0020 /* [06] Time-out = 8.13 s (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_07   0x0040 /* [07] Time-out = 16.27s (with 33 Mhz clk). */
 
#define WDT_EXP_SEL_08   0x0080 /* [08] Time-out = 32.54s (with 33 Mhz clk). */
 
#define WDT_IRQ_FLG   0x1000 /* [12] Interrupt Request Flag */
 
#define WDT_WRST_ENB   0x4000 /* [14] Watchdog Timer Reset Enable */
 
#define WDT_ENB   0x8000 /* [15] Watchdog Timer Enable */
 

Functions

 module_param (timeout, int, 0)
 
 MODULE_PARM_DESC (timeout,"Watchdog timeout in seconds. (1 <= timeout <= 3600, default="__MODULE_STRING(WATCHDOG_TIMEOUT)")")
 
 module_param (nowayout, bool, 0)
 
 MODULE_PARM_DESC (nowayout,"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")")
 
 module_init (sc520_wdt_init)
 
 module_exit (sc520_wdt_unload)
 
 MODULE_AUTHOR ("Scott and Bill Jennings")
 
 MODULE_DESCRIPTION ("Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 

Macro Definition Documentation

#define MMCR_BASE   0xfffef000 /* The default base address */

Definition at line 108 of file sc520_wdt.c.

#define OFFS_WDTMRCTL   0xCB0 /* Watchdog Timer Control Register */

Definition at line 109 of file sc520_wdt.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 55 of file sc520_wdt.c.

#define WATCHDOG_TIMEOUT   30 /* 30 sec default timeout */

Definition at line 91 of file sc520_wdt.c.

#define WDT_ENB   0x8000 /* [15] Watchdog Timer Enable */

Definition at line 122 of file sc520_wdt.c.

#define WDT_EXP_SEL_01   0x0001 /* [01] Time-out = 496 us (with 33 Mhz clk). */

Definition at line 112 of file sc520_wdt.c.

#define WDT_EXP_SEL_02   0x0002 /* [02] Time-out = 508 ms (with 33 Mhz clk). */

Definition at line 113 of file sc520_wdt.c.

#define WDT_EXP_SEL_03   0x0004 /* [03] Time-out = 1.02 s (with 33 Mhz clk). */

Definition at line 114 of file sc520_wdt.c.

#define WDT_EXP_SEL_04   0x0008 /* [04] Time-out = 2.03 s (with 33 Mhz clk). */

Definition at line 115 of file sc520_wdt.c.

#define WDT_EXP_SEL_05   0x0010 /* [05] Time-out = 4.07 s (with 33 Mhz clk). */

Definition at line 116 of file sc520_wdt.c.

#define WDT_EXP_SEL_06   0x0020 /* [06] Time-out = 8.13 s (with 33 Mhz clk). */

Definition at line 117 of file sc520_wdt.c.

#define WDT_EXP_SEL_07   0x0040 /* [07] Time-out = 16.27s (with 33 Mhz clk). */

Definition at line 118 of file sc520_wdt.c.

#define WDT_EXP_SEL_08   0x0080 /* [08] Time-out = 32.54s (with 33 Mhz clk). */

Definition at line 119 of file sc520_wdt.c.

#define WDT_INTERVAL   (HZ/4+1)

Definition at line 83 of file sc520_wdt.c.

#define WDT_IRQ_FLG   0x1000 /* [12] Interrupt Request Flag */

Definition at line 120 of file sc520_wdt.c.

#define WDT_WRST_ENB   0x4000 /* [14] Watchdog Timer Reset Enable */

Definition at line 121 of file sc520_wdt.c.

Function Documentation

MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_AUTHOR ( "Scott and Bill Jennings"  )
MODULE_DESCRIPTION ( "Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor"  )
module_exit ( sc520_wdt_unload  )
module_init ( sc520_wdt_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( timeout  ,
int  ,
 
)
module_param ( nowayout  ,
bool  ,
 
)
MODULE_PARM_DESC ( timeout  ,
"Watchdog timeout in seconds. (1 <= timeout <= 3600, default="__MODULE_STRING(WATCHDOG_TIMEOUT)")"   
)
MODULE_PARM_DESC ( nowayout  ,
"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")"   
)