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. r1277 -
      trunk/src/target/OM-2007/applications/openmoko-today/src
      ([EMAIL PROTECTED])
   2. r1278 - trunk/oe/packages/linux ([EMAIL PROTECTED])
   3. r1279 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
   4. r1280 - trunk/src/target/gsm/src/util ([EMAIL PROTECTED])
   5. r1281 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
   6. r1282 - in trunk/src/target/gsm: include/gsmd src/libgsmd
      ([EMAIL PROTECTED])
   7. r1283 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   8. r1284 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: thomas
Date: 2007-03-08 17:14:00 +0100 (Thu, 08 Mar 2007)
New Revision: 1277

Modified:
   trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
Log:
* Connect signal to launcher buttons in openmoko-today
* Add some comments


Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c       
2007-03-08 15:22:07 UTC (rev 1276)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c       
2007-03-08 16:14:00 UTC (rev 1277)
@@ -180,6 +180,18 @@
   return result;
 }
 
+/* information lines */
+
+/**
+ * today_infoline_new:
+ * @stock_id: name of the stock icon to use
+ * @message: string containing the message
+ *
+ * Utility function to create new info lines
+ *
+ * Return value: The parent widget of the new widgets
+ */
+
 static GtkWidget *
 today_infoline_new (gchar * stock_id, gchar * message)
 {
@@ -202,6 +214,37 @@
   return eventbox;
 }
 
+
+/* launcher buttons */
+
+/**
+ * callback for luncher buttons
+ */
+static void
+today_launcher_clicked_cb (GtkWidget *button, gchar *command)
+{
+  GError *error;
+
+  g_spawn_command_line_async (command, &error);
+
+  if (error)
+  {
+    LOG_ERROR;
+    g_error_free (error);
+  }
+
+  /* TODO: should we hide or quit after launching an application? */
+}
+
+/**
+ * today_launcher_button_new:
+ * @icon: stock name to use as the icon in the button
+ * @exec: command to execute when the button is clicked
+ *
+ * Utility function to create new launcher buttons
+ *
+ * Return value: The parent widget of the new widgets
+ */
 static GtkWidget *
 today_launcher_button_new (gchar * icon, gchar * exec)
 {
@@ -212,6 +255,11 @@
 
   gtk_widget_set_name (button, "today-launcher-button");
 
+  g_signal_connect (G_OBJECT (button),
+                    "clicked",
+                    G_CALLBACK (today_launcher_clicked_cb),
+                    exec);
+
   return button;
 }
 
