18 #include <linux/list.h>
24 #if defined(CONFIG_DEBUG_FS)
26 static char *chstate(
unsigned n)
57 " %8s(%05d/%05d) %c%c%c%c%c%c%c <->"
58 " %8s(%05d/%05d) %c%c%c%c%c%c%c '%s'\n", ch->
n,
79 static int debug_read_stat(
char *buf,
int max)
88 "smsm: ARM9 HAS CRASHED\n");
90 i +=
scnprintf(buf + i, max - i,
"smsm: a9: %08x a11: %08x\n",
93 #ifdef CONFIG_ARCH_MSM_SCORPION
94 i +=
scnprintf(buf + i, max - i,
"smsm dem: apps: %08x modem: %08x "
95 "qdsp6: %08x power: %08x time: %08x\n",
104 i +=
scnprintf(buf + i, max - i,
"diag: '%s'\n", msg);
109 static int debug_read_mem(
char *buf,
int max)
117 "heap: init=%d free=%d remain=%d\n",
126 "%04d: offset %08x size %08x\n",
132 static int debug_read_ch(
char *buf,
int max)
140 i += dump_ch(buf + i, max - i, ch);
142 i += dump_ch(buf + i, max - i, ch);
144 i += dump_ch(buf + i, max - i, ch);
145 spin_unlock_irqrestore(&smd_lock, flags);
150 static
int debug_read_version(
char *buf,
int max)
154 return sprintf(buf,
"%d.%d\n", version >> 16, version & 0xffff);
157 static int debug_read_build_id(
char *buf,
int max)
173 static int debug_read_alloc_tbl(
char *buf,
int max)
180 for (n = 0; n < 64; n++) {
184 "%03d: %-20s cid=%02d type=%03d "
185 "kind=%02d ref_count=%d\n",
186 n, shared[n].
name, shared[n].
cid,
187 shared[n].
ctype & 0xff,
188 (shared[n].
ctype >> 8) & 0xf,
195 #define DEBUG_BUFMAX 4096
199 size_t count, loff_t *ppos)
202 int bsize =
fill(debug_buffer, DEBUG_BUFMAX);
214 int (*
fill)(
char *buf,
int max))
219 int __init smd_debugfs_init(
void)
227 debug_create(
"ch", 0444, dent, debug_read_ch);
228 debug_create(
"stat", 0444, dent, debug_read_stat);
229 debug_create(
"mem", 0444, dent, debug_read_mem);
230 debug_create(
"version", 0444, dent, debug_read_version);
231 debug_create(
"tbl", 0444, dent, debug_read_alloc_tbl);
232 debug_create(
"build", 0444, dent, debug_read_build_id);
240 #define MAX_NUM_SLEEP_CLIENTS 64
241 #define MAX_SLEEP_NAME_LEN 8
243 #define NUM_GPIO_INT_REGISTERS 6
244 #define GPIO_SMEM_NUM_GROUPS 2
245 #define GPIO_SMEM_MAX_PC_INTERRUPTS 8
266 #ifndef CONFIG_ARCH_MSM_SCORPION
268 struct smsm_interrupt_info *int_info;
276 pr_info(
"SMEM_SMSM_SLEEP_DELAY: %x\n", *ptr);
280 pr_info(
"SMEM_SMSM_LIMIT_SLEEP: %x\n", *ptr);
284 pr_info(
"SMEM_SLEEP_POWER_COLLAPSE_DISABLED: %x\n", *ptr);
286 #ifndef CONFIG_ARCH_MSM_SCORPION
289 pr_info(
"SMEM_SMSM_INT_INFO %x %x %x\n",
290 int_info->interrupt_mask,
291 int_info->pending_interrupts,
292 int_info->wakeup_reason);
298 pr_info(
"SMEM_GPIO_INT: %d: e %x d %x p %x\n",
303 pr_info(
"SMEM_GPIO_INT: %d: f %d: %d %d...\n",
309 spin_unlock_irqrestore(&
smem_lock, flags);