diff --git a/common/main.c b/common/main.c index 82b8fad..a5b8d62 100644 --- a/common/main.c +++ b/common/main.c @@ -574,12 +574,8 @@ static void Encore_boot(void) lcd_adjust_brightness(80); bitmap_plot (864,140,0); //1008,133 boot_normal = 1; + // Now that they see a boot screen, give the user a chance to hold down keys udelay(2000*1000); - - // Now that they see a boot screen, give the user a chance to hold down keys - tps65921_keypad_keys_pressed(&key_pad); - if (gpio_pin_read(14)||key_pad&HOME_KEY||(key_pad&VOLUP_KEY && key_pad&VOLDN_KEY)) - user_req = 1; } else{ if(charger_type){ @@ -695,10 +691,9 @@ static void Encore_boot(void) char *mode_list[3] = {" Normal (uImage/uRamdisk) ", " Recovery (uRecImg/uRecRam) ", " Alternate (uAltImg/uAltRam) "}; int dev_idx = 0; int mode_idx = 0; int *idx; lcd_is_enabled = 1; - if (user_req) { - tps65921_keypad_keys_pressed(&key_pad); + tps65921_keypad_keys_pressed(&key_pad); if (key_pad&HOME_KEY && (gpio_pin_read(14))) - { user_req=0; mode_idx = 1; + { mode_idx = 1; lcd_console_setpos(40, 25); lcd_puts(" Booting into recovery..."); } // recovery boot else if (key_pad&HOME_KEY && (!gpio_pin_read(14))) @@ -707,28 +702,21 @@ static void Encore_boot(void) lcd_puts(" Entering boot menu..."); udelay(1000*1000);} // use the menu else if (key_pad&VOLUP_KEY && key_pad&VOLDN_KEY) - { user_req = 0; mode_idx =2; + { mode_idx =2; lcd_console_setpos(40, 25); lcd_puts("Booting into alternate..."); } // alt boot - else //they pressed buttons, but none of the above - { user_req = 0; mode_idx=0; + else // none of the above + { lcd_console_setpos(40, 25); - lcd_puts(" Booting normally..."); + lcd_puts(" Loading..."); setenv("forcerecovery", "0"); - setenv("customboot", "0");} // normal boot (keypress) - } else { // no keypress at all, no menu... - lcd_console_setpos(40, 25); // normal boot (no keypress) - lcd_puts(" Loading..."); // note this isn't very efficient - setenv("forcerecovery", "0"); - setenv("customboot", "0"); - } + setenv("customboot", "0"); } // normal boot (keypress) - if (user_req) { - // menu was selected... + if (user_req) { // menu was selected lcd_clear (NULL, 1, 1, NULL); lcd_console_setpos(0, 0); - lcd_puts(" Boot Options\n"); - lcd_puts(" ------------\n\n"); + lcd_puts(" Boot Menu\n"); + lcd_puts(" -------------\n\n"); lcd_puts(" Boot Device :\n"); // row 3 lcd_puts(" Boot Mode :\n"); // row 4 lcd_puts("\n Boot Now\n"); //row 6 @@ -739,9 +727,9 @@ static void Encore_boot(void) lcd_puts(" VOL+ moves up.\n"); lcd_puts(" HOME toggles your selection.\n"); lcd_puts("\n\n\n\n\n\n WHAT IS ALTERNATE BOOT?\n\n"); - lcd_puts(" It's an option to boot using an alternative kernel and ramdisk.\n"); - lcd_puts(" It can be used for overclocked kernels or secondary OS boots.\n\n"); - lcd_puts(" To enable, add to the first partition of your boot volume:\n\n"); + lcd_puts(" Cyanogenmod now includes an overclocked (and slightly overvolted)\n"); + lcd_puts(" kernel w/ accompanying ramdisk image. The files for this alternate\n"); + lcd_puts(" boot are in the 1st (/boot) partition of your boot device:\n\n"); lcd_console_setcolor(CONSOLE_COLOR_GRAY, CONSOLE_COLOR_BLACK); lcd_puts(" uAltImg"); lcd_console_setcolor(CONSOLE_COLOR_CYAN, CONSOLE_COLOR_BLACK); @@ -749,16 +737,27 @@ static void Encore_boot(void) lcd_console_setcolor(CONSOLE_COLOR_GRAY, CONSOLE_COLOR_BLACK); lcd_puts(" uAltRam"); lcd_console_setcolor(CONSOLE_COLOR_CYAN, CONSOLE_COLOR_BLACK); - lcd_puts(" -- (the alternate ramdisk)\n\n"); - lcd_puts(" Without these files, the Alt. option will result in a failed boot."); - lcd_puts("\n\n\n CAN I SET A DEFAULT BOOT DEVICE?\n\n"); - lcd_puts(" Yes. You may set the default boot device by creating a file:\n\n"); + lcd_puts(" -- (the alternate ramdisk)"); + lcd_puts("\n\n\n CAN I SET MY DEFAULT BOOT TO ALWAYS USE ALTERNATE BOOT?\n\n"); + lcd_puts(" Yes, by creating a file:\n\n"); + lcd_console_setcolor(CONSOLE_COLOR_GRAY, CONSOLE_COLOR_BLACK); + lcd_puts(" u-boot.altboot\n\n"); + lcd_console_setcolor(CONSOLE_COLOR_CYAN, CONSOLE_COLOR_BLACK); + lcd_puts(" Put it in the 2nd (/rom) partition on your eMMC.\n\n"); + lcd_puts(" Set to \"0\" to default to normal uImage/uRamdisk boot.\n"); + lcd_puts(" Set to \"1\" to default to alternate uAltImg/uAltRam boot.\n\n"); + lcd_console_setcolor(CONSOLE_COLOR_ORANGE, CONSOLE_COLOR_BLACK); + lcd_puts(" NOTE: If set to \"1\" and uAltImg is MISSING on your boot\n"); + lcd_puts(" device, the boot will fall back to uImage/uRamdisk."); + lcd_console_setcolor(CONSOLE_COLOR_CYAN, CONSOLE_COLOR_BLACK); + lcd_puts("\n\n\n CAN I SET MY DEFAULT BOOT DEVICE TO ALWAYS USE EMMC?\n\n"); + lcd_puts(" Yes, by creating a file:\n\n"); lcd_console_setcolor(CONSOLE_COLOR_GRAY, CONSOLE_COLOR_BLACK); lcd_puts(" u-boot.device\n\n"); lcd_console_setcolor(CONSOLE_COLOR_CYAN, CONSOLE_COLOR_BLACK); - lcd_puts(" Put it in the first partition of your boot volume.\n\n"); - lcd_puts(" Setting this file to \"0\" means default boot device is SD card.\n"); - lcd_puts(" Setting this file to \"1\" means default boot device is eMMC."); + lcd_puts(" Put it in the 2nd (/rom) partition on your eMMC.\n\n"); + lcd_puts(" Set to \"0\" for normal default boot.\n"); + lcd_puts(" Set to \"1\" for default boot from eMMC."); lcd_console_setpos(60, 0); lcd_puts(" ------\n Encore U-Boot Menu by j4mm3r.\n 1.2 port + extras by fattire"); opt = 0; diff --git a/include/configs/omap3621_evt1a.h b/include/configs/omap3621_evt1a.h index caecbe3..756d0e0 100755 --- a/include/configs/omap3621_evt1a.h +++ b/include/configs/omap3621_evt1a.h @@ -204,7 +204,7 @@ //This can be used as loading address for gas gauge history data #define LOAD_ADDRESS 0x81C00000 -#define CONFIG_BOOTCOMMAND "run autodetectmmc; run readtokens; run checkbootcount; run checkrom; run checkupdate; run checkbcb; run ${bootvar}" +#define CONFIG_BOOTCOMMAND "run autodetectmmc; run checkforalt; run readtokens; run checkbootcount; run checkrom; run checkupdate; run checkbcb; run ${bootvar}" //#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init" #define CONFIG_BOOTARGS "" @@ -254,14 +254,30 @@ else\ setenv mmcromdev 1;\ fi;\ mmcinit $mmcbootdev;\ +mmcinit ${mmcromdev};\ if itest ${customboot} -eq 0; then\ - if fatload mmc $mmcbootdev 0x81c00000 u-boot.device 1; then \ + if fatload mmc ${mmcromdev}:2 0x81c00000 u-boot.device 1; then \ setenvmem mmcbootdev 0x81c00000 1;\ setenvmem mmcromdev 0x81c00000 1;\ fi;\ fi"\ "\0" \ \ +"checkforalt=\ +if itest ${customboot} -eq 0; then\ + mmcinit ${mmcromdev};\ + if fatload mmc ${mmcromdev}:2 0x81c00000 u-boot.altboot 1; then \ + mmcinit ${mmcbootdev};\ + fatload mmc ${mmcbootdev} 0x81c00000 uAltImg 1;\ + if itest.l $? -ne 0; then\ + echo Missing uAltImg so no altboot;\ + else\ + setenv bootvar altboot;\ + fi;\ + fi;\ +fi"\ + "\0" \ +\ "readtokens=if fatload mmc ${mmcromdev}:2 0x81c00000 devconf/DeviceID 100; then\ setenvmem serialnum 0x81c00000 0x$filesize;\ fi;\