@@ -324,7 +372,7 @@
   gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 0);
 
   gtk_container_add (GTK_CONTAINER (button_box),
-                     today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+                     today_launcher_button_new (GTK_STOCK_EXECUTE, 
"contacts"));
   gtk_container_add (GTK_CONTAINER (button_box),
                      today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
   gtk_container_add (GTK_CONTAINER (button_box),




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 21:42:43 +0100 (Thu, 08 Mar 2007)
New Revision: 1278

Modified:
   trunk/oe/packages/linux/linux-gta01_2.6.20.1.bb
   trunk/oe/packages/linux/linux-gta01_2.6.20.bb
Log:
use http, not https 


Modified: trunk/oe/packages/linux/linux-gta01_2.6.20.1.bb
===================================================================
--- trunk/oe/packages/linux/linux-gta01_2.6.20.1.bb     2007-03-08 16:14:00 UTC 
(rev 1277)
+++ trunk/oe/packages/linux/linux-gta01_2.6.20.1.bb     2007-03-08 20:42:43 UTC 
(rev 1278)
@@ -17,7 +17,7 @@
 # source and patches
 #
 SRC_URI = 
"http://ftp.de.kernel.org/pub/linux/kernel/v2.6/linux-${VANILLA_VERSION}.tar.bz2
 \
-           
svn://svn.openmoko.org/trunk/src/target/kernel;module=patches;proto=https \
+           
svn://svn.openmoko.org/trunk/src/target/kernel;module=patches;proto=http \
            file://defconfig-${VANILLA_VERSION}-${MACHINE}"
 S = "${WORKDIR}/linux-${VANILLA_VERSION}"
 

Modified: trunk/oe/packages/linux/linux-gta01_2.6.20.bb
===================================================================
--- trunk/oe/packages/linux/linux-gta01_2.6.20.bb       2007-03-08 16:14:00 UTC 
(rev 1277)
+++ trunk/oe/packages/linux/linux-gta01_2.6.20.bb       2007-03-08 20:42:43 UTC 
(rev 1278)
@@ -17,7 +17,7 @@
 # source and patches
 #
 SRC_URI = 
"http://ftp.de.kernel.org/pub/linux/kernel/v2.6/linux-${VANILLA_VERSION}.tar.bz2
 \
-           
svn://svn.openmoko.org/trunk/src/target/kernel;module=patches;proto=https \
+           
svn://svn.openmoko.org/trunk/src/target/kernel;module=patches;proto=http \
            file://defconfig-${VANILLA_VERSION}-${MACHINE}"
 S = "${WORKDIR}/linux-${VANILLA_VERSION}"
 




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 21:48:31 +0100 (Thu, 08 Mar 2007)
New Revision: 1279

Modified:
   trunk/src/target/gsm/src/gsmd/vendor_ti.c
Log:
make AT%CPI parse tolerant to empty fields


Modified: trunk/src/target/gsm/src/gsmd/vendor_ti.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_ti.c   2007-03-08 20:42:43 UTC (rev 
1278)
+++ trunk/src/target/gsm/src/gsmd/vendor_ti.c   2007-03-08 20:48:31 UTC (rev 
1279)
@@ -155,7 +155,7 @@
        /* direction */
        tok = strtok(NULL, ",");
        if (!tok)
-               goto out_free_io;
+               goto out_send;
        
        switch (*tok) {
        case '0':
@@ -171,8 +171,9 @@
        /* mode */
        tok = strtok(NULL, ",");
        if (!tok)
-               goto out_free_io;
+               goto out_send;
        
+out_send:
        usock_evt_send(gsmd, ucmd, GSMD_EVT_OUT_STATUS);
 
        return 0;




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 22:34:11 +0100 (Thu, 08 Mar 2007)
New Revision: 1280

Modified:
   trunk/src/target/gsm/src/util/shell.c
Log:
don't power down the device before trying to register with the network ;)


Modified: trunk/src/target/gsm/src/util/shell.c
===================================================================
--- trunk/src/target/gsm/src/util/shell.c       2007-03-08 20:48:31 UTC (rev 
1279)
+++ trunk/src/target/gsm/src/util/shell.c       2007-03-08 21:34:11 UTC (rev 
1280)
@@ -127,7 +127,6 @@
                                lgsm_phone_power(lgsmh, 0);
                        } else if (!strcmp(buf, "R")) {
                                printf("Register\n");
-                               lgsm_phone_power(lgsmh, 0);
                                lgsm_netreg_register(lgsmh, 0);
                        } else if (!strcmp(buf, "q")) {
                                exit(0);




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 22:48:59 +0100 (Thu, 08 Mar 2007)
New Revision: 1281

Modified:
   trunk/src/target/gsm/src/gsmd/usock.c
   trunk/src/target/gsm/src/gsmd/vendor_ti.c
Log:
* introduce ciphering indication parsing and event generation
* stubs for volume control
* add data structure resembing gsm device state


Modified: trunk/src/target/gsm/src/gsmd/usock.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/usock.c       2007-03-08 21:34:11 UTC (rev 
1280)
+++ trunk/src/target/gsm/src/gsmd/usock.c       2007-03-08 21:48:59 UTC (rev 
1281)
@@ -210,11 +210,13 @@
        case GSMD_PHONE_POWERUP:
                cmd = atcmd_fill("AT+CFUN=1", 9+1,
                                 &null_cmd_cb, gu, 0);
+               gu->gsmd->dev_state.on = 1;
                break;
 
        case GSMD_PHONE_POWERDOWN:
                cmd = atcmd_fill("AT+CFUN=0", 9+1,
                                 &null_cmd_cb, gu, 0);
+               gu->gsmd->dev_state.on = 0;
                break;
        default:
                return -EINVAL;

Modified: trunk/src/target/gsm/src/gsmd/vendor_ti.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_ti.c   2007-03-08 21:34:11 UTC (rev 
1280)
+++ trunk/src/target/gsm/src/gsmd/vendor_ti.c   2007-03-08 21:48:59 UTC (rev 
1281)
@@ -101,7 +101,42 @@
 
 static int cpri_parse(char *buf, int len, const char *param, struct gsmd *gsmd)
 {
-       /* FIXME: parse ciphering indication */
+       char *tok1, *tok2;
+
+       tok1 = strtok(buf, ",");
+       if (!tok1)
+               return -EIO;
+       
+       tok2 = strtok(NULL, ",");
+       if (!tok2) {
+               switch (atoi(tok1)) {
+               case 0:
+                       gsmd->dev_state.ciph_ind.flags &= ~GSMD_CIPHIND_ACTIVE;
+                       break;
+               case 1:
+                       gsmd->dev_state.ciph_ind.flags |= GSMD_CIPHIND_ACTIVE;
+                       break;
+               case 2:
+                       gsmd->dev_state.ciph_ind.flags |= 
GSMD_CIPHIND_DISABLED_SIM;
+                       break;
+               }
+       } else {
+               struct gsmd_evt_auxdata *aux;
+               struct gsmd_ucmd *ucmd = usock_build_event(GSMD_MSG_EVENT,
+                                                          GSMD_EVT_CIPHER,
+                                                          sizeof(*aux));
+               if (!ucmd)
+                       return -ENOMEM;
+
+               aux = (struct gsmd_evt_auxdata *) ucmd->buf;
+
+               aux->u.cipher.net_state_gsm = atoi(tok1);
+               aux->u.cipher.net_state_gsm = atoi(tok2);
+
+               usock_evt_send(gsmd, ucmd, GSMD_EVT_CIPHER);
+       }
+
+       return 0;
 }
 
 /* Call Progress Information */




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 22:51:11 +0100 (Thu, 08 Mar 2007)
New Revision: 1282

Added:
   trunk/src/target/gsm/include/gsmd/state.h
Modified:
   trunk/src/target/gsm/include/gsmd/event.h
   trunk/src/target/gsm/include/gsmd/gsmd.h
   trunk/src/target/gsm/include/gsmd/usock.h
   trunk/src/target/gsm/src/libgsmd/libgsmd_voicecall.c
Log:
this was supposed to be part of the last commit (1281)


Modified: trunk/src/target/gsm/include/gsmd/event.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/event.h   2007-03-08 21:48:59 UTC (rev 
1281)
+++ trunk/src/target/gsm/include/gsmd/event.h   2007-03-08 21:51:11 UTC (rev 
1282)
@@ -15,6 +15,7 @@
        GSMD_EVT_CALL_WAIT      = 10,   /* Call Waiting */
        GSMD_EVT_TIMEZONE       = 11,   /* Timezone change */
        GSMD_EVT_SUBSCRIPTIONS  = 12,   /* To which events are we subscribed to 
*/
+       GSMD_EVT_CIPHER         = 13,   /* Chiphering Information */
        __NUM_GSMD_EVT
 };
 

Modified: trunk/src/target/gsm/include/gsmd/gsmd.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/gsmd.h    2007-03-08 21:48:59 UTC (rev 
1281)
+++ trunk/src/target/gsm/include/gsmd/gsmd.h    2007-03-08 21:51:11 UTC (rev 
1282)
@@ -9,6 +9,7 @@
 
 #include <gsmd/vendorplugin.h>
 #include <gsmd/select.h>
+#include <gsmd/state.h>
 
 void *gsmd_tallocs;
 
@@ -64,6 +65,7 @@
        struct llist_head pending_atcmds;       /* our busy gsmd_atcmds */
        struct llist_head busy_atcmds;  /* our busy gsmd_atcmds */
        struct gsmd_vendor_plugin *vendorpl;
+       struct gsmd_device_state dev_state;
 };
 
 struct gsmd_user {

Added: trunk/src/target/gsm/include/gsmd/state.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/state.h   2007-03-08 21:48:59 UTC (rev 
1281)
+++ trunk/src/target/gsm/include/gsmd/state.h   2007-03-08 21:51:11 UTC (rev 
1282)
@@ -0,0 +1,23 @@
+#ifndef _GSMD_STATE_H
+#define _GSMD_STATE_H
+
+#ifdef __GSMD__
+
+#define GSMD_CIPHIND_CAPABLE           0x01
+#define GSMD_CIPHIND_DISABLED_SIM      0x02
+#define GSMD_CIPHIND_ACTIVE            0x04
+
+struct gsmd_device_state {
+       struct {
+               unsigned int flags;
+               unsigned int network_state_gsm;
+               unsigned int network_state_gprs;
+       } ciph_ind;
+
+       unsigned int on;
+       unsigned int registered;
+};
+
+#endif /* __GSMD__ */
+
+#endif /* _GSMD_STATE_H */

Modified: trunk/src/target/gsm/include/gsmd/usock.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/usock.h   2007-03-08 21:48:59 UTC (rev 
1281)
+++ trunk/src/target/gsm/include/gsmd/usock.h   2007-03-08 21:51:11 UTC (rev 
1282)
@@ -35,6 +35,8 @@
        GSMD_VOICECALL_HANGUP   = 2,
        GSMD_VOICECALL_ANSWER   = 3,
        GSMD_VOICECALL_DTMF     = 4,
+       GSMD_VOICECALL_VOL_SET  = 5,
+       GSMD_VOICECALL_VOL_GET  = 6,
 };
 
 /* Handset / MT related commands */
@@ -58,6 +60,7 @@
        GSMD_NETWORK_VMAIL_GET  = 3,
        GSMD_NETWORK_VMAIL_SET  = 4,
        GSMD_NETWORK_OPER_GET   = 5,
+       GSMD_NETWORK_CIND_GET   = 6,
 };
 
 /* Length from 3GPP TS 04.08, Clause 10.5.4.7 */
