Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r4272 - in
      trunk/src/target/OM-2007.2/applications/openmoko-dialer2: .
      src/dialer ([EMAIL PROTECTED])
   2. r4273 - in
      trunk/src/target/OM-2007.2/applications/openmoko-messages2: . src
      ([EMAIL PROTECTED])
   3. r4274 - in
      trunk/src/target/OM-2007.2/applications/openmoko-dialer2: .
      src/dialer ([EMAIL PROTECTED])
   4. r4275 - in
      trunk/src/target/OM-2007.2/applications/openmoko-messages2: . src
      ([EMAIL PROTECTED])
   5. r4276 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: thomas
Date: 2008-03-31 12:11:35 +0200 (Mon, 31 Mar 2008)
New Revision: 4272

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
Log:
2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>

        * src/dialer/dialer-main.c: (dial_clicked_cb), (program_log),
        (main): Add profiling helper code


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2008-03-31 08:28:55 UTC (rev 4271)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2008-03-31 10:11:35 UTC (rev 4272)
@@ -1,3 +1,8 @@
+2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * src/dialer/dialer-main.c: (dial_clicked_cb), (program_log),
+       (main): Add profiling helper code
+
 2008-03-27  Erin Yueh  <[EMAIL PROTECTED]>
 
        * src/phone-kit/moko-sms.c: (on_incoming_ds): display status report icon

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
   2008-03-31 08:28:55 UTC (rev 4271)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
   2008-03-31 10:11:35 UTC (rev 4272)
@@ -16,6 +16,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
+
 #include <gtk/gtk.h>
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-bindings.h>
@@ -78,6 +80,26 @@
   }
 }
 
+static void
+program_log (const char *format, ...)
+{
+  va_list args;
+  char *formatted, *str;
+
+  if (!getenv ("OM_PROFILING"))
+    return;
+
+  va_start (args, format);
+  formatted = g_strdup_vprintf (format, args);
+  va_end (args);
+
+  str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), formatted);
+  g_free (formatted);
+
+  access (str, F_OK);
+  g_free (str);
+}
+
 int main (int argc, char **argv)
 {
   GtkWidget *window, *keypad;
@@ -86,6 +108,8 @@
   GError *error = NULL;
   DialerData *data;
 
+  program_log ("start dialer");
+
   data = g_new0 (DialerData, 1);
 
   if (argc != 1)
@@ -102,9 +126,16 @@
   }
 
   /* Initialize Threading & GTK+ */
+  program_log ("gtk_init");
   gtk_init (&argc, &argv);
+
+  /* application object */
+  g_set_application_name ("OpenMoko Dialer");
+
+  program_log ("moko_stock_register");
   moko_stock_register ();
 
+  program_log ("open connection to dbus");
   connection = dbus_g_bus_get (DBUS_BUS_SESSION,
                                &error);
   if (connection == NULL)
@@ -120,14 +151,13 @@
     exit (1);
   }
 
+  program_log ("get PhoneKit dbus proxy object");
   data->dialer_proxy = dbus_g_proxy_new_for_name (connection,
       "org.openmoko.PhoneKit",
       "/org/openmoko/PhoneKit/Dialer", "org.openmoko.PhoneKit.Dialer");
 
-   /* application object */
-  g_set_application_name ("OpenMoko Dialer");
-
   /* Set up the journal */
+  program_log ("load journal");
   journal = moko_journal_open_default ();
   if (!journal || !moko_journal_load_from_storage (journal))
   {
@@ -135,6 +165,7 @@
     journal = NULL;
   }
 
+  program_log ("create main window");
   data->main_window = window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_widget_set_name (window, "openmoko-dialer-window");
   g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
@@ -155,6 +186,7 @@
   gtk_container_child_set (GTK_CONTAINER (data->notebook), keypad, 
"tab-expand", TRUE, NULL);
 
   /* History */
+  program_log ("create history widget");
   data->history = moko_history_new (journal);
   g_signal_connect (data->history, "dial_number", G_CALLBACK 
(dial_clicked_cb), data);
   gtk_notebook_append_page (GTK_NOTEBOOK (data->notebook), data->history,
@@ -164,6 +196,7 @@
                            "tab-expand", TRUE,
                            NULL);
 
+  program_log ("show window");
   gtk_widget_show_all (window);
 
   if (show_missed)
@@ -171,6 +204,7 @@
   else
     gtk_notebook_set_current_page (GTK_NOTEBOOK (data->notebook), 0);
 
+  program_log ("enter main loop");
   gtk_main ();
 
   g_free (data);




--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-03-31 13:30:00 +0200 (Mon, 31 Mar 2008)
New Revision: 4273

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c
Log:
openmoko-messages2: fix send key problem


Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-03-31 10:11:35 UTC (rev 4272)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-03-31 11:30:00 UTC (rev 4273)
@@ -1,3 +1,8 @@
+2008-03-31  Erin Yueh  <[EMAIL PROTECTED]>
+
+       * src/sms-compose.c: (sms_compose_page_new):
+       fix send key problem    
+
 2008-03-28  Thomas Wood  <[EMAIL PROTECTED]>
 
        * src/sms-compose.c: (page_shown), (sms_compose_page_new):

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c    
    2008-03-31 10:11:35 UTC (rev 4272)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-compose.c    
    2008-03-31 11:30:00 UTC (rev 4273)
