The watchdog driver is for moxa v2101, da-682, da-683, da-685, da-682a serials embedded computer.
the watchdog driver is comprised of moxa_v2100_superio.ko and moxa_v2100_wdt.ko.
the corresponding source are moxa_v2100_superio.c and moxa_v2100_wdt.c
this is the architecture of the watchdog driver.


user sapce	debian watchdog daemon

		/dev/watchdog
		-----------------------------------------------------------------
kernel space	| moxa_v2100_wdt.ko  |  moxa_device_dio.ko |  moxa_uart_mode.ko  |
		-----------------------------------------------------------------
		| moxa_v2100_superio.ko                                          | 
		-----------------------------------------------------------------

Following describes how to compile the watchdog driver.


1. Setting the path to your kernel source tree in Makefile.

	The KDIR is variable is used for the path of kernel source.
	If your kernel is located at another location, please set the KDIR depends on your making environment.

	KDIR:=/lib/modules/$(shell uname -r)/build

2. Compile your kernel before makeing the module.

3. Compile the module. The Makefile will make moxa_v2100_wdt.ko.

	First, you should build the moxa_v2100_superio.ko.

	$ cd /home/jared_wu/git/DA-820/modules/moxa_v2100_superio
	$ make
	  Building modules, stage 2.
	  MODPOST 2 modules
	  CC      /home/jared_wu/git/DA-820/modules/moxa_v2100_wdt/moxa_v2100_superio.mod.o
	  LD [M]  /home/jared_wu/git/DA-820/modules/moxa_v2100_wdt/moxa_v2100_superio.ko

	Then build the moxa_v2100_wdt.ko

	$ cd /home/jared_wu/git/DA-820/modules/moxa_v2100_wdt
	$ make
	...
	  Building modules, stage 2.
	  MODPOST 2 modules
	  CC      /home/jared_wu/git/DA-820/modules/moxa_v2100_wdt/moxa_v2100_wdt.mod.o
	  LD [M]  /home/jared_wu/git/DA-820/modules/moxa_v2100_wdt/moxa_v2100_wdt.ko

4. Load the watchdog drivers.

	The moxa_v2100_wdt.ko is dependent on moxa_v2100_superio.ko. 
	You should load the moxa_v2100_superio.ko at first. Then load the moxa_v2100_wdt.ko.

5. Install and run the watchdog daemon to touch the hardware watchdog in 60 secords.

	You can get the watchdog daemon source from debian's page.
	http://packages.debian.org/wheezy/watchdog

6. Other reference about Linux watchdog

	http://www.linuxjournal.com/article/217
	http://www.sat.dundee.ac.uk/~psc/watchdog/watchdog-testing.html