@@ -119,6 +122,11 @@
                                 tch:1,
                                 dir:2;
                } call_status;
+               struct {
+                       u_int16_t flags;
+                       u_int16_t net_state_gsm;
+                       u_int16_t net_state_gprs;
+               } cipher;
        } u;
 } __attribute__((packed));
 

Modified: trunk/src/target/gsm/src/libgsmd/libgsmd_voicecall.c
===================================================================
--- trunk/src/target/gsm/src/libgsmd/libgsmd_voicecall.c        2007-03-08 
21:48:59 UTC (rev 1281)
+++ trunk/src/target/gsm/src/libgsmd/libgsmd_voicecall.c        2007-03-08 
21:51:11 UTC (rev 1282)
@@ -107,3 +107,9 @@
 {
        return lgsm_send_simple(lh, GSMD_MSG_VOICECALL, GSMD_VOICECALL_HANGUP);
 }
+
+int lgsm_voice_volume_set(struct lgsm_handle *lh, int volume)
+{
+       /* FIXME: we need to pass along the parameter */
+       return lgsm_send_simple(lh, GSMD_MSG_VOICECALL, GSMD_VOICECALL_VOL_SET);
+}




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2007-03-08 23:04:04 +0100 (Thu, 08 Mar 2007)
New Revision: 1283

