Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

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. r4067 - in trunk/src/target/gsm: include/gsmd include/libgsmd
      src/gsmd src/libgsmd src/util ([EMAIL PROTECTED])
   2. r4068 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   3. r4069 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   4. r4070 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: erin_yueh
Date: 2008-02-15 12:10:16 +0100 (Fri, 15 Feb 2008)
New Revision: 4067

Modified:
   trunk/src/target/gsm/include/gsmd/gsmd.h
   trunk/src/target/gsm/include/gsmd/usock.h
   trunk/src/target/gsm/include/libgsmd/misc.h
   trunk/src/target/gsm/src/gsmd/usock.c
   trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c
   trunk/src/target/gsm/src/util/shell.c
Log:
gsmd: add retrieving phone info (Erin Yueh)


Modified: trunk/src/target/gsm/include/gsmd/gsmd.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/gsmd.h    2008-02-15 07:23:19 UTC (rev 
4066)
+++ trunk/src/target/gsm/include/gsmd/gsmd.h    2008-02-15 11:10:16 UTC (rev 
4067)
@@ -73,6 +73,7 @@
 #define GSMD_FLAG_SMS_FMT_TEXT 0x0002  /* TODO Use TEXT rather than PDU mode */
 
 #define GSMD_ATCMD_TIMEOUT     60      /* If doesn get respond within 60 secs, 
discard */
+#define GSMD_MAX_INFO_LEN      64      /* by the standard it should be 2048, 
way too much :) */
 
 struct gsmd {
        unsigned int flags;

Modified: trunk/src/target/gsm/include/gsmd/usock.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/usock.h   2008-02-15 07:23:19 UTC (rev 
4066)
+++ trunk/src/target/gsm/include/gsmd/usock.h   2008-02-15 11:10:16 UTC (rev 
4067)
@@ -135,6 +135,10 @@
        GSMD_PHONE_POWERUP      = 1,
        GSMD_PHONE_POWERDOWN    = 2,
        GSMD_PHONE_GET_IMSI     = 3,
+       GSMD_PHONE_GET_MANUF    = 4,
+       GSMD_PHONE_GET_MODEL    = 5,
+       GSMD_PHONE_GET_REVISION = 6,
+       GSMD_PHONE_GET_SERIAL   = 7,
 };
 
 enum gsmd_msg_modem {

Modified: trunk/src/target/gsm/include/libgsmd/misc.h
===================================================================
--- trunk/src/target/gsm/include/libgsmd/misc.h 2008-02-15 07:23:19 UTC (rev 
4066)
+++ trunk/src/target/gsm/include/libgsmd/misc.h 2008-02-15 11:10:16 UTC (rev 
4067)
@@ -11,20 +11,6 @@
 extern int lgsm_phone_power(struct lgsm_handle *lh, int power);
 extern int lgsm_modem_power(struct lgsm_handle *lh, int power);
 
-enum lgsm_info_type {
-       LGSM_INFO_TYPE_NONE             = 0,
-       LGSM_INFO_TYPE_MANUF            = 1,
-       LGSM_INFO_TYPE_MODEL            = 2,
-       LGSM_INFO_TYPE_REVISION         = 3,
-       LGSM_INFO_TYPE_SERIAL           = 4,
-       LGSM_INFO_TYPE_IMSI             = 5,
-};
-
-/* Get some information about the handset */
-extern int lgsm_get_info(struct lgsm_handle *lh,
-                        enum lgsm_info_type type,
-                        char *ret_string, u_int16_t len);
-
 /* Authenticate to SIM Card using specified null-terminated pin */
 extern int lgsm_pin_auth(struct lgsm_handle *lh, const char *pin);
 
@@ -73,6 +59,14 @@
 
 /* Retrieve IMSI information */
 extern int lgsm_get_imsi(struct lgsm_handle *lh);
+/* Retrieve manufacturer information */
+extern int lgsm_get_manufacturer(struct lgsm_handle *lh);
+/* Retrieve model information */
+extern int lgsm_get_model(struct lgsm_handle *lh);
+/* Retrieve revision information */
+extern int lgsm_get_revision(struct lgsm_handle *lh);
+/* Retrieve serial information */
+extern int lgsm_get_serial(struct lgsm_handle *lh);
 /* Set voice mail number */
 extern int lgsm_voicemail_set(struct lgsm_handle *lh, const char *number);
 /* Get currently configured voice mail number */

Modified: trunk/src/target/gsm/src/gsmd/usock.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/usock.c       2008-02-15 07:23:19 UTC (rev 
4066)
+++ trunk/src/target/gsm/src/gsmd/usock.c       2008-02-15 11:10:16 UTC (rev 
4067)
@@ -613,6 +613,58 @@
                        cmd->id, sizeof(ret), &ret);
 }
 
