Changeset 4164


Ignore:
Timestamp:
03/04/08 11:48:00 (5 years ago)
Author:
werner
Message:

This ports wake-up reason handling forward from GTA01. In particular, it makes
sure that we don't power up unless the POWER button is held down for a while.

The user interaction of all this still needs a bit of fine-tuning.

uboot-gta02.patch:

  • board/neo1973/gta02/gta02.c (board_late_init): enabled wake-up reason handling and updated it for the PCF50633

gta02-bootmenu.patch: updated context for above change
nor-bootmenu.patch:

  • updated context
  • board/neo1973/gta02/gta02.c (board_late_init): examine wakeup reason also on NOR boot
Location:
trunk/src/target/u-boot/patches
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/u-boot/patches/gta02-bootmenu.patch

    r4070 r4164  
    33--- u-boot.orig/board/neo1973/gta02/gta02.c 
    44+++ u-boot/board/neo1973/gta02/gta02.c 
    5 @@ -241,10 +241,10 @@ 
    6         gpio->GPJDAT |= 0x000000001;    /* GTA02v1_GPIO_3D_RESET */ 
    7  #endif 
    8   
    9 -#if 0 
    10         /* if there's no other reason, must be regular reset */ 
    11         neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; 
    12   
    13 +#if 0 
    14         if (!booted_from_nand) 
    15                 goto woken_by_reset; 
    16   
    17 @@ -274,6 +274,7 @@ 
    18         } 
    19   
    20  woken_by_reset: 
    21 +#endif 
    22   
    23         while (neo1973_wakeup_cause == NEO1973_WAKEUP_RESET || 
    24             neo1973_on_key_pressed()) { 
    25 @@ -294,7 +295,6 @@ 
    26         jbt6k74_init(); 
    27         jbt6k74_enter_state(JBT_STATE_NORMAL); 
    28         jbt6k74_display_onoff(1); 
    29 -#endif 
    30   
    31  #if 0 
    32         { 
    33 @@ -303,12 +303,12 @@ 
     5@@ -306,12 +306,12 @@ continue_boot: 
    346                if (!(gpio->GPFDAT & (1 << 5))) 
    357                        gpio->GPBDAT &= ~(1 << 2); 
     
    4618        return 0; 
    4719 } 
    48 @@ -403,13 +403,11 @@ 
     20@@ -408,13 +408,11 @@ int neo1973_on_key_pressed(void) 
    4921                                                & PCF50633_OOCSTAT_ONKEY); 
    5022 } 
  • trunk/src/target/u-boot/patches/nor-bootmenu.patch

    r4150 r4164  
    2222+ 
    2323+       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 
    24         unsigned char tmp; 
     24        uint8_t int1, int2; 
    2525        char buf[32]; 
    2626        int menu_vote = 0; /* <= 0: no, > 0: yes */ 
    27 @@ -307,7 +309,7 @@ continue_boot: 
     27@@ -246,7 +248,7 @@ int board_late_init(void) 
     28        /* if there's no other reason, must be regular reset */ 
     29        neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; 
     30  
     31-       if (!booted_from_nand) 
     32+       if (!booted_from_nand && !booted_from_nor) 
     33                goto woken_by_reset; 
     34  
     35        /* obtain wake-up reason, save INT1 in environment */ 
     36@@ -308,7 +310,7 @@ continue_boot: 
    2837        } 
    2938 #endif 
  • trunk/src/target/u-boot/patches/uboot-gta02.patch

    r4118 r4164  
    9595--- /dev/null 
    9696+++ u-boot/board/neo1973/gta02/gta02.c 
    97 @@ -0,0 +1,452 @@ 
     97@@ -0,0 +1,455 @@ 
    9898+/* 
    9999+ * (C) 2006-2007 by OpenMoko, Inc. 
     
    308308+       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 
    309309+       extern unsigned char booted_from_nand; 
    310 +       unsigned char tmp; 
     310+       uint8_t int1, int2; 
    311311+       char buf[32]; 
    312312+       int menu_vote = 0; /* <= 0: no, > 0: yes */ 
     
    315315+       /* Initialize the Power Management Unit with a safe register set */ 
    316316+       pcf50633_init(); 
     317+ 
     318+       /* obtain wake-up reason */ 
     319+       int1 = pcf50633_reg_read(PCF50633_REG_INT1); 
     320+       int2 = pcf50633_reg_read(PCF50633_REG_INT2); 
    317321+ 
    318322+       /* switch on one of the power led's */ 
     
    337341+#endif 
    338342+ 
    339 +#if 0 
    340343+       /* if there's no other reason, must be regular reset */ 
    341344+       neo1973_wakeup_cause = NEO1973_WAKEUP_RESET; 
     
    344347+               goto woken_by_reset; 
    345348+ 
    346 +       /* obtain wake-up reason, save INT1 in environment */ 
    347 +       tmp = pcf50606_reg_read(PCF50606_REG_INT1); 
    348 +       sprintf(buf, "0x%02x", tmp); 
    349 +       setenv("pcf50606_int1", buf); 
    350 + 
    351 +       if (tmp & PCF50606_INT1_ALARM) { 
     349+       /* save wake-up reason in environment */ 
     350+       sprintf(buf, "0x%02x", int1); 
     351+       setenv("pcf50633_int1", buf); 
     352+       sprintf(buf, "0x%02x", int2); 
     353+       setenv("pcf50633_int2", buf); 
     354+ 
     355+       if (int1 & PCF50633_INT1_ALARM) { 
    352356+               /* we've been woken up by RTC alarm, boot */ 
    353357+               neo1973_wakeup_cause = NEO1973_WAKEUP_ALARM; 
    354358+               goto continue_boot; 
    355359+       } 
    356 +       if (tmp & PCF50606_INT1_EXTONR) { 
     360+       if (int1 & PCF50633_INT1_USBINS) { 
    357361+               /* we've been woken up by charger insert */ 
    358362+               neo1973_wakeup_cause = NEO1973_WAKEUP_CHARGER; 
    359363+       } 
    360364+ 
    361 +       if (tmp & PCF50606_INT1_ONKEYF) { 
     365+       if (int2 & PCF50633_INT2_ONKEYF) { 
    362366+               /* we've been woken up by a falling edge of the onkey */ 
    363367+               neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY; 
     
    390394+       jbt6k74_enter_state(JBT_STATE_NORMAL); 
    391395+       jbt6k74_display_onoff(1); 
    392 +#endif 
    393396+ 
    394397+       /* switch on the backlight */ 
Note: See TracChangeset for help on using the changeset viewer.