blob: 6818680d681466ec7d35fc7ac6d6a6409856b589 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __ARCH_ARM_MACH_MSM_MSM_WATCHDOG_H
14#define __ARCH_ARM_MACH_MSM_MSM_WATCHDOG_H
15
Rohit Vaswanic77e4a62012-08-09 18:10:28 -070016/* The base is just address of the WDT_RST register */
17#define WDT0_OFFSET 0x38
18#define WDT1_OFFSET 0x60
19
Jeff Ohlstein7e668552011-10-06 16:17:25 -070020struct msm_watchdog_pdata {
21 /* pet interval period in ms */
22 unsigned int pet_time;
23 /* bark timeout in ms */
24 unsigned int bark_time;
25 bool has_secure;
Joel Kinge7ca6f72012-02-09 20:51:25 -080026 bool needs_expired_enable;
Rohit Vaswanic9fdd442012-03-19 14:18:32 -070027 bool has_vic;
Rohit Vaswaniead426f2012-01-05 20:24:52 -080028 /* You have to be running in secure mode to use FIQ */
29 bool use_kernel_fiq;
Rohit Vaswanic77e4a62012-08-09 18:10:28 -070030 void __iomem *base;
Jeff Ohlstein7e668552011-10-06 16:17:25 -070031};
32
Rohit Vaswaniead426f2012-01-05 20:24:52 -080033struct msm_watchdog_dump {
34 uint32_t magic;
35 uint32_t curr_cpsr;
36 uint32_t usr_r0;
37 uint32_t usr_r1;
38 uint32_t usr_r2;
39 uint32_t usr_r3;
40 uint32_t usr_r4;
41 uint32_t usr_r5;
42 uint32_t usr_r6;
43 uint32_t usr_r7;
44 uint32_t usr_r8;
45 uint32_t usr_r9;
46 uint32_t usr_r10;
47 uint32_t usr_r11;
48 uint32_t usr_r12;
49 uint32_t usr_r13;
50 uint32_t usr_r14;
51 uint32_t irq_spsr;
52 uint32_t irq_r13;
53 uint32_t irq_r14;
54 uint32_t svc_spsr;
55 uint32_t svc_r13;
56 uint32_t svc_r14;
57 uint32_t abt_spsr;
58 uint32_t abt_r13;
59 uint32_t abt_r14;
60 uint32_t und_spsr;
61 uint32_t und_r13;
62 uint32_t und_r14;
63 uint32_t fiq_spsr;
64 uint32_t fiq_r8;
65 uint32_t fiq_r9;
66 uint32_t fiq_r10;
67 uint32_t fiq_r11;
68 uint32_t fiq_r12;
69 uint32_t fiq_r13;
70 uint32_t fiq_r14;
71};
72
73void msm_wdog_fiq_setup(void *stack);
74extern unsigned int msm_wdog_fiq_length, msm_wdog_fiq_start;
Prasad Sodagudied8df5b2012-09-28 13:49:59 +053075extern unsigned int msm7k_fiq_start, msm7k_fiq_length;
Rohit Vaswaniead426f2012-01-05 20:24:52 -080076
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070077#ifdef CONFIG_MSM_WATCHDOG
78void pet_watchdog(void);
79#else
80static inline void pet_watchdog(void) { }
81#endif
82
83#endif