From: Gilles Gigan<gilles.gigan@gmail.com>
Adds support for the built-in watchdog on EPIC Nano 7240 boards from IEI.
Tested on Nano-7240RS.
Hardware documentation of the platform (including watchdog) can be found
on the IEI website: http://www.ieiworld.comSigned-off-by: Gilles Gigan <gilles.gigan@gmail.com>
---
drivers/char/watchdog/sbc7240_wdt.c | 303 +++++++++++++++++++++++++++++++++++
drivers/watchdog/Kconfig | 13 ++
drivers/watchdog/Makefile | 1
3 files changed, 317 insertions(+), 0 deletions(-)diff --git a/drivers/char/watchdog/sbc7240_wdt.c b/drivers/char/watchdog/sbc7240_wdt.c
new file mode 100644
index 0000000..9f065e1
--- /dev/null
+++ b/drivers/char/watchdog/sbc7240_wdt.c
@@ -0,0 +1,303 @@
+/*
+ * NANO7240 SBC Watchdog device driver
+ *
+ * Based on w83877f.c by Scott Jennings,
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * (c) Copyright 2007 Gilles GIGAN <gilles.gigan@jcu.edu.au>
+ *
+ */
+
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/jiffies.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/miscdevice.h>
+#include <linux/notifier.h>
+#include <linux/types.h>
+#include <linux/watchdog.h>
+#include <asm/atomic.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/uaccess.h>
+
+#define SBC7240_PREFIX "sbc7240_wdt: "
+
+#define SBC7240_ENABLE_PORT 0x443
+#define SBC7240_DISABLE_PORT 0x043
+#define SBC7240_SET_TIMEOUT_PORT SBC...
Normal watchdog behaviour: The magic char should be written and then
/dev/watchdog can be closed and then the watchdog will stop.
What you did here was: if you write the magic char then stop the watchdog
even when the /dev/watchdog device is still open.It's better to do the misc_register as last action. Reason herefor is that
you want to only enable the user-space interface when all the other settings
and interfacing was succesfull. Else you risk that userspace get's enabled and
that you then exit the watchdog driver.
Second problem that I see here is that you should make sure that the watchdog
device driver is stopped/disabled before that you give userspace access via
/dev/watchdog to the watchdog.Greetings,
wim.-
hrm. So if userspace does ioctl(..., WDIOS_DISABLECARD|WDIOS_ENABLECARD,
that happens to be equivalent to WDIOS_ENABLECARD?Do all watchdog drivers do it exactly the same way, or are we offering
inconsistent interfaces between different drivers?An exceedingly minor point, but fun nonetheless.
(And hey, I had to say _something_)
(apart from directing your attention to scripts/checkpatch.pl)
-
Wim,
I made the changes you requested.
Cheers,
GillesFrom: Gilles Gigan<gilles.gigan@gmail.com>
Adds support for the built-in watchdog on EPIC Nano 7240 boards from IEI.
Tested on Nano-7240RS.
Hardware documentation of the platform (including watchdog) can be found
on the IEI website: http://www.ieiworld.comSigned-off-by: Gilles Gigan <gilles.gigan@gmail.com>
---
drivers/watchdog/Kconfig | 13 ++
drivers/watchdog/Makefile | 1
drivers/watchdog/sbc7240_wdt.c | 307 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 321 insertions(+), 0 deletions(-)diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 2792bc1..c9d5ada 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -456,6 +456,19 @@ config SBC8360_WDTMost people will say N.
+config SBC7240_WDT
+ tristate "SBC Nano 7240 Watchdog Timer"
+ depends on X86_32
+ ---help---
+ This is the driver for the hardware watchdog found on the IEI
+ single board computers EPIC Nano 7240 (and likely others). This
+ watchdog simply watches your kernel to make sure it doesn't freeze,
+ and if it does, it reboots your computer after a certain amount of
+ time.
+
+ To compile this driver as a module, choose M here: the
+ module will be called sbc7240_wdt.
+
config CPU5_WDT
tristate "SMA CPU5 Watchdog"
depends on X86
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 7d9e573..d57bfd0 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -71,6 +71,7 @@ obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
+obj-$(CONFIG_SBC7240_WDT) += sbc7240_wdt.o
obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
obj-$(CONFIG_SMSC37B787_WDT) += smsc37b787_wdt.o
obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c
new file m...
I fear that all watchdog drivers do it more or less like this.
I'll have a look at it later on.
Greetings,
Wim.-
On Wed, 24 Oct 2007 17:22:40 +0200
Not really an issue. "Mummy if I jump off a cliff it hurts"
-
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Andrew Morton | Re: 2.6.23-rc6-mm1 |
| Luciano Rocha | usb hdd problems with 2.6.27.2 |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
