mtk_ram_console.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #ifndef __MTK_RAM_CONSOLE_H__
  2. #define __MTK_RAM_CONSOLE_H__
  3. #include <linux/console.h>
  4. #include <linux/pstore.h>
  5. typedef enum {
  6. AEE_FIQ_STEP_FIQ_ISR_BASE = 1,
  7. AEE_FIQ_STEP_WDT_FIQ_INFO = 4,
  8. AEE_FIQ_STEP_WDT_FIQ_STACK,
  9. AEE_FIQ_STEP_WDT_FIQ_LOOP,
  10. AEE_FIQ_STEP_WDT_FIQ_DONE,
  11. AEE_FIQ_STEP_WDT_IRQ_INFO = 8,
  12. AEE_FIQ_STEP_WDT_IRQ_KICK,
  13. AEE_FIQ_STEP_WDT_IRQ_SMP_STOP,
  14. AEE_FIQ_STEP_WDT_IRQ_STACK,
  15. AEE_FIQ_STEP_WDT_IRQ_TIME,
  16. AEE_FIQ_STEP_WDT_IRQ_GIC,
  17. AEE_FIQ_STEP_WDT_IRQ_LOCALTIMER,
  18. AEE_FIQ_STEP_WDT_IRQ_IDLE,
  19. AEE_FIQ_STEP_WDT_IRQ_SCHED,
  20. AEE_FIQ_STEP_WDT_IRQ_DONE,
  21. AEE_FIQ_STEP_KE_WDT_INFO = 20,
  22. AEE_FIQ_STEP_KE_WDT_PERCPU,
  23. AEE_FIQ_STEP_KE_WDT_LOG,
  24. AEE_FIQ_STEP_KE_SCHED_DEBUG,
  25. AEE_FIQ_STEP_KE_WDT_DONE,
  26. AEE_FIQ_STEP_KE_IPANIC_DIE = 32,
  27. AEE_FIQ_STEP_KE_IPANIC_START,
  28. AEE_FIQ_STEP_KE_IPANIC_OOP_HEADER,
  29. AEE_FIQ_STEP_KE_IPANIC_DETAIL,
  30. AEE_FIQ_STEP_KE_IPANIC_CONSOLE,
  31. AEE_FIQ_STEP_KE_IPANIC_USERSPACE,
  32. AEE_FIQ_STEP_KE_IPANIC_ANDROID,
  33. AEE_FIQ_STEP_KE_IPANIC_MMPROFILE,
  34. AEE_FIQ_STEP_KE_IPANIC_HEADER,
  35. AEE_FIQ_STEP_KE_IPANIC_DONE,
  36. AEE_FIQ_STEP_KE_NESTED_PANIC = 64,
  37. } AEE_FIQ_STEP_NUM;
  38. extern struct pstore_info *psinfo;
  39. #ifdef CONFIG_MTK_RAM_CONSOLE
  40. extern int aee_rr_curr_fiq_step(void);
  41. extern void aee_rr_rec_fiq_step(u8 i);
  42. extern void aee_rr_rec_reboot_mode(u8 mode);
  43. extern void aee_rr_rec_kdump_params(void *params);
  44. extern void aee_rr_rec_last_irq_enter(int cpu, int irq, u64 j);
  45. extern void aee_rr_rec_last_irq_exit(int cpu, int irq, u64 j);
  46. extern void aee_rr_rec_last_sched_jiffies(int cpu, u64 j, const char *comm);
  47. extern void aee_rr_rec_hoplug(int cpu, u8 data1, u8 data2);
  48. extern void aee_rr_rec_hotplug(int cpu, u8 data1, u8 data2, unsigned long data3);
  49. extern void aee_sram_fiq_log(const char *msg);
  50. extern void ram_console_write(struct console *console, const char *s, unsigned int count);
  51. extern void aee_sram_fiq_save_bin(const char *buffer, size_t len);
  52. #ifdef CONFIG_MTK_EMMC_SUPPORT
  53. extern void last_kmsg_store_to_emmc(void);
  54. #endif
  55. #else
  56. static inline int aee_rr_curr_fiq_step(void)
  57. {
  58. return 0;
  59. }
  60. static inline void aee_rr_rec_fiq_step(u8 i)
  61. {
  62. }
  63. static inline unsigned int aee_rr_curr_exp_type(void)
  64. {
  65. return 0;
  66. }
  67. static inline void aee_rr_rec_exp_type(unsigned int type)
  68. {
  69. }
  70. static inline void aee_rr_rec_reboot_mode(u8 mode)
  71. {
  72. }
  73. static inline void aee_rr_rec_kdump_params(void *params)
  74. {
  75. }
  76. static inline void aee_rr_rec_last_irq_enter(int cpu, int irq, u64 j)
  77. {
  78. }
  79. static inline void aee_rr_rec_last_irq_exit(int cpu, int irq, u64 j)
  80. {
  81. }
  82. static inline void aee_rr_rec_last_sched_jiffies(int cpu, u64 j, const char *comm)
  83. {
  84. }
  85. static inline void aee_rr_rec_hoplug(int cpu, u8 data1, u8 data2)
  86. {
  87. }
  88. static inline void aee_rr_rec_hotplug(int cpu, u8 data1, u8 data2, unsigned long data3)
  89. {
  90. }
  91. static inline void aee_sram_fiq_log(const char *msg)
  92. {
  93. }
  94. static inline void ram_console_write(struct console *console, const char *s, unsigned int count)
  95. {
  96. }
  97. static inline void aee_sram_fiq_save_bin(unsigned char *buffer, size_t len)
  98. {
  99. }
  100. #ifdef CONFIG_MTK_EMMC_SUPPORT
  101. static inline void last_kmsg_store_to_emmc(void)
  102. {
  103. }
  104. #endif
  105. #endif /* CONFIG_MTK_RAM_CONSOLE */
  106. #ifdef CONFIG_MTK_AEE_IPANIC
  107. extern int ipanic_kmsg_write(unsigned int part, const char *buf, size_t size);
  108. extern int ipanic_kmsg_get_next(int *count, u64 *id, enum pstore_type_id *type, struct timespec *time,
  109. char **buf, struct pstore_info *psi);
  110. #else
  111. static inline int ipanic_kmsg_write(unsigned int part, const char *buf, size_t size)
  112. {
  113. return 0;
  114. }
  115. static inline int ipanic_kmsg_get_next(int *count, u64 *id, enum pstore_type_id *type, struct timespec *time,
  116. char **buf, struct pstore_info *psi)
  117. {
  118. return 0;
  119. }
  120. #endif /* CONFIG_MTK_AEE_IPANIC */
  121. #endif