Modified:
   trunk/src/target/u-boot/patches/boot-menu.patch
Log:
board/neo1973/neo1973.c (board_late_init): poll for the boot menu also on RAM
  boot, reset, or unknown cause
board/neo1973/neo1973.c (board_late_init): don't look for the power key if
  woken up by the charger



Modified: trunk/src/target/u-boot/patches/boot-menu.patch
===================================================================
--- trunk/src/target/u-boot/patches/boot-menu.patch     2007-03-08 21:51:11 UTC 
(rev 1282)
+++ trunk/src/target/u-boot/patches/boot-menu.patch     2007-03-08 22:04:04 UTC 
(rev 1283)
@@ -11,6 +11,10 @@
 u-boot/board/neo1973/neo1973.c (board_late_init): minor code cleanup
 u-boot/common/console.c, include/console.h: added "console_poll_hook" to be
   called when waiting for console in put in "getc" and "tstc"
+board/neo1973/neo1973.c (board_late_init): poll for the boot menu also on RAM
+  boot, reset, or unknown cause
+board/neo1973/neo1973.c (board_late_init): don't look for the power key if
+  woken up by the charger
 
 - Werner Almesberger <[EMAIL PROTECTED]>
 
@@ -358,21 +362,42 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/neo1973.c
 +++ u-boot/board/neo1973/neo1973.c
-@@ -196,6 +196,7 @@ int board_late_init(void)
+@@ -196,10 +196,15 @@ int board_late_init(void)
        extern unsigned char booted_from_nand;
        unsigned char tmp;
        char buf[32];
 +      int menu_vote = 0; /* <= 0: no, > 0: yes */
++      int seconds = 0;
  
        /* Initialize the Power Management Unit with a safe register set */
        pcf50606_init();
-@@ -219,25 +220,18 @@ int board_late_init(void)
  
++      /* if there's no other reason, must be regular reset */
++      neo1973_wakeup_cause = NEO1973_WAKEUP_RESET;
++
+       if (!booted_from_nand)
+               goto woken_by_reset;
+ 
+@@ -209,45 +214,41 @@ int board_late_init(void)
+       setenv("pcf50606_int1", buf);
+ 
+       if (tmp & PCF50606_INT1_ALARM) {
+-              /* we've been woken up by RTC alarm or charger insert, boot */
++              /* we've been woken up by RTC alarm, boot */
+               neo1973_wakeup_cause = NEO1973_WAKEUP_ALARM;
+               goto continue_boot;
+       }
+       if (tmp & PCF50606_INT1_EXTONR) {
++              /* we've been woken up by charger insert */
+               neo1973_wakeup_cause = NEO1973_WAKEUP_CHARGER;
+       }
+ 
        if (tmp & PCF50606_INT1_ONKEYF) {
-               int seconds = 0;
-+
-               neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY;
+-              int seconds = 0;
+-              neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY;
                /* we've been woken up by a falling edge of the onkey */
++              neo1973_wakeup_cause = NEO1973_WAKEUP_POWER_KEY;
++      }
  
 -              /* we can't just setenv(bootdelay,-1) because that would
 -               * accidentially become permanent if the user does saveenv */
@@ -385,21 +410,43 @@
 -                      oocs = pcf50606_reg_read(PCF50606_REG_OOCS);
 -                      if (oocs & PFC50606_OOCS_ONKEY)
 -                              break;
