Changeset 1283 for trunk/src/target/u-boot/patches/boot-menu.patch
- Timestamp:
- 03/08/07 23:04:04 (6 years ago)
- File:
-
- 1 edited
-
trunk/src/target/u-boot/patches/boot-menu.patch (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/u-boot/patches/boot-menu.patch
r1193 r1283 12 12 u-boot/common/console.c, include/console.h: added "console_poll_hook" to be 13 13 called when waiting for console in put in "getc" and "tstc" 14 board/neo1973/neo1973.c (board_late_init): poll for the boot menu also on RAM 15 boot, reset, or unknown cause 16 board/neo1973/neo1973.c (board_late_init): don't look for the power key if 17 woken up by the charger 14 18 15 19 - Werner Almesberger <werner@openmoko.org> … … 359 363 --- u-boot.orig/board/neo1973/neo1973.c 360 364 +++ u-boot/board/neo1973/neo1973.c 361 @@ -196, 6 +196,7@@ int board_late_init(void)365 @@ -196,10 +196,15 @@ int board_late_init(void) 362 366 extern unsigned char booted_from_nand; 363 367 unsigned char tmp; 364 368 char buf[32]; 365 369 + int menu_vote = 0; /* <= 0: no, > 0: yes */ 370 + int seconds = 0; 366 371 367 372 /* Initialize the Power Management Unit with a safe register set */ 368 373 pcf50606_init(); 369 @@ -219,25 +220,18 @@ int board_late_init(void) 374 375 + /* if there's no other reason, must be regular reset */ 376 + neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; 377 + 378 if (!booted_from_nand) 379 goto woken_by_reset; 380 381 @@ -209,45 +214,41 @@ int board_late_init(void) 382 setenv("pcf50606_int1", buf); 383 384 if (tmp & PCF50606_INT1_ALARM) { 385 - /* we've been woken up by RTC alarm or charger insert, boot */ 386 + /* we've been woken up by RTC alarm, boot */ 387 neo1973_wakeup_cause = NEO1973_WAKEUP_ALARM; 388 goto continue_boot; 389 } 390 if (tmp & PCF50606_INT1_EXTONR) { 391 + /* we've been woken up by charger insert */ 392 neo1973_wakeup_cause = NEO1973_WAKEUP_CHARGER; 393 } 370 394 371 395 if (tmp & PCF50606_INT1_ONKEYF) { 372 int seconds = 0; 373 + 374 neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY; 396 - int seconds = 0; 397 - neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY; 375 398 /* we've been woken up by a falling edge of the onkey */ 399 + neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY; 400 + } 376 401 377 402 - /* we can't just setenv(bootdelay,-1) because that would … … 386 411 - if (oocs & PFC50606_OOCS_ONKEY) 387 412 - break; 388 + while (neo1973_on_key_pressed()) { 389 + if (neo1973_911_key_pressed()) 390 + menu_vote++; 391 + else 392 + menu_vote--; 393 413 - 394 414 - int1 = pcf50606_reg_read(PCF50606_REG_INT1); 395 415 - if (int1 & PCF50606_INT1_SECOND) 396 + if (neo1973_new_second()) 397 seconds++; 416 - seconds++; 398 417 - 399 if (seconds >= POWER_KEY_SECONDS) 400 goto continue_boot; 401 } 402 @@ -262,6 +256,11 @@ continue_boot: 418 - if (seconds >= POWER_KEY_SECONDS) 419 - goto continue_boot; 420 - } 421 - /* Power off if minimum number of seconds not reached */ 422 - neo1973_poweroff(); 423 + if (neo1973_wakeup_cause == NEO1973_WAKEUP_CHARGER) { 424 + /* if we still think it was only a charger insert, boot */ 425 + goto continue_boot; 426 } 427 428 woken_by_reset: 429 - /* if there's no other reason, must be regular reset */ 430 - neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; 431 + 432 + while (neo1973_wakeup_cause == NEO1973_WAKEUP_RESET || 433 + neo1973_on_key_pressed()) { 434 + if (neo1973_911_key_pressed()) 435 + menu_vote++; 436 + else 437 + menu_vote--; 438 + 439 + if (neo1973_new_second()) 440 + seconds++; 441 + if (seconds >= POWER_KEY_SECONDS) 442 + goto continue_boot; 443 + } 444 + /* Power off if minimum number of seconds not reached */ 445 + neo1973_poweroff(); 446 447 continue_boot: 448 jbt6k74_init(); 449 @@ -262,6 +263,11 @@ continue_boot: 403 450 /* switch on the backlight */ 404 451 neo1973_backlight(1); … … 412 459 } 413 460 414 @@ -313,6 +31 2,16 @@ void neo1973_vibrator(int on)461 @@ -313,6 +319,16 @@ void neo1973_vibrator(int on) 415 462 gpio->GPBDAT &= ~(1 << 10); 416 463 }
Note: See TracChangeset
for help on using the changeset viewer.
