msm_watchdog.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
  2. *
  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. #ifndef __ARCH_ARM_MACH_MSM_MSM_WATCHDOG_H
  13. #define __ARCH_ARM_MACH_MSM_MSM_WATCHDOG_H
  14. /* The base is just address of the WDT_RST register */
  15. #define WDT0_OFFSET 0x38
  16. #define WDT1_OFFSET 0x60
  17. struct msm_watchdog_pdata {
  18. /* pet interval period in ms */
  19. unsigned int pet_time;
  20. /* bark timeout in ms */
  21. unsigned int bark_time;
  22. bool has_secure;
  23. bool needs_expired_enable;
  24. bool has_vic;
  25. /* You have to be running in secure mode to use FIQ */
  26. bool use_kernel_fiq;
  27. void __iomem *base;
  28. };
  29. struct msm_watchdog_dump {
  30. uint32_t magic;
  31. uint32_t curr_cpsr;
  32. uint32_t usr_r0;
  33. uint32_t usr_r1;
  34. uint32_t usr_r2;
  35. uint32_t usr_r3;
  36. uint32_t usr_r4;
  37. uint32_t usr_r5;
  38. uint32_t usr_r6;
  39. uint32_t usr_r7;
  40. uint32_t usr_r8;
  41. uint32_t usr_r9;
  42. uint32_t usr_r10;
  43. uint32_t usr_r11;
  44. uint32_t usr_r12;
  45. uint32_t usr_r13;
  46. uint32_t usr_r14;
  47. uint32_t irq_spsr;
  48. uint32_t irq_r13;
  49. uint32_t irq_r14;
  50. uint32_t svc_spsr;
  51. uint32_t svc_r13;
  52. uint32_t svc_r14;
  53. uint32_t abt_spsr;
  54. uint32_t abt_r13;
  55. uint32_t abt_r14;
  56. uint32_t und_spsr;
  57. uint32_t und_r13;
  58. uint32_t und_r14;
  59. uint32_t fiq_spsr;
  60. uint32_t fiq_r8;
  61. uint32_t fiq_r9;
  62. uint32_t fiq_r10;
  63. uint32_t fiq_r11;
  64. uint32_t fiq_r12;
  65. uint32_t fiq_r13;
  66. uint32_t fiq_r14;
  67. };
  68. void msm_wdog_fiq_setup(void *stack);
  69. extern unsigned int msm_wdog_fiq_length, msm_wdog_fiq_start;
  70. extern unsigned int msm7k_fiq_start, msm7k_fiq_length;
  71. #ifdef CONFIG_MSM_WATCHDOG
  72. void pet_watchdog(void);
  73. #else
  74. static inline void pet_watchdog(void) { }
  75. #endif
  76. #endif