summaryrefslogtreecommitdiffstats
path: root/target/linux/danube/files/include
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2007-12-13 19:20:12 +0000
committerJohn Crispin <john@openwrt.org>2007-12-13 19:20:12 +0000
commit82f0d7266445350be4180a81ec7ff3ab96a730f1 (patch)
treebebbb573c5ca709fc1978aa00ba2ff14da303fde /target/linux/danube/files/include
parent7d9713b97f2dacfcb8512a3c077f519ddf8f5e6f (diff)
downloadmaster-31e0f0ae-82f0d7266445350be4180a81ec7ff3ab96a730f1.tar.gz
master-31e0f0ae-82f0d7266445350be4180a81ec7ff3ab96a730f1.tar.bz2
master-31e0f0ae-82f0d7266445350be4180a81ec7ff3ab96a730f1.zip
initial merge of danube wdt code
SVN-Revision: 9727
Diffstat (limited to 'target/linux/danube/files/include')
-rw-r--r--target/linux/danube/files/include/asm-mips/danube/danube.h19
-rw-r--r--target/linux/danube/files/include/asm-mips/danube/danube_wdt.h48
2 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/danube/files/include/asm-mips/danube/danube.h b/target/linux/danube/files/include/asm-mips/danube/danube.h
index d2c925cd39..5809fd94cd 100644
--- a/target/linux/danube/files/include/asm-mips/danube/danube.h
+++ b/target/linux/danube/files/include/asm-mips/danube/danube.h
@@ -285,4 +285,23 @@
#define DANUBE_GPIO_P1_ALTSEL1 ((u32*)(DANUBE_GPIO_BASE_ADDR + 0x0050))
#define DANUBE_GPIO_P1_DIR ((u32*)(DANUBE_GPIO_BASE_ADDR + 0x0048))
+
+/*------------ WDT */
+
+#define DANUBE_WDT_BASE_ADDR (KSEG1 + 0x1F880000)
+
+#define DANUBE_BIU_WDT_CR ((u32*)(DANUBE_WDT_BASE_ADDR + 0x03F0))
+#define DANUBE_BIU_WDT_SR ((u32*)(DANUBE_WDT_BASE_ADDR + 0x03F8))
+
+#define DANUBE_BIU_WDT_CR_GEN (1 << 31)
+#define DANUBE_BIU_WDT_CR_DSEN (1 << 30)
+#define DANUBE_BIU_WDT_CR_LPEN (1 << 29)
+
+#define DANUBE_BIU_WDT_CR_CLKDIV_GET(value) (((value) >> 24) & ((1 << 2) - 1))
+#define DANUBE_BIU_WDT_CR_PWL_GET(value) (((value) >> 26) & ((1 << 2) - 1))
+#define DANUBE_BIU_WDT_CR_PWL_SET(value) ((((1 << 2) - 1) & (value)) << 26)
+#define DANUBE_BIU_WDT_CR_PW_SET(value) (((( 1 << 8) - 1) & (value)) << 16)
+#define DANUBE_BIU_WDT_CR_CLKDIV_SET(value) (((( 1 << 2) - 1) & (value)) << 24)
+#define DANUBE_BIU_WDT_CR_RELOAD_SET(value) (((( 1 << 16) - 1) & (value)) << 0)
+
#endif
diff --git a/target/linux/danube/files/include/asm-mips/danube/danube_wdt.h b/target/linux/danube/files/include/asm-mips/danube/danube_wdt.h
new file mode 100644
index 0000000000..1c31fc9ee2
--- /dev/null
+++ b/target/linux/danube/files/include/asm-mips/danube/danube_wdt.h
@@ -0,0 +1,48 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) 2005 infineon
+ * Copyright (C) 2007 John Crispin <blogic@openwrt.org>
+ *
+ */
+
+#ifndef DANUBE_WDT_H
+#define DANUBE_WDT_H
+
+/* Danube wdt ioctl control */
+#define DANUBE_WDT_IOC_MAGIC 0xc0
+#define DANUBE_WDT_IOC_START _IOW(DANUBE_WDT_IOC_MAGIC, 0, int)
+#define DANUBE_WDT_IOC_STOP _IO(DANUBE_WDT_IOC_MAGIC, 1)
+#define DANUBE_WDT_IOC_PING _IO(DANUBE_WDT_IOC_MAGIC, 2)
+#define DANUBE_WDT_IOC_SET_PWL _IOW(DANUBE_WDT_IOC_MAGIC, 3, int)
+#define DANUBE_WDT_IOC_SET_DSEN _IOW(DANUBE_WDT_IOC_MAGIC, 4, int)
+#define DANUBE_WDT_IOC_SET_LPEN _IOW(DANUBE_WDT_IOC_MAGIC, 5, int)
+#define DANUBE_WDT_IOC_GET_STATUS _IOR(DANUBE_WDT_IOC_MAGIC, 6, int)
+#define DANUBE_WDT_IOC_SET_CLKDIV _IOW(DANUBE_WDT_IOC_MAGIC, 7, int)
+
+/* password 1 and 2 */
+#define DANUBE_WDT_PW1 0x000000BE
+#define DANUBE_WDT_PW2 0x000000DC
+
+#define DANUBE_WDT_CLKDIV0_VAL 1
+#define DANUBE_WDT_CLKDIV1_VAL 64
+#define DANUBE_WDT_CLKDIV2_VAL 4096
+#define DANUBE_WDT_CLKDIV3_VAL 262144
+#define DANUBE_WDT_CLKDIV0 0
+#define DANUBE_WDT_CLKDIV1 1
+#define DANUBE_WDT_CLKDIV2 2
+#define DANUBE_WDT_CLKDIV3 3
+
+#endif