-+              while (neo1973_on_key_pressed()) {
-+                      if (neo1973_911_key_pressed())
-+                              menu_vote++;
-+                      else
-+                              menu_vote--;
- 
+-
 -                      int1 = pcf50606_reg_read(PCF50606_REG_INT1);
 -                      if (int1 & PCF50606_INT1_SECOND)
-+                      if (neo1973_new_second())
-                               seconds++;
+-                              seconds++;
 -
-                       if (seconds >= POWER_KEY_SECONDS)
-                               goto continue_boot;
-               }
-@@ -262,6 +256,11 @@ continue_boot:
+-                      if (seconds >= POWER_KEY_SECONDS)
+-                              goto continue_boot;
+-              }
+-              /* Power off if minimum number of seconds not reached */
+-              neo1973_poweroff();
++      if (neo1973_wakeup_cause == NEO1973_WAKEUP_CHARGER) {
++              /* if we still think it was only a charger insert, boot */
++              goto continue_boot;
+       }
+ 
+ woken_by_reset:
+-      /* if there's no other reason, must be regular reset */
+-      neo1973_wakeup_cause = NEO1973_WAKEUP_RESET;
++
++      while (neo1973_wakeup_cause == NEO1973_WAKEUP_RESET ||
++          neo1973_on_key_pressed()) {
++              if (neo1973_911_key_pressed())
++                      menu_vote++;
++              else
++                      menu_vote--;
++
++              if (neo1973_new_second())
++                      seconds++;
++              if (seconds >= POWER_KEY_SECONDS)
++                      goto continue_boot;
++      }
++      /* Power off if minimum number of seconds not reached */
++      neo1973_poweroff();
+ 
+ continue_boot:
+       jbt6k74_init();
+@@ -262,6 +263,11 @@ continue_boot:
        /* switch on the backlight */
        neo1973_backlight(1);
  
@@ -411,7 +458,7 @@
        return 0;
  }
  
-@@ -313,6 +312,16 @@ void neo1973_vibrator(int on)
+@@ -313,6 +319,16 @@ void neo1973_vibrator(int on)
                gpio->GPBDAT &= ~(1 << 10);
  }
  




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2007-03-08 23:27:48 +0100 (Thu, 08 Mar 2007)
New Revision: 1284

Modified:
   trunk/src/target/u-boot/patches/boot-menu.patch
   trunk/src/target/u-boot/patches/uboot-dfu.patch
Log:
drivers/usbdfu.c, include/usb_dfu.h (dfu_init_instance): added new global
  volatile variable system_dfu_state pointing to dfu_state of the first
  DFU-capable device set up in the system
board/neo1973/bootmenu.c (do_option, bootmenu_hook): changed calls to
  neo1973_poweroff to poweroff_if_idle which makes sure the system is not in
  DFU before powering down (power down despite DFU is still allowed if
  explicitly requested by user)



Modified: trunk/src/target/u-boot/patches/boot-menu.patch
===================================================================
--- trunk/src/target/u-boot/patches/boot-menu.patch     2007-03-08 22:04:04 UTC 
(rev 1283)
+++ trunk/src/target/u-boot/patches/boot-menu.patch     2007-03-08 22:27:48 UTC 
(rev 1284)
@@ -22,7 +22,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/bootmenu.c
-@@ -0,0 +1,335 @@
+@@ -0,0 +1,365 @@
 +/*
 + * bootmenu.c - Boot menu
 + *
@@ -50,7 +50,14 @@
 +#include <devices.h>
 +#include <console.h>
 +#include <environment.h>
++#include <environment.h>
++#include <asm/atomic.h>
 +
++#ifdef CONFIG_USBD_DFU
++#include "usbdcore.h"
++#include "usb_dfu.h"
++#endif
++
 +#include "neo1973.h"
 +
 +
@@ -257,6 +264,27 @@
 +}
 +
 +
++static int system_idle(void)
++{
++#ifdef  CONFIG_USBD_DFU
++      if (system_dfu_state)
++              return *system_dfu_state == DFU_STATE_appIDLE;
++#endif
++      return 1;
++}
++
++
++static void poweroff_if_idle(void)
++{
++      unsigned long flags;
++
++      local_irq_save(flags);
++      if (system_idle())
++              neo1973_poweroff();
++      local_irq_restore(flags);
++}
++
++
 +static void do_option(int option)
 +{
 +      int seconds, aux;
@@ -290,7 +318,7 @@
 +                      seconds--;
 +      }
 +      if (!option)
-+              neo1973_poweroff();
++              poweroff_if_idle();
 +      init_bootmenu();
 +}
 +
@@ -322,8 +350,10 @@
 +      }
 +      on = tmp;
 +      if (neo1973_new_second())
-+              if (++seconds > boot_menu_timeout)
-+                      neo1973_poweroff();
++              if (++seconds > boot_menu_timeout) {
++                      poweroff_if_idle();
++                      seconds = 0;
++              }
 +}
 +
 +

Modified: trunk/src/target/u-boot/patches/uboot-dfu.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-dfu.patch     2007-03-08 22:04:04 UTC 
(rev 1283)
+++ trunk/src/target/u-boot/patches/uboot-dfu.patch     2007-03-08 22:27:48 UTC 
(rev 1284)
@@ -1,7 +1,7 @@
 Index: u-boot/drivers/usbdcore_ep0.c
 ===================================================================
---- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-28 03:51:25.000000000 +0100
-+++ u-boot/drivers/usbdcore_ep0.c      2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/drivers/usbdcore_ep0.c
++++ u-boot/drivers/usbdcore_ep0.c
 @@ -42,10 +42,15 @@
   */
  