@@ -245,7 +245,7 @@
        gtk_tool_item_set_expand (data->new_button, TRUE);
        gtk_toolbar_insert (GTK_TOOLBAR (toolbar), data->new_button, -1);
        g_signal_connect (data->new_button, "clicked",
-               G_CALLBACK (send_clicked_cb), &data);
+               G_CALLBACK (send_clicked_cb), data);
        
        /* Create contact info display/number entry */
        contact_table = gtk_table_new (2, 2, FALSE);




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2008-03-31 14:54:40 +0200 (Mon, 31 Mar 2008)
New Revision: 4274

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
   
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/moko-keypad.c
Log:
2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>

        * src/dialer/dialer-main.c: (main):
        * src/dialer/moko-keypad.c: (moko_keypad_init):

        Attempt to improve performance by removing use of moko_stock


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2008-03-31 11:30:00 UTC (rev 4273)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog  
2008-03-31 12:54:40 UTC (rev 4274)
@@ -1,5 +1,12 @@
 2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>
 
+       * src/dialer/dialer-main.c: (main):
+       * src/dialer/moko-keypad.c: (moko_keypad_init):
+
+       Attempt to improve performance by removing use of moko_stock
+
+2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>
+
        * src/dialer/dialer-main.c: (dial_clicked_cb), (program_log),
        (main): Add profiling helper code
 

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
   2008-03-31 11:30:00 UTC (rev 4273)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/dialer-main.c
   2008-03-31 12:54:40 UTC (rev 4274)
@@ -22,8 +22,6 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-bindings.h>
 
-#include <moko-stock.h>
-
 #include "moko-keypad.h"
 #include "moko-history.h"
 
@@ -132,9 +130,6 @@
   /* application object */
   g_set_application_name ("OpenMoko Dialer");
 
-  program_log ("moko_stock_register");
-  moko_stock_register ();
-
   program_log ("open connection to dbus");
   connection = dbus_g_bus_get (DBUS_BUS_SESSION,
                                &error);
