Пример #1
0
 int LGE_ErrorHandler_Main( int crash_side, char * message)
 {
 	

	 char * kmem_buf;
	LG_ErrorHandler_enable = 1;
	raw_local_irq_enable();

	kmem_buf = kmalloc(LGE_ERROR_MAX_ROW*LGE_ERROR_MAX_COLUMN, GFP_ATOMIC);
	memcpy(kmem_buf, message, LGE_ERROR_MAX_ROW*LGE_ERROR_MAX_COLUMN);
	switch(crash_side) {
		case MODEM_CRASH:
			display_info_LCD(crash_side, message);
			break;

		case APPL_CRASH:
			display_info_LCD(crash_side, message);
			break;


	}
	kfree(kmem_buf);
	
	raw_local_irq_disable();
	preempt_disable();
	mdelay(100);
 
	while(1)
	{
		// 1. Check Volume UP Key 

		gpio_direction_output(34,1);
		gpio_direction_output(37,0);	//volume down
		gpio_direction_output(38,1);	//volume up
		gpio_direction_input(34);
		if(gpio_get_value(34)==0){
			printk("volup\n");
			return SMSM_SYSTEM_REBOOT; //volume up key is pressed
		}
		mdelay(100);
		// 2. Check Volume DOWN Key 
		gpio_direction_output(34,1);
		gpio_direction_output(37,1);	//volume down
		gpio_direction_output(38,0);
		gpio_direction_input(34);
		if(gpio_get_value(34)==0){
			printk("voldown\n");
			return SMSM_SYSTEM_REBOOT; //volume down key is pressed
		
		}
		mdelay(100);
	}

	
 }
int LGE_ErrorHandler_Main( int crash_side, char * message)
{
	char * kmem_buf;
	LG_ErrorHandler_enable = 1;
	raw_local_irq_enable();
	/* [email protected] 10.11.04  S 
	 * 0010515: temporary disable CONFIG_FRAMEBUFFER_CONSOLE because of current consumption
	*/
#if 0 
	kmem_buf = kmalloc(LGE_ERROR_MAX_ROW*LGE_ERROR_MAX_COLUMN, GFP_ATOMIC);
	memcpy(kmem_buf, message, LGE_ERROR_MAX_ROW*LGE_ERROR_MAX_COLUMN);
	switch(crash_side) {
		case MODEM_CRASH:
			display_info_LCD(crash_side, message);
			break;

		case APPL_CRASH:
			display_info_LCD(crash_side, message);
			break;


	}
	kfree(kmem_buf);
#endif
	/* [email protected] 10.11.04 E */

	raw_local_irq_disable();
	preempt_disable();
	/* BEGIN: 0006765 [email protected] 2010-06-03 */
/* MODIFY 0006765: Fix : The kernel panic screen is disappeared just after linux kernel gets system panic */
	mdelay(100);
 
	while(1)
	{
		// 1. Check Volume Key 
/* [email protected] 10.11.03 S 
0010460: add HW revision feature to vol key gpio in kernel panic
*/
#if CONFIG_MACH_LGE_BRYCE
#if defined (LG_HW_REV2)
		gpio_direction_output(19,1);
		gpio_direction_output(56,0);	//volume down
		gpio_direction_output(20,1);	//volume up
		gpio_direction_input(19);
		if(gpio_get_value(19)==0){
			printk("### vol down key pressed \n");
			mdelay(100);
/* [email protected] 10.11.03 S 
   0010472: each volup/voldown key mapped separately to reboot/download mode. 
 */
			return SMSM_SYSTEM_DOWNLOAD; 
/* [email protected] 10.11.03 E */
		}
		mdelay(100);
		gpio_direction_output(19,1);
		gpio_direction_output(20,0);
		gpio_direction_output(56,1);
		gpio_direction_input(19);
		if(gpio_get_value(19)==0){
			printk("### vol up key pressed\n");
			mdelay(100);
			return SMSM_SYSTEM_REBOOT;
		
		}
		mdelay(100);
#endif
#if defined (LG_HW_REV3) || defined(LG_HW_REV4) || defined(LG_HW_REV5) || defined(LG_HW_REV6) || defined(LG_HW_REV7)
		gpio_direction_output(20,1);
		gpio_direction_output(56,0);	//volume down
		gpio_direction_output(19,1);	//volume up
		gpio_direction_input(20);
		if(gpio_get_value(20)==0){
			printk("### vol down key pressed \n");
			mdelay(100);
/* [email protected] 10.11.03 S 
   0010472: each volup/voldown key mapped separately to reboot/download mode. 
 */
			return SMSM_SYSTEM_DOWNLOAD;
/* [email protected] 10.11.03 E */
		}
		mdelay(100);
		gpio_direction_output(20,1);
		gpio_direction_output(19,0);
		gpio_direction_output(56,1);
		gpio_direction_input(20);
		if(gpio_get_value(20)==0){
			printk("### vol up key pressed\n");
			mdelay(100);
			return SMSM_SYSTEM_REBOOT; 
		
		}
		mdelay(100);
#endif
#endif
/* [email protected] 10.11.03 E */ 
	}
/* END: 0006765 [email protected] 2010-06-03 */

	
 }
Пример #3
0
 int LGE_ErrorHandler_Main( int crash_side, char * message)
 {

    ram_console_setpanic();

	if (hidden_reset_enable) {
		if (crash_side == MODEM_CRASH) {
			unsigned *temp;

			printk(KERN_INFO"%s: arm9 has crashed...\n",__func__);
			printk(KERN_INFO"%s\n", message);
		
			atomic_notifier_call_chain(&panic_notifier_list, 0, "arm9 has crashed...\n");
			
			temp = lge_get_fb_copy_virt_addr();
			*temp = 0x12345678;
			printk(KERN_INFO"%s: hidden magic  %x\n",__func__, temp[0]);

			return SMSM_SYSTEM_REBOOT;
		}

		return 0;
	}

  	if(BLUE_ERROR_HANDLER_LEVEL != 0) {
		
		if (get_suspend_state() != PM_SUSPEND_ON) {
		
			lcd_suspend = 0;
		}
		
		switch(crash_side) {
			case MODEM_CRASH:
			case APPL_CRASH:
			case ANDROID_CRASH:
				if(!LG_ErrorHandler_enable) {
					LG_ErrorHandler_enable	= 1;
					raw_local_irq_enable();
					if (message != NULL)
						display_info_LCD(crash_side, message);
				}
				break;
			case ANDROID_DISPLAY_INFO :
				if (message != NULL)
					display_info_LCD(crash_side, message);
				return 0;

			default : 
				break;
				
		}
  	}

	raw_local_irq_disable();
	preempt_disable();

	smsm_reset_modem(SMSM_APPS_SHUTDOWN); 

  	if(BLUE_ERROR_HANDLER_LEVEL == 0) {		
		mdelay(100);
		return SMSM_SYSTEM_REBOOT;
  	}

	while(1)
	{
		gpio_set_value(36,0);
		gpio_set_value(32,1);
		gpio_set_value(33,1);
		
		if(gpio_get_value(38)==0) {
			printk("Pressed Volume up key\n");
			return SMSM_SYSTEM_DOWNLOAD; 
		} else if(gpio_get_value(37) ==0 ) {
			printk("Pressed Volume down key\n");
			return SMSM_SYSTEM_REBOOT; 
		}

		mdelay(200);
	
	
		;
	}

 }