@@ -18,7 +18,7 @@
  #if 0
  #define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: 
"fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)
  #else
-@@ -213,7 +218,7 @@
+@@ -213,7 +218,7 @@ static int ep0_get_descriptor (struct us
                        urb->buffer = device_descriptor;
                        urb->actual_length = MIN(sizeof(*device_descriptor), 
max);
                }
@@ -27,7 +27,7 @@
                break;
  
        case USB_DESCRIPTOR_TYPE_CONFIGURATION:
-@@ -267,7 +272,24 @@
+@@ -267,7 +272,24 @@ static int ep0_get_descriptor (struct us
                return -1;
        case USB_DESCRIPTOR_TYPE_ENDPOINT:
                return -1;
@@ -52,7 +52,7 @@
                {
                        return -1;      /* unsupported at this time */
  #if 0
-@@ -294,6 +316,7 @@
+@@ -294,6 +316,7 @@ static int ep0_get_descriptor (struct us
                                     max);
  #endif
                }
@@ -60,7 +60,7 @@
                break;
        case USB_DESCRIPTOR_TYPE_REPORT:
                {
-@@ -388,6 +411,24 @@
+@@ -388,6 +411,24 @@ int ep0_recv_setup (struct urb *urb)
                 le16_to_cpu (request->wLength),
                 USBD_DEVICE_REQUESTS (request->bRequest));
  
@@ -85,7 +85,7 @@
        /* handle USB Standard Request (c.f. USB Spec table 9-2) */
        if ((request->bmRequestType & USB_REQ_TYPE_MASK) != 0) {
                if (device->device_state <= STATE_CONFIGURED)
-@@ -570,7 +611,8 @@
+@@ -570,7 +611,8 @@ int ep0_recv_setup (struct urb *urb)
                        device->interface = le16_to_cpu (request->wIndex);
                        device->alternate = le16_to_cpu (request->wValue);
                        /*dbg_ep0(2, "set interface: %d alternate: %d", 
device->interface, device->alternate); */
@@ -97,9 +97,9 @@
                case USB_REQ_GET_STATUS:
 Index: u-boot/drivers/usbdfu.c
 ===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/drivers/usbdfu.c    2007-02-28 03:51:58.000000000 +0100
-@@ -0,0 +1,1000 @@
+--- /dev/null
++++ u-boot/drivers/usbdfu.c
+@@ -0,0 +1,1007 @@
 +/*
 + * (C) 2007 by OpenMoko, Inc.
 + * Author: Harald Welte <[EMAIL PROTECTED]>
@@ -168,6 +168,9 @@
 +#define RET_ZLP               1
 +#define RET_STALL     2
 +
++volatile enum dfu_state *system_dfu_state; /* for 3rd parties */
++
++
 +struct dnload_state {
 +      nand_info_t *nand;
 +      struct part_info *part;
@@ -1024,6 +1027,10 @@
 +      dev->dfu_state = DFU_STATE_appIDLE;
 +      dev->dfu_status = DFU_STATUS_OK;
 +
++      if (system_dfu_state)
++              printf("SURPRISE: system_dfu_state is already set\n");
++      system_dfu_state = &dev->dfu_state;
++
 +      dfu_init_strings(dev);
 +
 +      return 0;
@@ -1102,9 +1109,9 @@
 +#endif /* CONFIG_USBD_DFU */
 Index: u-boot/drivers/Makefile
 ===================================================================
---- u-boot.orig/drivers/Makefile       2007-02-28 03:51:25.000000000 +0100
-+++ u-boot/drivers/Makefile    2007-02-28 03:51:25.000000000 +0100
-@@ -46,7 +46,7 @@
+--- u-boot.orig/drivers/Makefile
++++ u-boot/drivers/Makefile
+@@ -46,7 +46,7 @@ COBJS        = 3c589.o 5701rls.o ali512x.o atme
          sl811_usb.o sm501.o smc91111.o smiLynxEM.o \
          status_led.o sym53c8xx.o systemace.o ahci.o \
          ti_pci1410a.o tigon3.o tsec.o \
@@ -1115,8 +1122,8 @@
          pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o  \
 Index: u-boot/drivers/usbdcore.c
 ===================================================================
---- u-boot.orig/drivers/usbdcore.c     2007-02-28 03:47:38.000000000 +0100
-+++ u-boot/drivers/usbdcore.c  2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/drivers/usbdcore.c
++++ u-boot/drivers/usbdcore.c
 @@ -31,6 +31,7 @@
  
  #include <malloc.h>
@@ -1125,7 +1132,7 @@
  
  #define MAX_INTERFACES 2
  
-@@ -212,6 +213,10 @@
+@@ -212,6 +213,10 @@ struct usb_alternate_instance *usbd_devi
   */
  struct usb_device_descriptor *usbd_device_device_descriptor (struct 
usb_device_instance *device, int port)
  {
@@ -1136,7 +1143,7 @@
        return (device->device_descriptor);
  }
  
-@@ -232,6 +237,10 @@
+@@ -232,6 +237,10 @@ struct usb_configuration_descriptor *usb
        if (!(configuration_instance = usbd_device_configuration_instance 
(device, port, configuration))) {
                return NULL;
        }
@@ -1147,7 +1154,7 @@
        return (configuration_instance->configuration_descriptor);
  }
  
-@@ -253,6 +262,13 @@
+@@ -253,6 +262,13 @@ struct usb_interface_descriptor *usbd_de
        if (!(interface_instance = usbd_device_interface_instance (device, 
port, configuration, interface))) {
                return NULL;
        }
@@ -1161,7 +1168,7 @@
        if ((alternate < 0) || (alternate >= interface_instance->alternates)) {
                return NULL;
        }
-@@ -681,4 +697,7 @@
+@@ -681,4 +697,7 @@ void usbd_device_event_irq (struct usb_d
                /* usbdbg("calling device->event"); */
                device->event(device, event, data);
        }
@@ -1171,8 +1178,8 @@
  }
 Index: u-boot/drivers/usbtty.c
 ===================================================================
---- u-boot.orig/drivers/usbtty.c       2007-02-28 03:51:24.000000000 +0100
-+++ u-boot/drivers/usbtty.c    2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/drivers/usbtty.c
++++ u-boot/drivers/usbtty.c
 @@ -31,6 +31,8 @@
  #include "usbtty.h"
  #include "usb_cdc_acm.h"
@@ -1182,7 +1189,7 @@
  #include <config.h>           /* If defined, override Linux identifiers with
                                 * vendor specific ones */
  
-@@ -118,7 +120,7 @@
+@@ -118,7 +120,7 @@ extern struct usb_string_descriptor **us
  static unsigned short rx_endpoint = 0;
  static unsigned short tx_endpoint = 0;
  static unsigned short interface_count = 0;
@@ -1191,7 +1198,7 @@
  
  /* USB Descriptor Strings */
  static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4};