@@ -190,7 +185,7 @@
   data->history = moko_history_new (journal);
   g_signal_connect (data->history, "dial_number", G_CALLBACK 
(dial_clicked_cb), data);
   gtk_notebook_append_page (GTK_NOTEBOOK (data->notebook), data->history,
-                            gtk_image_new_from_stock (MOKO_STOCK_CALL_HISTORY,
+                            gtk_image_new_from_icon_name ("moko-call-history",
                                                       GTK_ICON_SIZE_BUTTON));
   gtk_container_child_set (GTK_CONTAINER (data->notebook), data->history,
                            "tab-expand", TRUE,

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/moko-keypad.c
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/moko-keypad.c
   2008-03-31 11:30:00 UTC (rev 4273)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/dialer/moko-keypad.c
   2008-03-31 12:54:40 UTC (rev 4274)
@@ -20,8 +20,6 @@
 #include <gtk/gtk.h>
 #include <gtk/gtk.h>
 
-#include <moko-stock.h>
-
 #include "moko-keypad.h"
 
 #include "moko-contacts.h"
@@ -355,7 +353,6 @@
 {
   MokoKeypadPrivate *priv;
   GtkWidget *hbox, *vbox;
-  GtkStockItem stock_item;
   GtkWidget *bvbox, *icon, *label, *align;
 
   priv = keypad->priv = MOKO_KEYPAD_GET_PRIVATE (keypad);
@@ -411,11 +408,10 @@
   bvbox = gtk_vbox_new (FALSE, 0);
   align = gtk_alignment_new (0.5, 0.5, 1, 0);
   
-  icon = gtk_image_new_from_stock (MOKO_STOCK_CALL_DIAL, GTK_ICON_SIZE_BUTTON);
+  icon = gtk_image_new_from_icon_name ("moko-call-dial", GTK_ICON_SIZE_BUTTON);
   gtk_box_pack_start (GTK_BOX (bvbox), icon, FALSE, FALSE, 0);
   
-  gtk_stock_lookup (MOKO_STOCK_CALL_DIAL, &stock_item);
-  label = gtk_label_new (stock_item.label);
+  label = gtk_label_new ("Dial");
   priv->dial_label = label;
   gtk_box_pack_start (GTK_BOX (bvbox), label, FALSE, FALSE, 0);
   




--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2008-03-31 19:04:58 +0200 (Mon, 31 Mar 2008)
New Revision: 4275

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c
   trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h
Log:
2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>

        * src/sms-notes.c: (page_shown), (sms_notes_page_new):
        * src/sms.h:

        Add a "new contact" button and display only when sender is unknown


Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-03-31 12:54:40 UTC (rev 4274)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog        
2008-03-31 17:04:58 UTC (rev 4275)
@@ -1,3 +1,10 @@
+2008-03-31  Thomas Wood  <[EMAIL PROTECTED]>
+
+       * src/sms-notes.c: (page_shown), (sms_notes_page_new):
+       * src/sms.h:
+
+       Add a "new contact" button and display only when sender is unknown
+
 2008-03-31  Erin Yueh  <[EMAIL PROTECTED]>
 
        * src/sms-compose.c: (sms_compose_page_new):

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c  
2008-03-31 12:54:40 UTC (rev 4274)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c  
2008-03-31 17:04:58 UTC (rev 4275)
@@ -201,7 +201,10 @@
        
        if (!(contact = sms_get_selected_contact (data))) {
                GList *u, *components = NULL;
-               
+
+               /* show the "add contact" button, as this contact is unknown */
+               gtk_widget_show (GTK_WIDGET (data->save_contact_button));
+
                /* Assume the 'unknown' contact was selected */
                if (data->no_photo) {
                        data->author_icon = g_object_ref (data->no_photo);
@@ -234,7 +237,10 @@
                
                return;
        }
-       
+
+       /* hide the "add contact" button, as this contact is already known */
+       gtk_widget_hide (GTK_WIDGET (data->save_contact_button));
+
        data->author_icon = sms_contact_load_photo (contact);
        if ((!data->author_icon) && (data->no_photo))
                data->author_icon = g_object_ref (data->no_photo);
@@ -891,6 +897,13 @@
        gtk_tool_item_set_expand (data->delete_button, TRUE);
        gtk_toolbar_insert (GTK_TOOLBAR (toolbar), data->delete_button, -1);
        gtk_widget_set_sensitive (GTK_WIDGET (data->delete_button), FALSE);
+
+       /* Save contact button */
+       data->save_contact_button = gtk_tool_button_new_from_stock (
+               MOKO_STOCK_CONTACT_NEW);
+       gtk_tool_item_set_expand (data->save_contact_button, TRUE);
+       gtk_toolbar_insert (GTK_TOOLBAR (toolbar), data->save_contact_button, 
-1);
+       gtk_widget_hide (GTK_WIDGET (data->save_contact_button));
        
        /* Create search bar */
        notes_combo = gtk_combo_box_new_text ();

Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h        
2008-03-31 12:54:40 UTC (rev 4274)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms.h        
2008-03-31 17:04:58 UTC (rev 4275)
@@ -62,6 +62,7 @@
        GtkToolItem *forward_button;
        GtkToolItem *delete_all_button;
        GtkToolItem *delete_button;
+       GtkToolItem *save_contact_button;
 
        GtkWidget *notes_search;
        GdkPixbuf *author_icon;




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-03-31 19:20:54 +0200 (Mon, 31 Mar 2008)
New Revision: 4276

Added:
   trunk/src/target/u-boot/patches/gpb-shadow.patch
   trunk/src/target/u-boot/patches/wait-for-power.patch
Removed:
   trunk/src/target/u-boot/patches/nor-default-env.patch
   trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch
Modified:
   trunk/src/target/u-boot/patches/series
Log:
Change startup behaviour such that the LCM backlight serves as an indicator
that POWER can be released. Also flash the red LED briefly when powering up.
Doing this sensibly required adding a work-around for the GTA02v5 LED bug,
which is in gpb-shadow.patch

series, nor-default-env.patch:
- we have a better way to accomplish what nor-default-env.patch was intended to
  do. Removed it.
  
series, wait-for-power-DONTUSE.patch:
- renamed wait-for-power-DONTUSE.patch to wait-for-power.patch and activated it
  in "series"
- board/neo1973/gta02/gta02.c (wait_for_power): removed minimum battery voltage
  condition
- board/neo1973/gta02/gta02.c (board_late_init): activate the red LED for 20ms,
  while the vibrator is running (note: this only has a visible effect on
  GTA02v6 and above) 

series, gpb-shadow.patch:
- board/neo1973/gta02/gta02.c (neo1973_vibrator, neo1973_led): shadow the LED
  state to work around GTA02v5 bug



Added: trunk/src/target/u-boot/patches/gpb-shadow.patch
===================================================================
--- trunk/src/target/u-boot/patches/gpb-shadow.patch    2008-03-31 17:04:58 UTC 
(rev 4275)
+++ trunk/src/target/u-boot/patches/gpb-shadow.patch    2008-03-31 17:20:54 UTC 
(rev 4276)
@@ -0,0 +1,43 @@
+GTA02v5 pulls the GPBn lines controlling the LEDs down too strongly.
+Thus bit operations on GPB always contain a 0 in these bits. With
+the addition of a shadow register, this problem is avoided.
+
+- Werner
+
+Index: u-boot/board/neo1973/gta02/gta02.c
+===================================================================
+--- u-boot.orig/board/neo1973/gta02/gta02.c
++++ u-boot/board/neo1973/gta02/gta02.c
+@@ -67,6 +67,7 @@
+ extern unsigned char booted_from_nand;
+ extern unsigned char booted_from_nor;
+ extern int nobootdelay;
++static uint16_t gpb_shadow = 0; /* to work around GTA02v5 LED bug */
+ 
+ static inline void delay (unsigned long loops)
+ {
+@@ -388,6 +389,7 @@
+ #else
+               gpio->GPBDAT &= ~(1 << 3);      /* GPB3 */
+ #endif
++      gpio->GPBDAT |= gpb_shadow;
+ }
+ 
+ void neo1973_gsm(int on)
+@@ -507,8 +509,12 @@
+       if (led > 2)
+               return;
+ 
+-      if (on)
+-              gpio->GPBDAT |= (1 << led);
+-      else
+-              gpio->GPBDAT &= ~(1 << led);
++      if (on) {
++              gpb_shadow |= (1 << led);
++              gpio->GPBDAT |= gpb_shadow;
++      }
++      else {
++              gpb_shadow &= ~(1 << led);
++              gpio->GPBDAT = (gpio->GPBDAT | gpb_shadow) & ~(1 << led);
++      }
+ }

Deleted: trunk/src/target/u-boot/patches/nor-default-env.patch
===================================================================
--- trunk/src/target/u-boot/patches/nor-default-env.patch       2008-03-31 
17:04:58 UTC (rev 4275)
+++ trunk/src/target/u-boot/patches/nor-default-env.patch       2008-03-31 
17:20:54 UTC (rev 4276)
@@ -1,91 +0,0 @@
-This patch makes u-boot use the default environment is booting from NOR. That
-way, we can be sure no contamination occurs from a possibly severely upset
-NAND.
-
-nor-default-env.patch:
-- cpu/arm920t/start.S, common/env_common.c (env_relocate): new configuration
-  option CFG_DEFAULT_ENV_IF_NOR to use the default environment (and not try to
-  load it from NAND) if booting from NOR
-- cpu/arm920t/start.S (booted_from_nor): set this flag if booting from NOR
-- include/configs/neo1973_gta02.h: set CFG_DEFAULT_ENV_IF_NOR
-
-Signed-off-by: Werner Almesberger <[EMAIL PROTECTED]>
-
-Index: u-boot/common/env_common.c
-===================================================================
---- u-boot.orig/common/env_common.c
-+++ u-boot/common/env_common.c
-@@ -34,6 +34,10 @@
- extern char *preboot_override;
- #endif
- 
-+#ifdef CFG_DEFAULT_ENV_IF_NOR
-+extern unsigned char booted_from_nor;
-+#endif
-+
- DECLARE_GLOBAL_DATA_PTR;
- 
- #ifdef CONFIG_AMIGAONEG3SE
-@@ -257,6 +261,13 @@
-               gd->env_valid = 0;
- #endif
- 
-+#ifdef CFG_DEFAULT_ENV_IF_NOR
-+      if (booted_from_nor && gd->env_valid) {
-+              puts("NOR boot, using default environment\n\n");
-+              gd->env_valid = 0;
-+      }
-+#endif
-+
-       if (gd->env_valid == 0)
-               default_env();
-       else {
-Index: u-boot/cpu/arm920t/start.S
-===================================================================
---- u-boot.orig/cpu/arm920t/start.S
-+++ u-boot/cpu/arm920t/start.S
-@@ -99,6 +99,16 @@
-       .word   booted_from_nand
- #endif /* CONFIG_S3C2410_NAND_BOOT */
- 
-+#ifdef CFG_DEFAULT_ENV_IF_NOR
-+.globl        booted_from_nor
-+booted_from_nor:
-+      .word   0
-+_booted_from_nor:
-+      .word   booted_from_nor
-+_end_if_0:
-+      .word   __bss_start-_start
-+#endif /* CFG_DEFAULT_ENV_IF_NOR */
-+
- _TEXT_BASE:
-       .word   TEXT_BASE
- 
-@@ -382,6 +392,15 @@
-       stmia   r1!, {r3-r10}           /* copy to   target address [r1]    */
-       cmp     r0, r2                  /* until source end address [r2]    */
-       ble     copy_loop
-+
-+#ifdef CFG_DEFAULT_ENV_IF_NOR
-+      ldr     r0, _end_if_0           /* are we booting from NOR ? */
-+      cmp     r0, r2
-+      ldreq   r0, _booted_from_nor    /* remember that we've booted from  */
-+      moveq   r1, #1                  /* NOR                              */
-+      streqb  r1, [r0]
-+#endif /* CFG_DEFAULT_ENV_IF_NOR */
-+
-       mov     r0, #0                  /* flush v3/v4 cache */
-       mcr     p15, 0, r0, c7, c7, 0
-       ldr     pc, _done_relocate      /* jump to relocated code */
-Index: u-boot/include/configs/neo1973_gta02.h
-===================================================================
---- u-boot.orig/include/configs/neo1973_gta02.h
-+++ u-boot/include/configs/neo1973_gta02.h
-@@ -206,6 +206,7 @@
-  */
- 
- #define       CFG_ENV_IS_IN_NAND      1
-+#define       CFG_DEFAULT_ENV_IF_NOR
- #define CFG_ENV_SIZE          0x40000 /* 128k Total Size of Environment 
Sector */
- #define CFG_ENV_OFFSET_OOB    1       /* Location of ENV stored in block 0 
OOB */
- #define       CFG_PREBOOT_OVERRIDE    1       /* allow preboot from memory */

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2008-03-31 17:04:58 UTC (rev 
4275)
+++ trunk/src/target/u-boot/patches/series      2008-03-31 17:20:54 UTC (rev 
4276)
@@ -87,17 +87,15 @@
 uboot-nand_write_yaffs.patch
 uboot-neo1973_defaultconsole_usbtty.patch
 
-# keep this here until we have time to bubble it into the stack
-##nor-default-env.patch
-
 # let's see what upstream thinks about this
 loadenv.patch
 
 # fix and improve power management
 dont-smoke.patch
 
-# Experimental. Not intended for general use.
-###wait-for-power-DONTUSE.patch
+# Experimental.
+gpb-shadow.patch
+wait-for-power.patch
 
 # Experimental. Please test.
 remap-vec.patch

Deleted: trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch
===================================================================
--- trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch        
2008-03-31 17:04:58 UTC (rev 4275)
+++ trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch        
2008-03-31 17:20:54 UTC (rev 4276)
@@ -1,258 +0,0 @@
-This patch tries to make the system stay in a mode where total power
-consumption is below 100mA until we have determined that it's safe to
-draw more power.
-
-This is work in progress. Don't use it.
-
-It makes the following changes:
-- keeps the system from booting unless we have either good battery power,
-  500mA from USB, or the wall charger supplying power
-- flashes the red (AUX) LED during this
-- defers initialization of the video subsystem until we're about to
-  display something
-- leaves the LED boost converter turned off until we actually need it
-
-Known issues:
-- still burns way too much power, see
-  http://people.openmoko.org/werner/wait-for-power-try1/usb-batt.html
-
-Index: u-boot/board/neo1973/gta02/gta02.c
-===================================================================
---- u-boot.orig/board/neo1973/gta02/gta02.c
-+++ u-boot/board/neo1973/gta02/gta02.c
-@@ -45,6 +45,9 @@
- /* That many seconds the power key needs to be pressed to power up */
- #define POWER_KEY_SECONDS     2
- 
-+/* If the battery voltage is below this, we can't provide stable power */
-+#define       SAVE_POWER_MILLIVOLT    3600
-+
- #if defined(CONFIG_ARCH_GTA02_v1)
- //#define M_MDIV      0x7f            /* Fout = 405.00MHz */
- #define M_MDIV        0x7d            /* Fout = 399.00MHz */
-@@ -63,6 +66,8 @@
- #define U_M_SDIV 2
- #endif
- 
-+extern void smedia3362_lcm_reset(int);
-+
- unsigned int neo1973_wakeup_cause;
- extern unsigned char booted_from_nand;
- extern unsigned char booted_from_nor;
-@@ -229,6 +234,39 @@
-       return 0;
- }
- 
-+static void poll_charger(void)
-+{
-+      if (pcf50633_read_charger_type() == 1000)
-+              pcf50633_usb_maxcurrent(1000);
-+}
-+
-+static void wait_for_power(void)
-+{
-+      int seconds = 0;
-+
-+      while (1) {
-+              /* battery is present -> try to boot */
-+              if (!(pcf50633_reg_read(PCF50633_REG_BVMCTL) & 1) &&
-+                  pcf50633_read_battvolt() >= SAVE_POWER_MILLIVOLT)
-+                      break;
-+
-+              poll_charger();
-+
-+              /* we have plenty of external power -> try to boot */
-+              if (pcf50633_usb_last_maxcurrent >= 500)
-+                      break;
-+
-+              if (neo1973_new_second())
-+                      seconds++;
-+
-+              /* blink the AUX LED */
-+              neo1973_led(GTA02_LED_AUX_RED, !seconds || (seconds & 1));
-+      }
-+
-+      /* switch off the AUX LED */
-+      neo1973_led(GTA02_LED_AUX_RED, 0);
-+}
-+
- int board_late_init(void)
- {
-       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
-@@ -236,6 +274,7 @@
-       char buf[32];
-       int menu_vote = 0; /* <= 0: no, > 0: yes */
-       int seconds = 0;
-+      int enter_bootmenu;
- 
-       /* Initialize the Power Management Unit with a safe register set */
-       pcf50633_init();
-@@ -244,8 +283,7 @@
-       int1 = pcf50633_reg_read(PCF50633_REG_INT1);
-       int2 = pcf50633_reg_read(PCF50633_REG_INT2);
- 
--      /* switch on one of the power led's */
--      neo1973_led(GTA02_LED_PWR_ORANGE, 1);
-+      wait_for_power();
- 
-       /* issue a short pulse with the vibrator */
-       neo1973_vibrator(1);
-@@ -311,9 +349,15 @@
-       neo1973_poweroff();
- 
- continue_boot:
-+      enter_bootmenu = menu_vote > 0 || booted_from_nor;
-+      smedia3362_lcm_reset(1);
-+      if (!enter_bootmenu && getenv("splashimage"))
-+              run_command(getenv("splashimage"), 0);
-       jbt6k74_init();
-       jbt6k74_enter_state(JBT_STATE_NORMAL);
-       jbt6k74_display_onoff(1);
-+      /* switch on the backlight */
-+      neo1973_backlight(1);
- 
- #if 0
-       {
-@@ -324,7 +368,7 @@
-       }
- #endif
- 
--      if (menu_vote > 0 || booted_from_nor) {
-+      if (enter_bootmenu) {
-               extern struct bootmenu_setup bootmenu_setup;
- 
-               if (booted_from_nand)
-Index: u-boot/board/neo1973/gta02/pcf50633.c
-===================================================================
---- u-boot.orig/board/neo1973/gta02/pcf50633.c
-+++ u-boot/board/neo1973/gta02/pcf50633.c
-@@ -58,7 +58,7 @@
-       [PCF50633_REG_MEMLDOENA] = 0x00,
- 
-       [PCF50633_REG_LEDOUT]   = 0x2f, /* full backlight power */
--      [PCF50633_REG_LEDENA]   = 0x02, /* enabled if GPIO1 = HIGH */
-+      [PCF50633_REG_LEDENA]   = 0x00, /* disabled */
-       [PCF50633_REG_LEDCTL]   = 0x05, /* ovp enabled, ocp 500mA */
-       [PCF50633_REG_LEDDIM]   = 0x20, /* dimming curve */
- 
-Index: u-boot/drivers/misc/pcf50633.c
-===================================================================
---- u-boot.orig/drivers/misc/pcf50633.c
-+++ u-boot/drivers/misc/pcf50633.c
-@@ -111,18 +111,13 @@
-       return 0;
- }
- 
--/* figure out our charger situation */
--int pcf50633_read_charger_type(void)
-+static u_int16_t pcf50633_adc_read(u_int8_t channel, u_int8_t avg)
- {
-       u_int16_t ret;
- 
--      /* kill ratiometric, but enable ACCSW biasing */
--      pcf50633_reg_write(PCF50633_REG_ADCC2, 0x00);
--      pcf50633_reg_write(PCF50633_REG_ADCC3, 0x01);
--
-       /* start ADC conversion of selected channel */
--      pcf50633_reg_write(PCF50633_REG_ADCC1, PCF50633_ADCC1_MUX_ADCIN1 |
--                                             PCF50633_ADCC1_AVERAGE_16 |
-+      pcf50633_reg_write(PCF50633_REG_ADCC1, channel |
-+                                             avg |
-                                              PCF50633_ADCC1_ADCSTART |
-                                              PCF50633_ADCC1_RES_10BIT);
- 
-@@ -135,18 +130,41 @@
-             (pcf50633_reg_read(PCF50633_REG_ADCS3) &
-             PCF50633_ADCS3_ADCDAT1L_MASK);
- 
-+      return ret;
-+}
-+
-+/* figure out our charger situation */
-+int pcf50633_read_charger_type(void)
-+{
-+      u_int16_t ret;
-+
-+      if ((pcf50633_reg_read(PCF50633_REG_MBCS1) & 0x3) != 0x3)
-+              return 0; /* no power, just battery */
-+
-+      /* kill ratiometric, but enable ACCSW biasing */
-+      pcf50633_reg_write(PCF50633_REG_ADCC2, 0x00);
-+      pcf50633_reg_write(PCF50633_REG_ADCC3, 0x01);
-+
-+      ret = pcf50633_adc_read(PCF50633_ADCC1_MUX_ADCIN1,
-+          PCF50633_ADCC1_AVERAGE_16);
-+
-       /* well it is nearest to the 1A resistor */
-       if (ret < ((ADC_NOMINAL_RES_1A + ADC_NOMINAL_RES_NC_R_USB) / 2))
-               return 1000;
- 
--      /* ok all we know is there is no resistor, it can be USB pwr or none */
--      if ((pcf50633_reg_read(PCF50633_REG_MBCS1) & 0x3) == 0x3)
--              return 100; /* USB power then */
-+      /* there is no resistor, so it must be USB pwr */
-+      return 100; /* USB power then */
- 
--      return 0; /* nope, no power, just battery */
- }
- 
-+u_int16_t pcf50633_read_battvolt(void)
-+{
-+      u_int16_t ret;
-+
-+      ret = pcf50633_adc_read(PCF50633_ADCC1_MUX_BATSNS_RES, 0);
- 
-+      return (ret * 6000) / 1024;
-+}
- 
- /* initialize PCF50633 register set */
- void pcf50633_init(void)
-@@ -175,10 +193,13 @@
-       }
- }
- 
-+int pcf50633_usb_last_maxcurrent = -1;
-+
- void pcf50633_usb_maxcurrent(unsigned int ma)
- {
-       u_int8_t val;
- 
-+      pcf50633_usb_last_maxcurrent = ma;
-       if (ma < 100)
-               val = PCF50633_MBCC7_USB_SUSPEND;
-       else if (ma < 500)
-Index: u-boot/drivers/video/smedia3362.c
-===================================================================
---- u-boot.orig/drivers/video/smedia3362.c
-+++ u-boot/drivers/video/smedia3362.c
-@@ -223,7 +223,7 @@
-       pGD->frameAdrs = CONFIG_GLAMO_BASE + 0x00800000;
-       pGD->memSize = 0x200000; /* 480x640x16bit = 614400 bytes */
- 
--#ifdef CONFIG_GTA02_REVISION
-+#ifdef CONFIG_GTA02_REVISION_do_this_in_board_late_init
-       /* bring up the LCM */
-       smedia3362_lcm_reset(1);
-       if (getenv("splashimage"))
-Index: u-boot/include/pcf50633.h
-===================================================================
---- u-boot.orig/include/pcf50633.h
-+++ u-boot/include/pcf50633.h
-@@ -387,6 +387,8 @@
- /* this is to be provided by the board implementation */
- extern const u_int8_t pcf50633_initial_regs[__NUM_PCF50633_REGS];
- 
-+extern int pcf50633_usb_last_maxcurrent; /* mA or -1 if unknown */
-+
- void pcf50633_reg_write(u_int8_t reg, u_int8_t val);
- 
- u_int8_t pcf50633_reg_read(u_int8_t reg);
-@@ -399,5 +401,8 @@
- 
- const char *pcf50633_charger_state(void);
- 
-+int pcf50633_read_charger_type(void);
-+u_int16_t pcf50633_read_battvolt(void);
-+
- #endif /* _PCF50633_H */
- 

Copied: trunk/src/target/u-boot/patches/wait-for-power.patch (from rev 4229, 
trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch)
===================================================================
--- trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch        
2008-03-20 01:04:37 UTC (rev 4229)
+++ trunk/src/target/u-boot/patches/wait-for-power.patch        2008-03-31 
17:20:54 UTC (rev 4276)
@@ -0,0 +1,267 @@
+This patch tries to make the system stay in a mode where total power
+consumption is below 100mA until we have determined that it's safe to
+draw more power.
+
+This is work in progress. Don't use it.
+
+It makes the following changes:
+- keeps the system from booting unless we have either good battery power,
+  500mA from USB, or the wall charger supplying power
+- flashes the red (AUX) LED during this
+- defers initialization of the video subsystem until we're about to
+  display something
+- leaves the LED boost converter turned off until we actually need it
+
+Known issues:
+- still burns way too much power, see
+  http://people.openmoko.org/werner/wait-for-power-try1/usb-batt.html
+
+Index: u-boot/board/neo1973/gta02/gta02.c
+===================================================================
+--- u-boot.orig/board/neo1973/gta02/gta02.c
++++ u-boot/board/neo1973/gta02/gta02.c
+@@ -45,6 +45,9 @@
+ /* That many seconds the power key needs to be pressed to power up */
+ #define POWER_KEY_SECONDS     2
+ 
++/* If the battery voltage is below this, we can't provide stable power */
++#define       SAVE_POWER_MILLIVOLT    3600
++
+ #if defined(CONFIG_ARCH_GTA02_v1)
+ //#define M_MDIV      0x7f            /* Fout = 405.00MHz */
+ #define M_MDIV        0x7d            /* Fout = 399.00MHz */
+@@ -63,6 +66,8 @@
+ #define U_M_SDIV 2
+ #endif
+ 
++extern void smedia3362_lcm_reset(int);
++
+ unsigned int neo1973_wakeup_cause;
+ extern unsigned char booted_from_nand;
+ extern unsigned char booted_from_nor;
+@@ -229,6 +234,42 @@
+       return 0;
+ }
+ 
++static void poll_charger(void)
++{
++      if (pcf50633_read_charger_type() == 1000)
++              pcf50633_usb_maxcurrent(1000);
++}
++
++static void wait_for_power(void)
++{
++      int seconds = 0;
++
++      while (1) {
++              /* battery is present -> try to boot */
++              if (!(pcf50633_reg_read(PCF50633_REG_BVMCTL) & 1))
++                      break;
++/*
++ * Consider adding this later to the above condition:
++                  pcf50633_read_battvolt() >= SAVE_POWER_MILLIVOLT)
++ */
++
++              poll_charger();
++
++              /* we have plenty of external power -> try to boot */
++              if (pcf50633_usb_last_maxcurrent >= 500)
++                      break;
++
++              if (neo1973_new_second())
++                      seconds++;
++
++              /* blink the AUX LED */
++              neo1973_led(GTA02_LED_AUX_RED, !seconds || (seconds & 1));
++      }
++
++      /* switch off the AUX LED */
++      neo1973_led(GTA02_LED_AUX_RED, 0);
++}
++
+ int board_late_init(void)
+ {
+       S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
+@@ -236,6 +277,7 @@
+       char buf[32];
+       int menu_vote = 0; /* <= 0: no, > 0: yes */
+       int seconds = 0;
++      int enter_bootmenu;
+ 
+       /* Initialize the Power Management Unit with a safe register set */
+       pcf50633_init();
+@@ -244,12 +286,13 @@
+       int1 = pcf50633_reg_read(PCF50633_REG_INT1);
+       int2 = pcf50633_reg_read(PCF50633_REG_INT2);
+ 
+-      /* switch on one of the power led's */
+-      neo1973_led(GTA02_LED_PWR_ORANGE, 1);
++      wait_for_power();
+ 
+       /* issue a short pulse with the vibrator */
++      neo1973_led(GTA02_LED_AUX_RED, 1);
+       neo1973_vibrator(1);
+       udelay(20000);
++      neo1973_led(GTA02_LED_AUX_RED, 0);
+       neo1973_vibrator(0);
+ 
+ #if defined(CONFIG_ARCH_GTA02_v1)
+@@ -311,9 +354,15 @@
+       neo1973_poweroff();
+ 
+ continue_boot:
++      enter_bootmenu = menu_vote > 0 || booted_from_nor;
++      smedia3362_lcm_reset(1);
++      if (!enter_bootmenu && getenv("splashimage"))
++              run_command(getenv("splashimage"), 0);
+       jbt6k74_init();
+       jbt6k74_enter_state(JBT_STATE_NORMAL);
+       jbt6k74_display_onoff(1);
++      /* switch on the backlight */
++      neo1973_backlight(1);
+ 
+ #if 0
+       {
+@@ -324,7 +373,7 @@
+       }
+ #endif
+ 
+-      if (menu_vote > 0 || booted_from_nor) {
++      if (enter_bootmenu) {
+               extern struct bootmenu_setup bootmenu_setup;
+ 
+               if (booted_from_nand)
+Index: u-boot/board/neo1973/gta02/pcf50633.c
+===================================================================
+--- u-boot.orig/board/neo1973/gta02/pcf50633.c
++++ u-boot/board/neo1973/gta02/pcf50633.c
+@@ -58,7 +58,7 @@
+       [PCF50633_REG_MEMLDOENA] = 0x00,
+ 
+       [PCF50633_REG_LEDOUT]   = 0x2f, /* full backlight power */
+-      [PCF50633_REG_LEDENA]   = 0x02, /* enabled if GPIO1 = HIGH */
++      [PCF50633_REG_LEDENA]   = 0x00, /* disabled */
+       [PCF50633_REG_LEDCTL]   = 0x05, /* ovp enabled, ocp 500mA */
+       [PCF50633_REG_LEDDIM]   = 0x20, /* dimming curve */
+ 
+Index: u-boot/drivers/misc/pcf50633.c
+===================================================================
+--- u-boot.orig/drivers/misc/pcf50633.c
++++ u-boot/drivers/misc/pcf50633.c
+@@ -111,18 +111,13 @@
+       return 0;
+ }
+ 
+-/* figure out our charger situation */
+-int pcf50633_read_charger_type(void)
++static u_int16_t pcf50633_adc_read(u_int8_t channel, u_int8_t avg)
+ {
+       u_int16_t ret;
+ 
+-      /* kill ratiometric, but enable ACCSW biasing */
+-      pcf50633_reg_write(PCF50633_REG_ADCC2, 0x00);
+-      pcf50633_reg_write(PCF50633_REG_ADCC3, 0x01);
+-
+       /* start ADC conversion of selected channel */
+-      pcf50633_reg_write(PCF50633_REG_ADCC1, PCF50633_ADCC1_MUX_ADCIN1 |
+-                                             PCF50633_ADCC1_AVERAGE_16 |
++      pcf50633_reg_write(PCF50633_REG_ADCC1, channel |
++                                             avg |
+                                              PCF50633_ADCC1_ADCSTART |
+                                              PCF50633_ADCC1_RES_10BIT);
+ 
+@@ -135,18 +130,41 @@
+             (pcf50633_reg_read(PCF50633_REG_ADCS3) &
+             PCF50633_ADCS3_ADCDAT1L_MASK);
+ 
++      return ret;
++}
++
++/* figure out our charger situation */
++int pcf50633_read_charger_type(void)
++{
++      u_int16_t ret;
++
++      if ((pcf50633_reg_read(PCF50633_REG_MBCS1) & 0x3) != 0x3)
++              return 0; /* no power, just battery */
++
++      /* kill ratiometric, but enable ACCSW biasing */
++      pcf50633_reg_write(PCF50633_REG_ADCC2, 0x00);
++      pcf50633_reg_write(PCF50633_REG_ADCC3, 0x01);
++
++      ret = pcf50633_adc_read(PCF50633_ADCC1_MUX_ADCIN1,
++          PCF50633_ADCC1_AVERAGE_16);
++
+       /* well it is nearest to the 1A resistor */
+       if (ret < ((ADC_NOMINAL_RES_1A + ADC_NOMINAL_RES_NC_R_USB) / 2))
+               return 1000;
+ 
+-      /* ok all we know is there is no resistor, it can be USB pwr or none */
+-      if ((pcf50633_reg_read(PCF50633_REG_MBCS1) & 0x3) == 0x3)
+-              return 100; /* USB power then */
++      /* there is no resistor, so it must be USB pwr */
++      return 100; /* USB power then */
+ 
+-      return 0; /* nope, no power, just battery */
+ }
+ 
++u_int16_t pcf50633_read_battvolt(void)
++{
++      u_int16_t ret;
++
++      ret = pcf50633_adc_read(PCF50633_ADCC1_MUX_BATSNS_RES, 0);
+ 
++      return (ret * 6000) / 1024;
++}
+ 
+ /* initialize PCF50633 register set */
+ void pcf50633_init(void)
+@@ -175,10 +193,13 @@
+       }
+ }
+ 
++int pcf50633_usb_last_maxcurrent = -1;
++
+ void pcf50633_usb_maxcurrent(unsigned int ma)
+ {
+       u_int8_t val;
+ 
++      pcf50633_usb_last_maxcurrent = ma;
+       if (ma < 100)
+               val = PCF50633_MBCC7_USB_SUSPEND;
+       else if (ma < 500)
+Index: u-boot/drivers/video/smedia3362.c
+===================================================================
+--- u-boot.orig/drivers/video/smedia3362.c
++++ u-boot/drivers/video/smedia3362.c
+@@ -223,7 +223,7 @@
+       pGD->frameAdrs = CONFIG_GLAMO_BASE + 0x00800000;
+       pGD->memSize = 0x200000; /* 480x640x16bit = 614400 bytes */
+ 
+-#ifdef CONFIG_GTA02_REVISION
++#ifdef CONFIG_GTA02_REVISION_do_this_in_board_late_init
+       /* bring up the LCM */
+       smedia3362_lcm_reset(1);
+       if (getenv("splashimage"))
+Index: u-boot/include/pcf50633.h
+===================================================================
+--- u-boot.orig/include/pcf50633.h
++++ u-boot/include/pcf50633.h
+@@ -387,6 +387,8 @@
+ /* this is to be provided by the board implementation */
+ extern const u_int8_t pcf50633_initial_regs[__NUM_PCF50633_REGS];
+ 
++extern int pcf50633_usb_last_maxcurrent; /* mA or -1 if unknown */
++
+ void pcf50633_reg_write(u_int8_t reg, u_int8_t val);
+ 
+ u_int8_t pcf50633_reg_read(u_int8_t reg);
+@@ -399,5 +401,8 @@
+ 
+ const char *pcf50633_charger_state(void);
+ 
++int pcf50633_read_charger_type(void);
++u_int16_t pcf50633_read_battvolt(void);
++
+ #endif /* _PCF50633_H */
+ 




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to