+static int gsmd_get_manuf_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+{
+       struct gsmd_user *gu = ctx;
+
+       DEBUGP("cmd = '%s', resp: '%s'\n", cmd->buf, resp);
+       if (strncmp(resp, "+CGMI: ", 7))
+               return -EINVAL;
+       resp += 7;
+       return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_MANUF,
+                       cmd->id, strlen(resp) + 1, resp);
+       return 0;
+}
+
+static int gsmd_get_model_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+{
+       struct gsmd_user *gu = ctx;
+
+       DEBUGP("cmd = '%s', resp: '%s'\n", cmd->buf, resp);
+       if (strncmp(resp, "+CGMM: ", 7))
+               return -EINVAL;
+       resp += 7;
+       return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_MODEL,
+                       cmd->id, strlen(resp) + 1, resp);
+       return 0;
+}
+
+static int gsmd_get_revision_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+{
+       struct gsmd_user *gu = ctx;
+
+       DEBUGP("cmd = '%s', resp: '%s'\n", cmd->buf, resp);
+       if (strncmp(resp, "+CGMR: ", 7))
+               return -EINVAL;
+       resp += 7;
+       return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_REVISION,
+                       cmd->id, strlen(resp) + 1, resp);
+       return 0;
+}
+
+static int gsmd_get_serial_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+{
+       struct gsmd_user *gu = ctx;
+
+       DEBUGP("cmd = '%s', resp: '%s'\n", cmd->buf, resp);
+       if (strncmp(resp, "+CGSN: ", 7))
+               return -EINVAL;
+       resp += 7;
+       return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_SERIAL,
+                       cmd->id, strlen(resp) + 1, resp);
+       return 0;
+}
+
 static int usock_rcv_phone(struct gsmd_user *gu, struct gsmd_msg_hdr *gph, 
                           int len)
 {
@@ -621,18 +673,34 @@
        switch (gph->msg_subtype) {
        case GSMD_PHONE_POWERUP:
                cmd = atcmd_fill("AT+CFUN=1", 9+1,
-                                &phone_powerup_cb, gu, 0, NULL);
+                               &phone_powerup_cb, gu, 0, NULL);
                break;
 
        case GSMD_PHONE_POWERDOWN:
                cmd = atcmd_fill("AT+CFUN=0", 9+1,
-                                &phone_powerdown_cb, gu, 0, NULL);
+                               &phone_powerdown_cb, gu, 0, NULL);
                gu->gsmd->dev_state.on = 0;
                break;
        case GSMD_PHONE_GET_IMSI:
                return gsmd_ucmd_submit(gu, GSMD_MSG_PHONE, GSMD_PHONE_GET_IMSI,
                        0, strlen(gu->gsmd->imsi) + 1, gu->gsmd->imsi);
                break;
+       case GSMD_PHONE_GET_MANUF:
+               cmd = atcmd_fill("AT+CGMI", 7+1,
+                               &gsmd_get_manuf_cb, gu, 0, NULL);
+               break;
+       case GSMD_PHONE_GET_MODEL:
+               cmd = atcmd_fill("AT+CGMM", 7+1,
+                               &gsmd_get_model_cb, gu, 0, NULL);
+               break;
+       case GSMD_PHONE_GET_REVISION:
+               cmd = atcmd_fill("AT+CGMR", 7+1,
+                               &gsmd_get_revision_cb, gu, 0, NULL);
+               break;
+       case GSMD_PHONE_GET_SERIAL:
+               cmd = atcmd_fill("AT+CGSN", 7+1,
+                               &gsmd_get_serial_cb, gu, 0, NULL);
+               break;
 
        default:
                return -EINVAL;

