static void kdump_ui(struct mrdump_control_block *mrdump_cblock) { video_clean_screen(); video_set_cursor(0, 0); mrdump_status_error("Unknown error\n"); voprintf_info("Kdump triggerd by '%s'\n", mrdump_mode2string(mrdump_cblock->crash_record.reboot_mode)); struct aee_timer elapse_time; aee_timer_init(&elapse_time); uint32_t total_dump_size = memory_size(); aee_timer_start(&elapse_time); switch (mrdump_cblock->machdesc.output_device) { case MRDUMP_DEV_NULL: kdump_null_output(mrdump_cblock, total_dump_size); break; #if 0 case MRDUMP_DEV_SDCARD: kdump_sdcard_output(mrdump_cblock, total_dump_size); break; #endif case MRDUMP_DEV_EMMC: kdump_emmc_output(mrdump_cblock, total_dump_size); break; default: voprintf_error("Unknown device id %d\n", mrdump_cblock->machdesc.output_device); } aee_timer_stop(&elapse_time); voprintf_info("Reset count down %d ...\n", MRDUMP_DELAY_TIME); mtk_wdt_restart(); int timeout = MRDUMP_DELAY_TIME; while(timeout-- >= 0) { mdelay(1000); mtk_wdt_restart(); voprintf_info("\rsec %d", timeout); } aee_mrdump_flush_cblock(); video_clean_screen(); video_set_cursor(0, 0); }
static void init_display_xy() { #if defined(DISPLAY_INFO_ON_LCM) video_clean_screen(); video_set_cursor(video_get_rows()/2, 0); //video_set_cursor(1, 0); #endif }
/* Do any target specific intialization needed before entering fastboot mode */ void target_fastboot_init(void) { // #if defined (FASTBOOT_USERDEBUG) /* jjm_l10 */ mt_disp_show_black_screen(); video_clean_screen(); video_set_cursor(video_get_rows()/4, 0); video_printf("[Fastboot Mode Entered!]\n"); #endif // }
void fastboot_boot_menu(void) { const char* title_msg = "Select Boot Mode:\n[VOLUME_UP to select. VOLUME_DOWN is OK.]\n\n"; video_clean_screen(); video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] <<==\n"); #endif video_printf("[Normal Boot] \n"); #ifndef USER_BUILD video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif video_printf(" => FASTBOOT mode...\n"); }
void lock_warranty(void) { const char* title_msg = "lock bootloader?\n\n"; video_clean_screen(); video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("If you lock the bootloader,you will need to install official operating\n"); video_printf("system software on this phone.\n\n"); video_printf("To prevent unauthorized access to your personal data,locking the bootloader\n"); video_printf("will also delete all personal data from your phone(a \"factory data reset\").\n\n"); video_printf("Press the Volume UP/Down buttons to select Yes or No. \n\n"); video_printf("Yes (Volume UP):Lock bootloader.\n\n"); video_printf("No (Volume Down):Do not lock bootloader.\n\n"); }
void unlock_warranty(void) { const char* title_msg = "Unlock bootloader?\n\n"; video_clean_screen(); video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("If you unlock the bootloader,you will be able to install custom operating\n"); video_printf("system software on this phone.\n\n"); video_printf("A custom OS is not subject to the same testing as the original OS, and can\n"); video_printf("cause your phone and installed applications to stop working properly.\n\n"); video_printf("To prevent unauthorized access to your personal data,unlocking the bootloader\n"); video_printf("will also delete all personal data from your phone(a \"factory data reset\").\n\n"); video_printf("Press the Volume UP/Down buttons to select Yes or No. \n\n"); video_printf("Yes (Volume UP):Unlock(may void warranty).\n\n"); video_printf("No (Volume Down):Do not unlock bootloader.\n\n"); }
void boot_mode_menu_select() { int select = 0; // 0=recovery mode, 1=fastboot. 2=normal boot 3=normal boot + ftrace.4=slub debug off const char* title_msg = "Select Boot Mode:\n[VOLUME_UP to select. VOLUME_DOWN is OK.]\n\n"; video_clean_screen(); video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] <<==\n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); #ifndef USER_BUILD video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif while(1) { if(mtk_detect_key(MT65XX_MENU_SELECT_KEY))//VOL_UP { g_boot_menu = true; switch(select) { case 0: #ifdef MTK_FASTBOOT_SUPPORT select = 1; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); video_printf("[Fastboot Mode] <<==\n"); video_printf("[Normal Boot] \n"); #ifndef USER_BUILD video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif break; #endif case 1: select = 2; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] <<==\n"); #ifndef USER_BUILD video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif break; case 2: #ifdef USER_BUILD select = 0; #else select = 3; #endif video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); #ifdef USER_BUILD video_printf("[Recovery Mode] <<==\n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); #else video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); video_printf("[Normal Boot +ftrace] <<==\n"); video_printf("[Normal slub debug off] \n"); #endif break; #ifndef USER_BUILD case 3: select = 4; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] <<==\n"); break; #endif #ifndef USER_BUILD case 4: select = 0; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] <<==\n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); break; #endif default: break; } dprintf(CRITICAL, "[VOL_UP]Key Detect, current select:%d\n", select); mdelay(300); } else if(mtk_detect_key(MT65XX_MENU_OK_KEY))//VOL_DOWN, { //use for OK break; } else { //pass } } if(select == 0) { g_boot_mode = RECOVERY_BOOT; } else if(select == 1) { g_boot_mode = FASTBOOT; } else if(select == 2) { g_boot_mode = NORMAL_BOOT; } else if(select == 3) { sprintf(g_CMDLINE, "%s trace_buf_size=11m boot_time_ftrace", g_CMDLINE); g_boot_mode = NORMAL_BOOT; } else if (select == 4) { sprintf(g_CMDLINE, "%s slub_debug=-", g_CMDLINE); g_boot_mode = NORMAL_BOOT; } else{ //pass } video_printf("\n"); return; }
// check the boot mode : (1) meta mode or (2) recovery mode ... void boot_mode_select(void) { //Ivan ulong begin; if (meta_detection()) { return; } #if defined (HAVE_LK_TEXT_MENU) if(Check_RTC_PDN1_bit13()) { printf("[FASTBOOT] reboot to boot loader\n"); g_boot_mode = FASTBOOT; Set_Clr_RTC_PDN1_bit13(false); return; } //Ivan #ifdef MENU_BOOT_ENABLE boot_mode_dkey_check(); if (g_boot_mode == MENU_BOOT) { /* clean console screen */ video_clean_screen(); // mt65xx_disp_fill_rect(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT, 0x0); video_set_cursor(2,0); video_printf("Recovery Mode: Volume Up\r\n"); video_set_cursor(4,0); video_printf("Factory Mode: Volume Down\r\n"); // mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT); mt65xx_backlight_on(); video_set_cursor(49,0); while (mt65XX_get_key() != 0xFFFF); printf(" > Key release!!!\n"); mdelay(500); //Ivan added mtk_wdt_restart(); begin = get_timer(0); while (g_boot_mode == MENU_BOOT) { if (factory_detection()) { video_clean_screen(); return; } if(boot_menu_detection())//recovery, fastboot, normal boot. { video_clean_screen(); return; } //Ivan add 20s time limit if (get_timer(begin) < 20000) mtk_wdt_restart(); } // video_clean_screen(); // mt65xx_disp_fill_rect(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT, 0x0); // mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT); // video_set_cursor(49,0); // mt65xx_disp_wait_idle(); } if(Check_RTC_Recovery_Mode()) { g_boot_mode = RECOVERY_BOOT; } recovery_check_command_trigger(); #else //MENU_BOOT_ENABLE if (factory_detection()) { return; } if(boot_menu_detection())//recovery, fastboot, normal boot. { return; } recovery_detection(); #endif //MENU_BOOT_ENABLE #else //HAVE_LK_TEXT_MENU #ifdef MTK_FASTBOOT_SUPPORT if(fastboot_trigger()) { return; } #endif //MTK_FASTBOOT_SUPPORT if (factory_detection()) { return; } if(recovery_detection()) { //************************************** //* CHECK IMAGE //************************************** if(DRV_Reg32(0x40002300)==0xE92D4800) { printf(" > do recovery_check\n"); //jump(0x40002300); } else { printf(" > bypass recovery_check\n"); } return; } #endif #ifdef MTK_KERNEL_POWER_OFF_CHARGING if(kernel_power_off_charging_detection()) { printf(" < Kernel Power Off Charging Detection Ok> \n"); return; } else { printf("< Kernel Enter Normal Boot > \n"); } #endif }
void boot_mode_menu_select() { int select = 0; // 0=recovery mode, 1=fastboot. 2=normal boot 3=normal boot + ftrace.4=slub debug off const char* title_msg = "Select Boot Mode:\n[VOLUME_UP to select. VOLUME_DOWN is OK.]\n\n"; mt65xx_backlight_on(); video_clean_screen(); video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] <<==\n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); #if !defined(USER_BUILD) || defined(MTK_BUILD_ROOT) video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif while (1) { if (mtk_detect_key(MT65XX_MENU_SELECT_KEY)) { //VOL_UP g_boot_menu = true; switch (select) { case 0: #ifdef MTK_FASTBOOT_SUPPORT select = 1; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); video_printf("[Fastboot Mode] <<==\n"); video_printf("[Normal Boot] \n"); #if !defined(USER_BUILD) || defined(MTK_BUILD_ROOT) video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif break; #endif case 1: select = 2; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] <<==\n"); #if !defined(USER_BUILD) || defined(MTK_BUILD_ROOT) video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); #endif break; case 2: #if defined(USER_BUILD) && !defined(MTK_BUILD_ROOT) select = 0; #else select = 3; #endif video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); #if defined(USER_BUILD) && !defined(MTK_BUILD_ROOT) video_printf("[Recovery Mode] <<==\n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); #else video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); video_printf("[Normal Boot +ftrace] <<==\n"); video_printf("[Normal slub debug off] \n"); #endif break; #if !defined(USER_BUILD) || defined(MTK_BUILD_ROOT) case 3: select = 4; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] \n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] <<==\n"); break; #endif #if !defined(USER_BUILD) || defined(MTK_BUILD_ROOT) case 4: select = 0; video_set_cursor(video_get_rows()/2, 0); video_printf(title_msg); video_printf("[Recovery Mode] <<==\n"); #ifdef MTK_FASTBOOT_SUPPORT video_printf("[Fastboot Mode] \n"); #endif video_printf("[Normal Boot] \n"); video_printf("[Normal Boot +ftrace] \n"); video_printf("[Normal slub debug off] \n"); break; #endif default: break; } dprintf(0, "[VOL_UP]Key Detect, current select:%d\n", select); mdelay(300); } else if (mtk_detect_key(MT65XX_MENU_OK_KEY)) { //VOL_DOWN, //use for OK break; } else { //pass } } if (select == 0) { g_boot_mode = RECOVERY_BOOT; } else if (select == 1) { g_boot_mode = FASTBOOT; } else if (select == 2) { g_boot_mode = NORMAL_BOOT; } else if (select == 3) { cmdline_append("boot_trace"); g_boot_mode = NORMAL_BOOT; } else if (select == 4) { cmdline_append("slub_debug=-"); g_boot_mode = NORMAL_BOOT; } else { //pass } video_set_cursor(video_get_rows()/2 +8, 0); return; }