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. r4184 - branches/src/target/kernel/2.6.24.x/patches
      ([EMAIL PROTECTED])
   2. r4185 - developers/werner/bin ([EMAIL PROTECTED])
   3. r4186 - developers/werner/bin ([EMAIL PROTECTED])
   4. r4187 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   5. r4188 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
   6. r4189 - trunk/src/target/u-boot/patches ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-03-09 12:44:23 +0100 (Sun, 09 Mar 2008)
New Revision: 4184

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch
Log:
From: Willie <[EMAIL PROTECTED]>

Use GPIOs to control LEDs.

gta02-leds.patch:
drivers/leds/leds-neo1973-gta02.c (gta02led_probe): turn off PWMs and set GPIO
  pins controlling LEDs as outputs


fix-gpio-led-patch-still-pwm-t3.patch

Starting up all the PWMs seems to be needed for PWM3 operation
and FIQ / HDQ / VIB operation.  But after starting, turn the
LEDs to GPIO-only.

Applies on top of Willie's patch

Signed-off-by: Andy Green <[EMAIL PROTECTED]>

gta02-leds.patch:
drivers/leds/leds-neo1973-gta02.c (gta02led_probe): revert turning off PWMs
drivers/leds/leds-neo1973-gta02.c (gta02led_probe): unconditionally enable PWM
drivers/leds/leds-neo1973-gta02.c (gta02led_probe): turning off PWMs at the end



Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch        
2008-03-09 10:53:36 UTC (rev 4183)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-leds.patch        
2008-03-09 11:44:23 UTC (rev 4184)
@@ -1,7 +1,7 @@
-Index: linux-2.6/drivers/leds/Kconfig
+Index: linux-2.6.24/drivers/leds/Kconfig
 ===================================================================
---- linux-2.6.orig/drivers/leds/Kconfig
-+++ linux-2.6/drivers/leds/Kconfig
+--- linux-2.6.24.orig/drivers/leds/Kconfig
++++ linux-2.6.24/drivers/leds/Kconfig
 @@ -120,6 +120,12 @@
        help
          This option enables support for the vibrator on the FIC Neo1973.
@@ -15,10 +15,10 @@
  comment "LED Triggers"
  
  config LEDS_TRIGGERS
-Index: linux-2.6/drivers/leds/Makefile
+Index: linux-2.6.24/drivers/leds/Makefile
 ===================================================================
---- linux-2.6.orig/drivers/leds/Makefile
-+++ linux-2.6/drivers/leds/Makefile
+--- linux-2.6.24.orig/drivers/leds/Makefile
++++ linux-2.6.24/drivers/leds/Makefile
 @@ -20,6 +20,7 @@
  obj-$(CONFIG_LEDS_GPIO)                       += leds-gpio.o
  obj-$(CONFIG_LEDS_CM_X270)              += leds-cm-x270.o
@@ -27,11 +27,11 @@
  
  # LED Triggers
  obj-$(CONFIG_LEDS_TRIGGER_TIMER)      += ledtrig-timer.o
-Index: linux-2.6/drivers/leds/leds-neo1973-gta02.c
+Index: linux-2.6.24/drivers/leds/leds-neo1973-gta02.c
 ===================================================================
 --- /dev/null