Modified: trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c
===================================================================
--- trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c    2008-02-15 07:23:19 UTC 
(rev 4066)
+++ trunk/src/target/gsm/src/libgsmd/libgsmd_phone.c    2008-02-15 11:10:16 UTC 
(rev 4067)
@@ -50,3 +50,23 @@
        return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_IMSI);
 }
 
+int lgsm_get_manufacturer(struct lgsm_handle *lh)
+{
+       return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_MANUF);
+}
+
+int lgsm_get_model(struct lgsm_handle *lh)
+{
+       return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_MODEL);
+}
+
+int lgsm_get_revision(struct lgsm_handle *lh)
+{
+       return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_REVISION);
+}
+
+int lgsm_get_serial(struct lgsm_handle *lh)
+{
+       return lgsm_send_simple(lh, GSMD_MSG_PHONE, GSMD_PHONE_GET_SERIAL);
+}
+

Modified: trunk/src/target/gsm/src/util/shell.c
===================================================================
--- trunk/src/target/gsm/src/util/shell.c       2008-02-15 07:23:19 UTC (rev 
4066)
+++ trunk/src/target/gsm/src/util/shell.c       2008-02-15 11:10:16 UTC (rev 
4067)
@@ -400,6 +400,22 @@
                payload = (char *)gmh + sizeof(*gmh);
                printf("imsi <%s>\n", payload);
                break;
+       case GSMD_PHONE_GET_MANUF:
+               payload = (char *)gmh + sizeof(*gmh);
+               printf("manufacturer: %s\n", payload);
+               break;
+       case GSMD_PHONE_GET_MODEL:
+               payload = (char *)gmh + sizeof(*gmh);
+               printf("model: %s\n", payload);
+               break;
+       case GSMD_PHONE_GET_REVISION:
+               payload = (char *)gmh + sizeof(*gmh);
+               printf("revision: %s\n", payload);
+               break;
+       case GSMD_PHONE_GET_SERIAL:
+               payload = (char *)gmh + sizeof(*gmh);
+               printf("serial: %s\n", payload);
+               break;
        case GSMD_PHONE_POWERUP:
                if (*intresult)
                        printf("Modem power-up failed: %i\n", *intresult);
@@ -551,6 +567,10 @@
                "\tgvm\tGet Voicemail number\n"
                "\tsvm\tSet Voicemail number(svm=number)\n"
                "\tim\tGet imsi\n"
+               "\tmf\tGet manufacturer\n"
+               "\tml\tGet model\n"
+               "\trv\tGet revision\n"
+               "\tsn\tGet serial number\n"
                "\tcs\tGet Call status\n"
                "\tgp\tGet PIN status\n"
                "\tRh\tRelease all held calls (+CHLD=0)\n"
@@ -864,6 +884,22 @@
                                printf("Get imsi\n");
                                lgsm_get_imsi(lgsmh);
                                pending_responses ++;
