int lge_is_mark_cp_crash() { char data[2] = {0x00,0x00}; lge_dynamic_nvdata_read(LGE_NVDATA_DYNAMIC_RESET_CAUSE_OFFSET,data,1); if(data[0] == LGE_NVDATA_DYNAMIC_RESET_CAUSE_VAL_CP_CRASH) return 1; else return 0; }
int lge_is_ap_crash_dump_enabled() { char data[2] = {0x00,0x00}; lge_dynamic_nvdata_read(LGE_NVDATA_DYNAMIC_AP_CRASH_DUMP_OFFSET,data,1); msleep(100); if(data[0] == LGE_NDATA_DYNAMIC_CRASH_DUMP_ENABLE_VALUE) return 1; else return 0; }
int lge_is_force_ap_crash() { char data[2] = {0x00,0x00}; lge_dynamic_nvdata_read(LGE_NVDATA_DYNAMIC_FORCE_CRASH_OFFSET,data,1); msleep(100); if(data[0] == LGE_NVDATA_FORCE_CRASH_VALUE) { printk("force ap crash\n"); data[0] = 0x00; lge_dynamic_nvdata_write(LGE_NVDATA_DYNAMIC_FORCE_CRASH_OFFSET,data,1); msleep(100); return 1; } else return 0; }
static void CP_CRASH_wq_func(struct work_struct *cp_crash_wq) { int ret; unsigned char data; struct timespec ts; struct rtc_time tm; char* argv[] = {"/system/bin/ifx_coredump", "CP_CRASH_IRQ", NULL}; char *envp[] = { "HOME=/", "PATH=/sbin:/bin:/system/bin", NULL }; getnstimeofday(&ts); rtc_time_to_tm(ts.tv_sec, &tm); printk(KERN_INFO "[CP CRASH IRQ] CP_CRASH_wq_func()\n"); printk(KERN_INFO "(%d-%02d-%02d %02d:%02d:%02d.%09lu UTC)\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec); if(gpio_get_value(CP_CRASH_INT_N)) { lge_store_ciq_reset(0, LGE_NVDATA_IQ_RESET_EXCEPTION); // UPDATE CP_CRASH_COUNT lge_dynamic_nvdata_read(LGE_NVDATA_DYNAMIC_CP_CRASH_COUNT_OFFSET, &data, 1); data++; lge_dynamic_nvdata_write(LGE_NVDATA_DYNAMIC_CP_CRASH_COUNT_OFFSET, &data, 1); // CHECK CP_CRASH_DUMP OPTION if (lge_is_crash_dump_enabled() != 1) { #ifndef ENABLE_CP_CRASH_RESET // LGE_RIL_RECOVERY printk(" CP CRASH! immediate RIL/CP reset"); input_report_key(in_dev, EVENT_KEY, 1); input_report_key(in_dev, EVENT_KEY, 0); input_sync(in_dev); printk("[CPW] input_report_key(): %d\n", EVENT_KEY); #endif return; } ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); printk(KERN_INFO "[CP CRASH IRQ] launch ifx_coredump process ret:%d\n", ret); gpio_set_value(82, 1); } else { // LGE_CHANGE [MIPI-HSI] [email protected] [START] #if 0 /***************************************************************************** 1. Case of HSI_LL_MSG_BREAK in hsi_ll_read_complete_cb 2. Case of invalid packet in Rmnet from CP (becasue of very low battery and etc) *****************************************************************************/ printk(KERN_INFO "[CP CRASH IRQ] CP_CRASH_wq_func() - CP_CRASH_INT_N - Invaild\n"); #ifndef ENABLE_CP_CRASH_RESET // LGE_RIL_RECOVERY printk(" CP CRASH! immediate RIL/CP reset"); input_report_key(in_dev, EVENT_KEY, 1); input_report_key(in_dev, EVENT_KEY, 0); input_sync(in_dev); printk("[CPW] input_report_key(): %d\n", EVENT_KEY); #endif #endif // LGE_CHANGE [MIPI-HSI] [email protected] [END] } }
// [email protected] 20110110 MUIC mode change in case of trap [START] static void CP_CRASH_wq_func(struct work_struct *cp_crash_wq) { volatile unsigned long *make_panic = 0; extern void set_muic_mode(u32 mode); int ret; // CRASH TIME INFORMATION ADD. 2011-04-23 eunae.kim struct timespec ts; struct rtc_time tm; getnstimeofday(&ts); rtc_time_to_tm(ts.tv_sec, &tm); printk(KERN_INFO "[CP CRASH IRQ] CP_CRASH_wq_func()"); printk(KERN_INFO "(%d-%02d-%02d %02d:%02d:%02d.%09lu UTC)\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec); // CHEOLGWAK 2011-5-14 delayed work queue #ifdef CONFIG_MACH_LGE_COSMO_DOMASTIC if(!gpio_get_value(CP_CRASH_INT_N)){ #else if(gpio_get_value(CP_CRASH_INT_N)){ #endif #if 0 // [email protected] prevent to make panic *make_panic = 0xDEAD; #endif //LGE_ChangeS [email protected] 20110131 CIQ [START] lge_store_ciq_reset(0, LGE_NVDATA_IQ_RESET_EXCEPTION); //LGE_ChangeS [email protected] 20110131 CIQ [END] // CHEOLGWAK 2011-2-26 CP_CRASH_COUNT { unsigned char data; lge_dynamic_nvdata_read(LGE_NVDATA_DYNAMIC_CP_CRASH_COUNT_OFFSET,&data,1); data++; lge_dynamic_nvdata_write(LGE_NVDATA_DYNAMIC_CP_CRASH_COUNT_OFFSET,&data,1); } // CHEOLGWAK 2011-2-26 CP_CRASH_COUNT // CHEOLGWAK 2011-2-28 // [email protected] 20110111 if (lge_is_crash_dump_enabled() != 1) { #ifndef ENABLE_CP_CRASH_RESET //20110301 LGE_RIL_RECOVERY printk(" CP CRASH! immediate RIL/CP reset"); input_report_key(in_dev, EVENT_KEY, 1); input_report_key(in_dev, EVENT_KEY, 0); input_sync(in_dev); printk("[CPW] input_report_key(): %d\n", EVENT_KEY); #endif return; } // [email protected] 20110130 CP Crash Core Dump Season2 [START] // set_muic_mode(7 /* MUIC_CP_UART */); printk(KERN_INFO "[CP CRASH IRQ] launch ifx_coredump process\n"); { char* argv[] = {"/system/bin/ifx_coredump", "CP_CRASH_IRQ", NULL}; char *envp[] = { "HOME=/", "PATH=/sbin:/bin:/system/bin", NULL }; //@@ret = call_usermodehelper(argv[0], argv, envp, UMH_NO_WAIT); ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC); printk(KERN_INFO "[CP CRASH IRQ] launch ifx_coredump process ret:%d\n",ret); } gpio_set_value(82, 1); #if 0 // LED toggle int toggle = 0; for(;;) { if(toggle == 0) { gpio_set_value(82, 1); toggle = 1; } else { gpio_set_value(82, 0); toggle = 0; } msleep(100); } #endif // [email protected] 20110130 CP Crash Core Dump Season2 [END] } else { return; } // CHEOLGWAK 2011-5-14 delayed work queue } static irqreturn_t CP_CRASH_interrupt_handler(s32 irq, void *data) { /* Make the interrupt on CP CRASH INT wake up OMAP which is in suspend mode */ // CHEOLGWAK 2011-5-14 delayed work queue //schedule_work(&CP_CRASH_INT_wq); schedule_delayed_work( &cp_crash_int_delayed_wq, msecs_to_jiffies(500)); // CHEOLGWAK 2011-5-14 delayed work queue return IRQ_HANDLED; }