-@@ -169,6 +171,10 @@
+@@ -169,6 +171,10 @@ struct acm_config_desc {
        struct usb_interface_descriptor data_class_interface;
        struct usb_endpoint_descriptor 
                data_endpoints[NUM_ENDPOINTS-1] __attribute__((packed));
@@ -1202,7 +1209,7 @@
  } __attribute__((packed));
  
  static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
-@@ -179,7 +185,11 @@
+@@ -179,7 +185,11 @@ static struct acm_config_desc acm_config
                        .bDescriptorType = USB_DT_CONFIG,
                        .wTotalLength =  
                                cpu_to_le16(sizeof(struct acm_config_desc)),
@@ -1214,7 +1221,7 @@
                        .bConfigurationValue = 1,
                        .iConfiguration = STR_CONFIG,
                        .bmAttributes = 
-@@ -278,6 +288,11 @@
+@@ -278,6 +288,11 @@ static struct acm_config_desc acm_config
                                .bInterval              = 0xFF,
                        },
                },
@@ -1226,7 +1233,7 @@
        },
  };    
  
-@@ -390,7 +405,7 @@
+@@ -390,7 +405,7 @@ static int fill_buffer (circbuf_t * buf)
  void usbtty_poll (void);
  
  /* utility function for converting char* to wide string used by USB */