+                       } else if (!strncmp(buf, "mf", 2)) {
+                               printf("Get manufacturer\n");
+                               lgsm_get_manufacturer(lgsmh);
+                               pending_responses ++;
+                       } else if (!strncmp(buf, "ml", 2)) {
+                               printf("Get model\n");
+                               lgsm_get_model(lgsmh);
+                               pending_responses ++;
+                       } else if (!strncmp(buf, "rv", 2)) {
+                               printf("Get revision\n");
+                               lgsm_get_revision(lgsmh);
+                               pending_responses ++;
+                       } else if (!strncmp(buf, "sn", 2)) {
+                               printf("Get serial number\n");
+                               lgsm_get_serial(lgsmh);
+                               pending_responses ++;
                        } else if ( strlen(buf)==1 && !strncmp(buf, "M", 1)) {
                                printf("Modem Power On\n");
                                lgsm_modem_power(lgsmh, 1);




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-15 13:38:50 +0100 (Fri, 15 Feb 2008)
New Revision: 4068

Modified:
   trunk/src/target/u-boot/patches/boot-menu.patch
Log:
We don't need to hard-code the "factory reset" option. Just having it in
the environment will work as well. (Unless the environment is too badly
messed up.)

board/neo1973/common/bootmenu.c (factory_reset, neo1973_bootmenu): removed
  hard-coded "factory reset" default



Modified: trunk/src/target/u-boot/patches/boot-menu.patch
===================================================================
--- trunk/src/target/u-boot/patches/boot-menu.patch     2008-02-15 11:10:16 UTC 
(rev 4067)
+++ trunk/src/target/u-boot/patches/boot-menu.patch     2008-02-15 12:38:50 UTC 
(rev 4068)
@@ -24,7 +24,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/common/bootmenu.c
-@@ -0,0 +1,122 @@
+@@ -0,0 +1,113 @@
 +/*
 + * bootmenu.c - Boot menu
 + *
@@ -95,14 +95,6 @@
 +}
 +
 +
-+static void factory_reset(void *user)
-+{
-+      default_env();
-+      run_command("dynpart", 0);
-+      run_command("bootd", 0);
-+}
-+
-+
 +static int seconds(void *user)
 +{
 +      return neo1973_new_second();
@@ -144,7 +136,6 @@
 +{
 +      bootmenu_add("Boot", NULL, "bootd");
 +      bootmenu_init(&bootmenu_setup);
-+      bootmenu_add("Factory reset", factory_reset, NULL);
 +      bootmenu();
 +}
 Index: u-boot/board/neo1973/gta01/gta01.c
@@ -361,7 +352,7 @@
 +COBJS-y += bootmenu.o
  COBJS-y += circbuf.o
  COBJS-y += cmd_autoscript.o
- COBJS-y += cmd_bdinfo.o
+ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 Index: u-boot/common/bootmenu.c
 ===================================================================
 --- /dev/null




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-15 14:20:43 +0100 (Fri, 15 Feb 2008)
New Revision: 4069

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch
Log:
From: Andrew Paulsen <[EMAIL PROTECTED]>

The battery temperature measurement did not work since it incorrectly
assumed that there is a 10k resistor in parallel with the thermistor.  This
patch should fix it.

This is the Scilab script used to calculate the table:

// Resistance at room temperature
R0 = 10000
// Characteristic of thermistor
B = 3370

// Celsius -> Kelvin offset
K_OFFSET = 273.15;

// Room temperature (C -> K)
T0 = 25;
T0 = T0 + K_OFFSET;

// Define a temperature sweep
T = -10:1:79;
// Offset the temperatures so results are rounded to nearest whole numbers
T = T + 0.5;
T = T + K_OFFSET;

// Loop over every temperature and calculate the thermistor resistance
for i = 1:length(T)
        RT(i) = R0 * exp(B * ((1/T(i)) - (1/T0)));
        RT(i) = round(RT(i));
end

// Dump the table
RT



Modified: branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch    
2008-02-15 12:38:50 UTC (rev 4068)
+++ branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch    
2008-02-15 13:20:43 UTC (rev 4069)
@@ -8,7 +8,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24/drivers/i2c/chips/pcf50606.c
-@@ -0,0 +1,1941 @@
+@@ -0,0 +1,1937 @@
 +/* Philips/NXP PCF50606 Power Management Unit (PMU) driver
 + *
 + * (C) 2006-2007 by OpenMoko, Inc.
@@ -140,18 +140,19 @@
 +
 +static struct platform_device *pcf50606_pdev;
 +
-+/* This is a mitsubishi TN11-3H103J T,B NTC Thermistor -10..79 centigrade */
-+static const u_int16_t ntc_table_tn11_3h103j[] = {
++/* This is a 10k, B=3370 NTC Thermistor -10..79 centigrade */
++/* Table entries are offset by +0.5C so a properly rounded value is generated 
*/
++static const u_int16_t ntc_table_10k_3370B[] = {
 +      /* -10 */
-+      40260, 38560, 36950, 35410, 33950, 32550, 31220, 29960, 28750, 27590,
-+      26490, 25440, 24440, 23480, 22560, 21680, 20830, 20020, 19240, 18500,
-+      17780, 17710, 16440, 15810, 15210, 14630, 14070, 13540, 13030, 12540,
-+      12070, 11620, 11190, 10780, 10380, 10000, 9635, 9286, 8950, 8629,
-+      8320, 8024, 7740, 7467, 7205, 6954, 6713, 6481, 6258, 6044,
-+      5839, 5641, 5451, 5269, 5093, 4924, 4762, 4605, 4455, 4310,
-+      4171, 4037, 3908, 3784, 3664, 3549, 3438, 3313, 3227, 3128,
-+      3032, 2939, 2850, 2763, 2680, 2600, 2522, 2448, 2375, 2306,
-+      2239, 2174, 2111, 2050, 1922, 1935, 1881, 1828, 1776, 1727,
++      43888, 41819, 39862, 38010, 36257, 34596, 33024, 31534, 30121, 28781,
++      27510, 26304, 25159, 24071, 23038, 22056, 21122, 20234, 19390, 18586,
++      17821, 17093, 16399, 15738, 15107, 14506, 13933, 13387, 12865, 12367,
++      11891, 11437, 11003, 10588, 10192, 9813, 9450, 9103, 8771, 8453,
++      8149, 7857, 7578, 7310, 7054, 6808, 6572, 6346, 6129, 5920,
++      5720, 5528, 5344, 5167, 4996, 4833, 4675, 4524, 4379, 4239,
++      4104, 3975, 3850, 3730, 3614, 3503, 3396, 3292, 3193, 3097,
++      3004, 2915, 2829, 2745, 2665, 2588, 2513, 2441, 2371, 2304,
++      2239, 2176, 2116, 2057, 2000, 1945, 1892, 1841, 1791, 1743,
 +};
 +
 +
@@ -925,15 +926,10 @@
 +}
 +EXPORT_SYMBOL_GPL(pcf50606_charge_fast);
 +
-+#define ONE                   1000000
 +static inline u_int16_t adc_to_rntc(struct pcf50606_data *pcf, u_int16_t adc)
 +{
-+      u_int32_t r_batt = (adc * pcf->pdata->r_fix_batt) / (1023 - adc);
-+      u_int16_t r_ntc;
++      u_int32_t r_ntc = (adc * (u_int32_t)pcf->pdata->r_fix_batt) / (1023 - 
adc);
 +
-+      /* The battery NTC has a parallell 10kOhms resistor */
-+      r_ntc = ONE / ((ONE/r_batt) - (ONE/pcf->pdata->r_fix_batt_par));
-+
 +      return r_ntc;
 +}
 +
@@ -941,11 +937,11 @@
 +{
 +      int i;
 +
-+      for (i = 0; i < ARRAY_SIZE(ntc_table_tn11_3h103j); i++) {
-+              if (rntc > ntc_table_tn11_3h103j[i])
-+                      return i - 10;
++      for (i = 0; i < ARRAY_SIZE(ntc_table_10k_3370B); i++) {
++              if (rntc > ntc_table_10k_3370B[i])
++                      return i - 10;  /* First element is -10 */
 +      }
-+      return 2342;
++      return -99;     /* Below our range */
 +}
 +
 +static ssize_t show_battemp(struct device *dev, struct device_attribute *attr,




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-02-15 15:13:49 +0100 (Fri, 15 Feb 2008)
New Revision: 4070

Modified:
   trunk/src/target/u-boot/patches/boot-menu.patch
   trunk/src/target/u-boot/patches/gta02-bootmenu.patch
   trunk/src/target/u-boot/patches/gta02-nor.patch
   trunk/src/target/u-boot/patches/neo1973-gsmver.patch
   trunk/src/target/u-boot/patches/series
   trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
   trunk/src/target/u-boot/patches/uboot-gta02.patch
   trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch
Log:
Merge neo1973-gsmver.patch into uboot-20061030-neo1973.patch, where
the rest of the neo1973 commands are.

uboot-20061030-neo1973.patch: merged neo1973-gsmver.patch

neo1973-gsmver.patch, series: removed neo1973-gsmver.patch

uboot-s3c2410_udc.patch, boot-menu.patch:
- board/neo1973/gta01/Makefile: updated for neo1973-gsmver.patch move

uboot-gta02.patch, gta02-nor.patch:
- board/neo1973/gta02/Makefile: updated for neo1973-gsmver.patch move

Non-trivial commits to neo1973-gsmver.patch:

------------------------------------------------------------------------
r3184 | laforge | 2007-10-16 05:38:08 -0300 (Tue, 16 Oct 2007) | 2 lines

don't try to find double-quotes in GSM version, not all gsm firmware versions 
have those

------------------------------------------------------------------------
r2929 | laforge | 2007-09-05 14:42:17 -0300 (Wed, 05 Sep 2007) | 2 lines

add command to read out gsm firmware version using u-boot (jserv)

------------------------------------------------------------------------



Modified: trunk/src/target/u-boot/patches/boot-menu.patch
===================================================================
--- trunk/src/target/u-boot/patches/boot-menu.patch     2008-02-15 13:20:43 UTC 
(rev 4069)
+++ trunk/src/target/u-boot/patches/boot-menu.patch     2008-02-15 14:13:49 UTC 
(rev 4070)
@@ -261,12 +261,12 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/gta01/Makefile
 +++ u-boot/board/neo1973/gta01/Makefile
-@@ -25,7 +25,7 @@
- 
+@@ -26,7 +26,7 @@
  LIB   = lib$(BOARD).a
  
--OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o 
../common/udc.o
-+OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o 
../common/udc.o ../common/bootmenu.o
+ OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o \
+-         ../common/gsmver.o ../common/udc.o
++         ../common/gsmver.o ../common/udc.o ../common/bootmenu.o
  SOBJS := ../common/lowlevel_init.o
  
  .PHONY:       all

Modified: trunk/src/target/u-boot/patches/gta02-bootmenu.patch
===================================================================
--- trunk/src/target/u-boot/patches/gta02-bootmenu.patch        2008-02-15 
13:20:43 UTC (rev 4069)
+++ trunk/src/target/u-boot/patches/gta02-bootmenu.patch        2008-02-15 
14:13:49 UTC (rev 4070)
@@ -60,4 +60,4 @@
 +      return !!(gpio->GPFDAT & (1 << 6));
  }
  
- /* The sum of all part_size[]s must equal to the NAND size, i.e., 0x8000000. 
*/
+ /* The sum of all part_size[]s must equal to or greater than the NAND size,

Modified: trunk/src/target/u-boot/patches/gta02-nor.patch
===================================================================
--- trunk/src/target/u-boot/patches/gta02-nor.patch     2008-02-15 13:20:43 UTC 
(rev 4069)
+++ trunk/src/target/u-boot/patches/gta02-nor.patch     2008-02-15 14:13:49 UTC 
(rev 4070)
@@ -8,9 +8,9 @@
  
 -OBJS  := gta02.o pcf50633.o nand.o ../common/cmd_neo1973.o \
 +OBJS  := gta02.o pcf50633.o nand.o nor.o ../common/cmd_neo1973.o \
+          ../common/gsmver.o \
           ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o
  SOBJS := ../common/lowlevel_init.o
- 
 Index: u-boot/board/neo1973/gta02/nor.c
 ===================================================================
 --- /dev/null
@@ -77,7 +77,7 @@
  #define       CFG_ENV_IS_IN_NAND      1
  #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 */
-@@ -274,9 +272,13 @@
+@@ -277,11 +275,15 @@
  #define CONFIG_DRIVER_PCF50633                1
  #define       CONFIG_RTC_PCF50633             1
  
@@ -92,6 +92,8 @@
 +#define CFG_MAX_FLASH_SECT 1
 +
  #define DFU_NUM_ALTERNATES    7
+ 
+ #endif        /* __CONFIG_H */
 Index: u-boot/drivers/mtd/nand/nand_bbt.c
 ===================================================================
 --- u-boot.orig/drivers/mtd/nand/nand_bbt.c

Modified: trunk/src/target/u-boot/patches/neo1973-gsmver.patch
===================================================================
--- trunk/src/target/u-boot/patches/neo1973-gsmver.patch        2008-02-15 
13:20:43 UTC (rev 4069)
+++ trunk/src/target/u-boot/patches/neo1973-gsmver.patch        2008-02-15 
14:13:49 UTC (rev 4070)
@@ -116,28 +116,3 @@
 +
 +      return 0;
 +}
-Index: u-boot/board/neo1973/gta01/Makefile
-===================================================================
---- u-boot.orig/board/neo1973/gta01/Makefile
-+++ u-boot/board/neo1973/gta01/Makefile
-@@ -25,7 +25,7 @@
- 
- LIB   = lib$(BOARD).a
- 
--OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o 
../common/udc.o ../common/bootmenu.o
-+OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/gsmver.o 
../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o
- SOBJS := ../common/lowlevel_init.o
- 
- .PHONY:       all
-Index: u-boot/board/neo1973/gta02/Makefile
-===================================================================
---- u-boot.orig/board/neo1973/gta02/Makefile
-+++ u-boot/board/neo1973/gta02/Makefile
-@@ -26,6 +26,7 @@
- LIB   = lib$(BOARD).a
- 
- OBJS  := gta02.o pcf50633.o nand.o nor.o ../common/cmd_neo1973.o \
-+         ../common/gsmver.o \
-          ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o
- SOBJS := ../common/lowlevel_init.o
- 

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2008-02-15 13:20:43 UTC (rev 
4069)
+++ trunk/src/target/u-boot/patches/series      2008-02-15 14:13:49 UTC (rev 
4070)
@@ -75,12 +75,12 @@
 gta02-nor.patch
 
 # need to find out how upstream feels about this one
+glamo-mmc.patch
 eabi-toolchain.patch
 
 # for review, merge soon
 unbusy-i2c.patch 
 usbtty-irq-racecondition-fix.patch
-neo1973-gsmver.patch
 uboot-nand_write_yaffs.patch
 uboot-neo1973_defaultconsole_usbtty.patch
 

Modified: trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch        
2008-02-15 13:20:43 UTC (rev 4069)
+++ trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch        
2008-02-15 14:13:49 UTC (rev 4070)
@@ -326,7 +326,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/common/cmd_neo1973.c
-@@ -0,0 +1,124 @@
+@@ -0,0 +1,126 @@
 +/*
 + * (C) Copyright 2006 by OpenMoko, Inc.
 + * Author: Harald Welte <[EMAIL PROTECTED]>
@@ -414,8 +414,10 @@
 +                      goto out_help;
 +              if (!strcmp(argv[2], "on"))
 +                      neo1973_gsm(1);
-+              else
++              else if (!strcmp(argv[2], "off"))
 +                      neo1973_gsm(0);
++              else if (!strcmp(argv[2], "version"))
++                      neo1973_gsmver();
 +      } else if (!strcmp(argv[1], "gps")) {
 +              if (argc < 3)
 +                      goto out_help;
@@ -447,7 +449,7 @@
 +      "neo1973 backlight (on|off) - switch backlight on or off\n"
 +      "neo1973 led num (on|off) - switch LED number 'num' on or off\n"
 +      "neo1973 vibrator (on|off) - switch vibrator on or off\n"
-+      "neo1973 gsm (on|off) - switch GSM Modem on or off\n"
++      "neo1973 gsm (on|off|version) - switch GSM Modem on/off or print 
firmware version\n"
 +      "neo1973 gps (on|off) - switch GPS system on or off\n"
 +);
 +#endif        /* CONFIG_CMD_BDI */
@@ -1091,7 +1093,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/gta01/Makefile
-@@ -0,0 +1,47 @@
+@@ -0,0 +1,48 @@
 +#
 +# (C) Copyright 2000, 2001, 2002
 +# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
@@ -1119,7 +1121,8 @@
 +
 +LIB   = lib$(BOARD).a
 +
-+OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o
++OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o \
++         ../common/gsmver.o
 +SOBJS := ../common/lowlevel_init.o
 +
 +$(LIB):       $(OBJS) $(SOBJS)
@@ -2420,3 +2423,88 @@
 +#endif /* CONFIG_RTC_PCF50606 && CONFIG_CMD_DATE */
 +
 +#endif /* CONFIG DRIVER_PCF50606 */
+Index: u-boot/board/neo1973/common/gsmver.c
+===================================================================
+--- /dev/null
++++ u-boot/board/neo1973/common/gsmver.c
+@@ -0,0 +1,80 @@
++/*
++ * (C) Copyright 2007 OpenMoko, Inc.
++ * Written by Jim Huang <[EMAIL PROTECTED]>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++/*
++ * Boot support
++ */
++#include <common.h>
++#include <devices.h>
++
++#define GSM_UART_DEVICE  "s3ser0"
++
++int neo1973_gsmver()
++{
++      int i;
++      device_t *dev = NULL;
++      int string_end_count = 0;
++
++      /* Scan for selected output/input device */
++      for (i = 1; i <= ListNumItems (devlist); i++) {
++              device_t *tmp = ListGetPtrToItem (devlist, i);
++              if (!strcmp(tmp->name, GSM_UART_DEVICE)) {
++                      dev = tmp;
++                      break;
++              }
++      }
++      if (!dev)
++              return -1;
++
++#if defined(CONFIG_ARCH_GTA01_v3) || defined(CONFIG_ARCH_GTA01_v4) || \
++      defined(CONFIG_ARCH_GTA01B_v2) || defined(CONFIG_ARCH_GTA01B_v3) || \
++      defined(CONFIG_ARCH_GTA01B_v4)
++      neo1973_gta01_serial0_gsm(1);
++#endif
++
++      /* Query GSM firmware information by AT command */
++      dev->puts("AT+CGMR\r\n");
++      puts("GSM firmware version: ");
++
++      /* read from serial and display version information */
++      while (1) {
++              if (dev->tstc()) {
++                      i = dev->getc();
++                      putc(i);
++                      /* FIXME: should we just dump straightforward
++                       * version string such as "moko1" or "moko4"?
++                       */
++                      if (i == '\n' || i == '\r')
++                              continue;
++              }
++      }
++      putc('\n');
++
++#if defined(CONFIG_ARCH_GTA01_v3) || defined(CONFIG_ARCH_GTA01_v4) || \
++    defined(CONFIG_ARCH_GTA01B_v2) || defined(CONFIG_ARCH_GTA01B_v3) || \
++    defined(CONFIG_ARCH_GTA01B_v4)
++      neo1973_gta01_serial0_gsm(0);
++#endif
++
++      return 0;
++}

Modified: trunk/src/target/u-boot/patches/uboot-gta02.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-gta02.patch   2008-02-15 13:20:43 UTC 
(rev 4069)
+++ trunk/src/target/u-boot/patches/uboot-gta02.patch   2008-02-15 14:13:49 UTC 
(rev 4070)
@@ -23,7 +23,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/gta02/Makefile
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,66 @@
 +#
 +# (C) Copyright 2000, 2001, 2002
 +# Wolfgang Denk, DENX Software Engineering, [EMAIL PROTECTED]
@@ -52,6 +52,7 @@
 +LIB   = lib$(BOARD).a
 +
 +OBJS  := gta02.o pcf50633.o nand.o ../common/cmd_neo1973.o \
++         ../common/gsmver.o \
 +         ../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o
 +SOBJS := ../common/lowlevel_init.o
 +

Modified: trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch     2008-02-15 
13:20:43 UTC (rev 4069)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch     2008-02-15 
14:13:49 UTC (rev 4070)
@@ -908,7 +908,7 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/common/cmd_neo1973.c
 +++ u-boot/board/neo1973/common/cmd_neo1973.c
-@@ -94,6 +94,18 @@
+@@ -96,6 +96,18 @@
                        neo1973_gps(1);
                else
                        neo1973_gps(0);
@@ -927,9 +927,9 @@
        } else {
  out_help:
                printf("Usage:\n%s\n", cmdtp->usage);
-@@ -120,5 +132,6 @@
+@@ -122,5 +134,6 @@
        "neo1973 vibrator (on|off) - switch vibrator on or off\n"
-       "neo1973 gsm (on|off) - switch GSM Modem on or off\n"
+       "neo1973 gsm (on|off|version) - switch GSM Modem on/off or print 
firmware version\n"
        "neo1973 gps (on|off) - switch GPS system on or off\n"
 +      "neo1973 udc pullup (on|off) - switch USB device controller pull-up on 
or off\n"
  );
@@ -938,12 +938,12 @@
 ===================================================================
 --- u-boot.orig/board/neo1973/gta01/Makefile
 +++ u-boot/board/neo1973/gta01/Makefile
-@@ -25,7 +25,7 @@
- 
+@@ -26,7 +26,7 @@
  LIB   = lib$(BOARD).a
  
--OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o
-+OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o 
../common/udc.o
+ OBJS  := gta01.o pcf50606.o ../common/cmd_neo1973.o ../common/jbt6k74.o \
+-         ../common/gsmver.o
++         ../common/gsmver.o ../common/udc.o
  SOBJS := ../common/lowlevel_init.o
  
  $(LIB):       $(OBJS) $(SOBJS)




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to