-+++ linux-2.6/drivers/leds/leds-neo1973-gta02.c
-@@ -0,0 +1,216 @@
++++ linux-2.6.24/drivers/leds/leds-neo1973-gta02.c
+@@ -0,0 +1,226 @@
 +/*
 + * LED driver for the FIC Neo1973 GTA02 GSM phone
 + *
@@ -184,13 +184,23 @@
 +                      break;
 +              }
 +
-+              if (lp->has_pwm) {
-+                      lp->pwm.prescaler = 0;
-+                      lp->pwm.divider = S3C2410_TCFG1_MUX3_DIV8;
-+                      lp->pwm.counter = COUNTER;
-+                      lp->pwm.comparer = COUNTER;
-+                      s3c2410_pwm_enable(&lp->pwm);
-+                      s3c2410_pwm_start(&lp->pwm);
++              lp->pwm.prescaler = 0;
++              lp->pwm.divider = S3C2410_TCFG1_MUX3_DIV8;
++              lp->pwm.counter = COUNTER;
++              lp->pwm.comparer = COUNTER;
++              s3c2410_pwm_enable(&lp->pwm);
++              s3c2410_pwm_start(&lp->pwm);
++
++              switch (lp->gpio) {
++              case S3C2410_GPB0:
++              case S3C2410_GPB1:
++              case S3C2410_GPB2:
++                      lp->has_pwm = 0;
++                      s3c2410_gpio_cfgpin(lp->gpio, S3C2410_GPIO_OUTPUT);
++                      s3c2410_gpio_setpin(lp->gpio, 0);
++                      break;
++              default:
++                      break;
 +              }
 +
 +              mutex_init(&lp->mutex);




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-03-09 13:16:28 +0100 (Sun, 09 Mar 2008)
New Revision: 4185

Added:
   developers/werner/bin/newnor
Log:
newnor: handy script for those of us flashing the NOR frequently



Added: developers/werner/bin/newnor
===================================================================
--- developers/werner/bin/newnor        2008-03-09 11:44:23 UTC (rev 4184)
+++ developers/werner/bin/newnor        2008-03-09 12:16:28 UTC (rev 4185)
@@ -0,0 +1,6 @@
+#!/bin/sh
+neo=192.168.0.202
+ifconfig usb0 192.168.0.200 up
+scp "${1:-nor.bin}" flashnor $neo:
+norwp rw
+ssh $neo ./flashnor "`basename \"${1:-nor.bin}\"`"


Property changes on: developers/werner/bin/newnor
___________________________________________________________________
Name: svn:executable
   + *




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-03-09 16:41:05 +0100 (Sun, 09 Mar 2008)
New Revision: 4186

Added:
   developers/werner/bin/moko-env
Log:
moko-env: that's how I set up my environment variables from .bash_profile



Added: developers/werner/bin/moko-env
===================================================================
--- developers/werner/bin/moko-env      2008-03-09 12:16:28 UTC (rev 4185)
+++ developers/werner/bin/moko-env      2008-03-09 15:41:05 UTC (rev 4186)
@@ -0,0 +1,9 @@
+export SVN=/home/moko/svn.openmoko.org/
+export PLATFORM=gta02
+export DEVICE=gta02v5
+export KERNEL=2.6.24
+export KERNELSRC_DIR=/home/moko/2624
+export UBOOT_DIR=/home/moko/2624/u-boot
+PATH=$PATH:/usr/local/openmoko/arm/bin
+PATH=$PATH:$UBOOT_DIR/tools
+PATH=$PATH:$SVN/developers/werner/moko-env


Property changes on: developers/werner/bin/moko-env
___________________________________________________________________
Name: svn:executable
   + *




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-03-09 18:09:00 +0100 (Sun, 09 Mar 2008)
New Revision: 4187

Added:
   trunk/src/target/u-boot/patches/dont-smoke.patch
Modified:
   trunk/src/target/u-boot/patches/series
Log:
This patch prevents us from drawing more than 100mA from USB, unless we're
sure we're allowed to. Thus, we don't make the upstream port produce smoke.

series: added dont-smoke.patch (for later merging into uboot-gta02.patch)

dont-smoke.patch:
- drivers/misc/pcf50633.c (pcf50633_read_charger_type, pcf50633_init): return 
  100 (mA) for USB, not 500
- drivers/misc/pcf50633.c (pcf50633_init): use pcf50633_usb_maxcurrent instead
  of open-coding current setting again
- drivers/misc/pcf50633.c (pcf50633_usb_maxcurrent): use symbolic names for
  current limits instead of numbers
- board/neo1973/gta02/pcf50633.c (pcf50633_initial_regs): set initial USB
  current to 100mA, not 500mA



Added: trunk/src/target/u-boot/patches/dont-smoke.patch
===================================================================
--- trunk/src/target/u-boot/patches/dont-smoke.patch    2008-03-09 15:41:05 UTC 
(rev 4186)
+++ trunk/src/target/u-boot/patches/dont-smoke.patch    2008-03-09 17:09:00 UTC 
(rev 4187)
@@ -0,0 +1,89 @@
+This patch prevents us from drawing more than 100mA from USB, unless we're
+sure we're allowed to. Thus, we don't make the upstream port produce smoke.
+
+Index: u-boot/board/neo1973/gta02/pcf50633.c
+===================================================================
+--- u-boot.orig/board/neo1973/gta02/pcf50633.c
++++ u-boot/board/neo1973/gta02/pcf50633.c
+@@ -107,7 +107,7 @@
+       [PCF50633_REG_MBCC4]    = 0xff, /* 255/255 == 1A adapter fast */
+       [PCF50633_REG_MBCC5]    = 0x7f, /* 127/255 == 500mA usb fast */
+       [PCF50633_REG_MBCC6]    = 0x00, /* cutoff current 1/32 * Ichg */
+-      [PCF50633_REG_MBCC7]    = 0x01, /* 1.6A max bat curr, USB 500mA */
++      [PCF50633_REG_MBCC7]    = 0x00, /* 1.6A max bat curr, USB 100mA */
+       [PCF50633_REG_MBCC8]    = 0x00,
+ 
+       [PCF50633_REG_BBCCTL]   = 0x19, /* 3V, 200uA, on */
+Index: u-boot/drivers/misc/pcf50633.c
+===================================================================
+--- u-boot.orig/drivers/misc/pcf50633.c
++++ u-boot/drivers/misc/pcf50633.c
+@@ -141,7 +141,7 @@
+ 
+       /* 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 500; /* USB power then */
++              return 100; /* USB power then */
+ 
+       return 0; /* nope, no power, just battery */
+ }
+@@ -152,7 +152,8 @@
+ void pcf50633_init(void)
+ {
+       unsigned long flags;
+-      u_int8_t i, limit;
++      u_int8_t i;
++      int limit;
+ 
+       local_irq_save(flags);
+       for (i = 0; i < PCF50633_LAST_REG; i++) {
+@@ -163,23 +164,15 @@
+       local_irq_restore(flags);
+ 
+       printf("Power: ");
+-      switch (pcf50633_read_charger_type()) {
+-      case 0: /* no charger, battery only */
+-              printf("Battery\n");
+-              limit = PCF50633_MBCC7_USB_SUSPEND;
+-              break;
+-      case 500:
+-              printf("USB / 500mA\n");
+-              limit = PCF50633_MBCC7_USB_500mA;
+-              break;
+-      default:
+-              printf("1A\n");
+-              limit = PCF50633_MBCC7_USB_1000mA;
+-              break;
++      limit = pcf50633_read_charger_type();
++      /*
++       * If we're on real USB, don't change the setting to avoid racing with
++       * USB signaling.
++       */
++      if (limit != 100) {
++              printf("%dmA\n", limit);
++              pcf50633_usb_maxcurrent(limit);
+       }
+-      pcf50633_reg_write(PCF50633_REG_MBCC7,
+-                         (pcf50633_reg_read(PCF50633_REG_MBCC7) &
+-                         (~PCF56033_MBCC7_USB_MASK)) | limit);
+ }
+ 
+ void pcf50633_usb_maxcurrent(unsigned int ma)
+@@ -187,13 +180,13 @@
+       u_int8_t val;
+ 
+       if (ma < 100)
+-              val = 0x03;
++              val = PCF50633_MBCC7_USB_SUSPEND;
+       else if (ma < 500)
+-              val = 0x00;
++              val = PCF50633_MBCC7_USB_100mA;
+       else if (ma < 1000)
+-              val = 0x01;
++              val = PCF50633_MBCC7_USB_500mA;
+       else
+-              val = 0x02;
++              val = PCF50633_MBCC7_USB_1000mA;
+ 
+       return pcf50633_reg_set_bit_mask(PCF50633_REG_MBCC7, 0x03, val);
+ }

Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2008-03-09 15:41:05 UTC (rev 
4186)
+++ trunk/src/target/u-boot/patches/series      2008-03-09 17:09:00 UTC (rev 
4187)
@@ -92,3 +92,7 @@
 
 # let's see what upstream thinks about this
 loadenv.patch
+
+# fix and improve power management
+dont-smoke.patch
+lie-low.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-03-09 22:32:13 +0100 (Sun, 09 Mar 2008)
New Revision: 4188

Modified:
   trunk/src/target/u-boot/patches/series
Log:
series: removed lie-low.patch. That was just a local experiment.



Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series      2008-03-09 17:09:00 UTC (rev 
4187)
+++ trunk/src/target/u-boot/patches/series      2008-03-09 21:32:13 UTC (rev 
4188)
@@ -95,4 +95,3 @@
 
 # fix and improve power management
 dont-smoke.patch
-lie-low.patch




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-03-10 06:47:55 +0100 (Mon, 10 Mar 2008)
New Revision: 4189

Added:
   trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch
Log:
First try at the wait for power loop. See discussion on openmoko-kernel.



Added: trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch
===================================================================
--- trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch        
2008-03-09 21:32:13 UTC (rev 4188)
+++ trunk/src/target/u-boot/patches/wait-for-power-DONTUSE.patch        
2008-03-10 05:47:55 UTC (rev 4189)
@@ -0,0 +1,168 @@
+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 500mA USB power (this is
+  for testing)
+- 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:
+- actually seems useless, because we don't seem to ever power up without
+  a battery present anyway
+- 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
+@@ -63,6 +63,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 +231,34 @@
+       return 0;
+ }
+ 
++static void wait_for_power(void)
++{
++      int seconds = 0;
++
++      while (1) {
++#if 0
++              /* battery is present -> try to boot */
++              if (!(pcf50633_reg_read(PCF50633_REG_BVMCTL) & 1))
++                      break;
++#endif
++
++              /* @@@FIXME: have to check ADC for external 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 +266,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 +275,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 +341,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 +360,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
+@@ -175,10 +175,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);




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

Reply via email to