@@ -1235,7 +1242,7 @@
  {
        int i;
        for (i = 0; i < strlen (str) && str[i]; i++){
-@@ -652,6 +667,9 @@
+@@ -652,6 +667,9 @@ static void usbtty_init_instances (void)
        device_instance->bus = bus_instance;
        device_instance->configurations = NUM_CONFIGS;
        device_instance->configuration_instance_array = config_instance;
@@ -1247,8 +1254,8 @@
        memset (bus_instance, 0, sizeof (struct usb_bus_instance));
 Index: u-boot/include/configs/neo1973.h
 ===================================================================
---- u-boot.orig/include/configs/neo1973.h      2007-02-28 03:51:25.000000000 
+0100
-+++ u-boot/include/configs/neo1973.h   2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/include/configs/neo1973.h
++++ u-boot/include/configs/neo1973.h
 @@ -165,7 +165,7 @@
   */
  #define CONFIG_STACKSIZE      (128*1024)      /* regular stack */
@@ -1271,9 +1278,9 @@
   * Physical Memory Map
 Index: u-boot/include/usb_dfu.h
 ===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/usb_dfu.h   2007-02-28 03:51:25.000000000 +0100
-@@ -0,0 +1,97 @@
+--- /dev/null
++++ u-boot/include/usb_dfu.h
+@@ -0,0 +1,99 @@
 +#ifndef _DFU_H
 +#define _DFU_H
 +
@@ -1365,6 +1372,8 @@
 +#define DFU_EP0_ZLP           3
 +#define DFU_EP0_DATA          4
 +
++extern volatile enum dfu_state *system_dfu_state; /* for 3rd parties */
++
 +int dfu_ep0_handler(struct urb *urb);
 +
 +void dfu_event(struct usb_device_instance *device,
@@ -1373,8 +1382,8 @@
 +#endif /* _DFU_H */
 Index: u-boot/include/usb_dfu_descriptors.h
 ===================================================================
---- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/usb_dfu_descriptors.h       2007-02-28 03:51:25.000000000 
+0100
+--- /dev/null
++++ u-boot/include/usb_dfu_descriptors.h
 @@ -0,0 +1,94 @@
 +#ifndef _USB_DFU_H
 +#define _USB_DFU_H
@@ -1472,8 +1481,8 @@
 +#endif /* _USB_DFU_H */
 Index: u-boot/include/usbdcore.h
 ===================================================================
---- u-boot.orig/include/usbdcore.h     2007-02-28 03:51:24.000000000 +0100
-+++ u-boot/include/usbdcore.h  2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/include/usbdcore.h
++++ u-boot/include/usbdcore.h
 @@ -33,6 +33,7 @@
  
  #include <common.h>
@@ -1482,7 +1491,7 @@
  
  
  #define MAX_URBS_QUEUED 5
-@@ -475,7 +476,11 @@
+@@ -475,7 +476,11 @@ typedef struct urb_link {
   * function driver to inform it that data has arrived.
   */
  
@@ -1494,7 +1503,7 @@
  struct urb {
  
        struct usb_endpoint_instance *endpoint;
-@@ -603,6 +608,12 @@
+@@ -603,6 +608,12 @@ struct usb_device_instance {
        unsigned long usbd_rxtx_timestamp;
        unsigned long usbd_last_rxtx_timestamp;
  
@@ -1507,7 +1516,7 @@
  };
  
  /* Bus Interface configuration structure
-@@ -632,6 +643,8 @@
+@@ -632,6 +643,8 @@ extern char *usbd_device_status[];
  extern char *usbd_device_requests[];
  extern char *usbd_device_descriptors[];
  
@@ -1518,8 +1527,8 @@
  urb_link *first_urb_link (urb_link * hd);
 Index: u-boot/drivers/usbtty.h
 ===================================================================
---- u-boot.orig/drivers/usbtty.h       2007-02-28 03:51:25.000000000 +0100
-+++ u-boot/drivers/usbtty.h    2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/drivers/usbtty.h
++++ u-boot/drivers/usbtty.h
 @@ -71,4 +71,10 @@
  #define STR_CTRL_INTERFACE    0x06
  #define STR_COUNT             0x07
@@ -1533,8 +1542,8 @@
  #endif
 Index: u-boot/include/configs/qt2410.h
 ===================================================================
---- u-boot.orig/include/configs/qt2410.h       2007-02-28 03:51:24.000000000 
+0100
-+++ u-boot/include/configs/qt2410.h    2007-02-28 03:51:25.000000000 +0100
+--- u-boot.orig/include/configs/qt2410.h
++++ u-boot/include/configs/qt2410.h
 @@ -199,7 +199,8 @@
  #define CONFIG_USBD_PRODUCT_NAME      "QT2410 Bootloader " U_BOOT_VERSION
  #define CONFIG_EXTRA_ENV_SETTINGS     "usbtty=cdc_acm\0"




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

Reply via email to