1 /*
2  * wdt.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * IO dispatcher for a shared memory channel driver.
7  *
8  * Copyright (C) 2010 Texas Instruments, Inc.
9  *
10  * This package is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  *
14  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  */
18 #ifndef __DSP_WDT3_H_
19 #define __DSP_WDT3_H_
20 
21 /* WDT defines */
22 #define OMAP3_WDT3_ISR_OFFSET	0x0018
23 
24 
25 /**
26  * struct dsp_wdt_setting - the basic dsp_wdt_setting structure
27  * @reg_base:	pointer to the base of the wdt registers
28  * @sm_wdt:	pointer to flags in shared memory
29  * @wdt3_tasklet	tasklet to manage wdt event
30  * @fclk		handle to wdt3 functional clock
31  * @iclk		handle to wdt3 interface clock
32  *
33  * This struct is used in the function to manage wdt3.
34  */
35 
36 struct dsp_wdt_setting {
37 	void __iomem *reg_base;
38 	struct shm *sm_wdt;
39 	struct tasklet_struct wdt3_tasklet;
40 	struct clk *fclk;
41 	struct clk *iclk;
42 };
43 
44 /**
45  * dsp_wdt_init() - initialize wdt3 module.
46  *
47  * This function initialize to wdt3 module, so that
48  * other wdt3 function can be used.
49  */
50 int dsp_wdt_init(void);
51 
52 /**
53  * dsp_wdt_exit() - initialize wdt3 module.
54  *
55  * This function frees all resources allocated for wdt3 module.
56  */
57 void dsp_wdt_exit(void);
58 
59 /**
60  * dsp_wdt_enable() - enable/disable wdt3
61  * @enable:	bool value to enable/disable wdt3
62  *
63  * This function enables or disables wdt3 base on @enable value.
64  *
65  */
66 void dsp_wdt_enable(bool enable);
67 
68 /**
69  * dsp_wdt_sm_set() - store pointer to the share memory
70  * @data:		pointer to dspbridge share memory
71  *
72  * This function is used to pass a valid pointer to share memory,
73  * so that the flags can be set in order DSP side can read them.
74  *
75  */
76 void dsp_wdt_sm_set(void *data);
77 
78 #endif
79 
80