···22 * include/asm-sh/watchdog.h33 *44 * Copyright (C) 2002, 2003 Paul Mundt55+ * Copyright (C) 2009 Siemens AG66+ * Copyright (C) 2009 Valentin Sitdikov57 *68 * This program is free software; you can redistribute it and/or modify it79 * under the terms of the GNU General Public License as published by the···6361#define WTCSR_CKS_2048 0x066462#define WTCSR_CKS_4096 0x0765636464+#if defined(CONFIG_CPU_SUBTYPE_SH7785) || defined(CONFIG_CPU_SUBTYPE_SH7780)6565+/**6666+ * sh_wdt_read_cnt - Read from Counter6767+ * Reads back the WTCNT value.6868+ */6969+static inline __u32 sh_wdt_read_cnt(void)7070+{7171+ return ctrl_inl(WTCNT_R);7272+}7373+7474+/**7575+ * sh_wdt_write_cnt - Write to Counter7676+ * @val: Value to write7777+ *7878+ * Writes the given value @val to the lower byte of the timer counter.7979+ * The upper byte is set manually on each write.8080+ */8181+static inline void sh_wdt_write_cnt(__u32 val)8282+{8383+ ctrl_outl((WTCNT_HIGH << 24) | (__u32)val, WTCNT);8484+}8585+8686+/**8787+ * sh_wdt_write_bst - Write to Counter8888+ * @val: Value to write8989+ *9090+ * Writes the given value @val to the lower byte of the timer counter.9191+ * The upper byte is set manually on each write.9292+ */9393+static inline void sh_wdt_write_bst(__u32 val)9494+{9595+ ctrl_outl((WTBST_HIGH << 24) | (__u32)val, WTBST);9696+}9797+/**9898+ * sh_wdt_read_csr - Read from Control/Status Register9999+ *100100+ * Reads back the WTCSR value.101101+ */102102+static inline __u32 sh_wdt_read_csr(void)103103+{104104+ return ctrl_inl(WTCSR_R);105105+}106106+107107+/**108108+ * sh_wdt_write_csr - Write to Control/Status Register109109+ * @val: Value to write110110+ *111111+ * Writes the given value @val to the lower byte of the control/status112112+ * register. The upper byte is set manually on each write.113113+ */114114+static inline void sh_wdt_write_csr(__u32 val)115115+{116116+ ctrl_outl((WTCSR_HIGH << 24) | (__u32)val, WTCSR);117117+}118118+#else66119/**67120 * sh_wdt_read_cnt - Read from Counter68121 * Reads back the WTCNT value.···160103{161104 ctrl_outw((WTCSR_HIGH << 8) | (__u16)val, WTCSR);162105}163163-106106+#endif /* CONFIG_CPU_SUBTYPE_SH7785 || CONFIG_CPU_SUBTYPE_SH7780 */164107#endif /* __KERNEL__ */165108#endif /* __ASM_SH_WATCHDOG_H */
+13
arch/sh/include/cpu-sh4/cpu/watchdog.h
···22 * include/asm-sh/cpu-sh4/watchdog.h33 *44 * Copyright (C) 2002, 2003 Paul Mundt55+ * Copyright (C) 2009 Siemens AG66+ * Copyright (C) 2009 Sitdikov Valentin57 *68 * This file is subject to the terms and conditions of the GNU General Public79 * License. See the file "COPYING" in the main directory of this archive···1210#ifndef __ASM_CPU_SH4_WATCHDOG_H1311#define __ASM_CPU_SH4_WATCHDOG_H14121313+#if defined(CONFIG_CPU_SUBTYPE_SH7785) || defined(CONFIG_CPU_SUBTYPE_SH7780)1414+/* Prefix definition */1515+#define WTBST_HIGH 0x551616+/* Register definitions */1717+#define WTCNT_R 0xffcc0010 /*WDTCNT*/1818+#define WTCSR 0xffcc0004 /*WDTCSR*/1919+#define WTCNT 0xffcc0000 /*WDTST*/2020+#define WTST WTCNT2121+#define WTBST 0xffcc0008 /*WDTBST*/2222+#else1523/* Register definitions */1624#define WTCNT 0xffc000081725#define WTCSR 0xffc0000c2626+#endif18271928/* Bit definitions */2029#define WTCSR_TME 0x80