xref: /netbsd-src/sys/arch/arm/gemini/gemini_wdtvar.h (revision cf10107d5d3746e98e37d403b996f1965f67f255)
1*cf10107dSdyoung /*	$NetBSD: gemini_wdtvar.h,v 1.4 2011/07/01 19:32:28 dyoung Exp $	*/
2f5d7ce3dSmatt 
3f5d7ce3dSmatt /*
4f5d7ce3dSmatt  * adapted/extracted from omap_wdt.c
5f5d7ce3dSmatt  *
6f5d7ce3dSmatt  * Copyright (c) 2007 Microsoft
7f5d7ce3dSmatt  * All rights reserved.
8f5d7ce3dSmatt  *
9f5d7ce3dSmatt  * Redistribution and use in source and binary forms, with or without
10f5d7ce3dSmatt  * modification, are permitted provided that the following conditions
11f5d7ce3dSmatt  * are met:
12f5d7ce3dSmatt  * 1. Redistributions of source code must retain the above copyright
13f5d7ce3dSmatt  *    notice, this list of conditions and the following disclaimer.
14f5d7ce3dSmatt  * 2. Redistributions in binary form must reproduce the above copyright
15f5d7ce3dSmatt  *    notice, this list of conditions and the following disclaimer in the
16f5d7ce3dSmatt  *    documentation and/or other materials provided with the distribution.
17f5d7ce3dSmatt  * 3. All advertising materials mentioning features or use of this software
18f5d7ce3dSmatt  *    must display the following acknowledgement:
19f5d7ce3dSmatt  *	This product includes software developed by Microsoft
20f5d7ce3dSmatt  *
21f5d7ce3dSmatt  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22f5d7ce3dSmatt  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23f5d7ce3dSmatt  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24f5d7ce3dSmatt  * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT,
25f5d7ce3dSmatt  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26f5d7ce3dSmatt  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27f5d7ce3dSmatt  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28f5d7ce3dSmatt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29f5d7ce3dSmatt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30f5d7ce3dSmatt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31f5d7ce3dSmatt  * SUCH DAMAGE.
32f5d7ce3dSmatt  */
33f5d7ce3dSmatt #ifndef  _ARM_GEMINI_WDTVAR_H
34f5d7ce3dSmatt #define  _ARM_GEMINI_WDTVAR_H
35f5d7ce3dSmatt 
36f5d7ce3dSmatt #include <sys/device.h>
37*cf10107dSdyoung #include <sys/bus.h>
38f5d7ce3dSmatt #include <dev/sysmon/sysmonvar.h>
39f5d7ce3dSmatt 
40f5d7ce3dSmatt typedef struct geminiwdt_softc {
41c20cc9bcScliff 	device_t sc_dev;
42f5d7ce3dSmatt 	bus_addr_t sc_addr;
43f5d7ce3dSmatt 	bus_size_t sc_size;
44f5d7ce3dSmatt 	bus_space_tag_t sc_iot;
45f5d7ce3dSmatt 	bus_space_handle_t sc_ioh;
46f5d7ce3dSmatt 	struct sysmon_wdog sc_smw;
47f5d7ce3dSmatt 	int sc_armed;
48f5d7ce3dSmatt } geminiwdt_softc_t;
49f5d7ce3dSmatt 
50f5d7ce3dSmatt extern struct geminiwdt_softc *geminiwdt_sc;
51f5d7ce3dSmatt extern int omapwdt_sysconfig;
52f5d7ce3dSmatt 
53f5d7ce3dSmatt int	geminiwdt_setmode(struct sysmon_wdog *);
54f5d7ce3dSmatt int	geminiwdt_tickle(struct sysmon_wdog *);
55f5d7ce3dSmatt 
56f5d7ce3dSmatt void	geminiwdt_set_timeout(unsigned int period);
57f5d7ce3dSmatt int	geminiwdt_enable(int enable);
58f5d7ce3dSmatt 
59f5d7ce3dSmatt #endif  /* _ARM_GEMINI_WDTVAR_H */
60