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. r1127 -
      trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer
      ([EMAIL PROTECTED])
   2. r1128 - developers/werner ([EMAIL PROTECTED])
   3. r1129 - trunk/src/host/dfu-util/src ([EMAIL PROTECTED])
   4. r1130 - trunk/src/target/u-boot/patches
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: jiang_li
Date: 2007-02-26 02:59:30 +0100 (Mon, 26 Feb 2007)
New Revision: 1127

Added:
   
trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/mkinstalldirs
Log:
This commit try to solve the problem we face when we compile the the 
mediaplayer. 


Added: 
trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/mkinstalldirs
===================================================================
--- 
trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/mkinstalldirs  
    2007-02-26 01:33:14 UTC (rev 1126)
+++ 
trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/mkinstalldirs  
    2007-02-26 01:59:30 UTC (rev 1127)
@@ -0,0 +1,111 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <[EMAIL PROTECTED]>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage" 1>&2
+      exit 0
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+case $dirmode in
+  '')
+    if mkdir -p -- . 2>/dev/null; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    fi
+    ;;
+esac
+
+for file
+do
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
+
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=""
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
+
+    pathcomp="$pathcomp/"
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
+# mkinstalldirs ends here


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-simplemediaplayer/mkinstalldirs
___________________________________________________________________
Name: svn:executable
   + *




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2007-02-26 04:15:33 +0100 (Mon, 26 Feb 2007)
New Revision: 1128

Modified:
   developers/werner/TODO
Log:
Feb 25 update



Modified: developers/werner/TODO
===================================================================
--- developers/werner/TODO      2007-02-26 01:59:30 UTC (rev 1127)
+++ developers/werner/TODO      2007-02-26 03:15:33 UTC (rev 1128)
@@ -1,8 +1,10 @@
 IRC/neo-devel:
 - kick off bad block migration with all other phase -1 developers
+  [ done so far: mickey, thos, xora ]
 
 planning/design:
 - phase 0 default environment draft (neo-devel)
+- virgin system auto-install environment
 
 Mickey:
 - ask for quick walk-through review
@@ -13,11 +15,12 @@
 bugzilla:
   P0
   - #79: suspend/resume to RAM support
-    (as early as possible, i.e., even before LCM is up)
   - #178: u-boot 'factory reset' option
   P1
   - #164: improve non-SanDisk microSD support in u-boot 
   - #179: Implement u-boot power-off timer
+  ??
+  - #202: Start using NAND hardware ECC support
 
 other:
 - test V-360 headset
@@ -30,7 +33,6 @@
 
 u-boot:
 - set up openocd and familiarize with it (-> update wiki)
-- u-boot: start.S: boot from RAM with relocation
 - bbt migration & walk-through: future updates
   - update for debug v2
   - switch from wiggler to openocd
@@ -44,9 +46,14 @@
   https://wiki.internal.openmoko.org/wiki/Bluetooth_MAC_Assignments
 - u-boot NAND update also removes environment offset. Documented it. Fix it,
   too ?
-- nice to have: make u-boot detect at run-time if it's booting from RAM or NAND
 - check that we don't have hidden power-on sequences (e.g., USB disconnect)
-- board/neo1973/neo1973.c: start LCD first, to avoid white flash
+- write requests for power measurements (TBD)
+- think about u-boot progress bar (e.g., time-driven)
+- review schematics before the end of Chinese new year holidays
+- verify/update
+  
https://wiki.openmoko.org/wiki/NAND_bad_blocks#JTAG_.2F_OpenOCD_.2F_u-boot_RAM_based
+  https://wiki.openmoko.org/wiki/Bootloader#Using_JTAG_to_boot_from_RAM
+- find out why Harald's debug v2 is 6 times (!) faster than my JTAGkey
 
 --- Feb 13 --------------------------------------------------------------------
 
@@ -80,7 +87,35 @@
 --- Feb 20 --------------------------------------------------------------------
 
   - #14: bootloader should display startup image before booting
+    (as early as possible, i.e., even before LCM is up)
   - #40: test + debug display of image on LCM in u-boot 
 - GTA01Bv2 # dynenv set u-boot_env
   45 4e 56 30 - 00 00 00 00
   *OUCH* !
+
+--- Feb 23 --------------------------------------------------------------------
+
+- prevent poweroff if starting from RAM
+  [ wakeup-reason-nand-only.patch, experimental, DOESN'T WORK ]
+- u-boot: start.S: boot from RAM with relocation
+  [ boot-from-ram-reloc.patch ]
+- nice to have: make u-boot detect at run-time if it's booting from RAM or NAND
+  [ boot-from-ram-and-nand.patch ]
+- board/neo1973/neo1973.c: start LCD first, to avoid white flash
+- add lowlevel.S to u-boot build
+
+--- Feb 25 --------------------------------------------------------------------
+
+- force console switch for boot menu
+
+--- Feb 26 --------------------------------------------------------------------
+
+boot menu finalizing:
+> ok, so i'll add some default menu items to my env draft (in preparation)
+> then i'll kill the "indefinite boot delay" and require a 20% or so presence
++of AUX while power-up to enter the boot menu
+> last but not least, the first item, "Boot" gets a poweroff on failure, so
++that desperate users don't get even more desperate when they can't seem to
++turn off the device (well, most likely, they'll just pull the battery, but
++still ...)
+




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-02-26 04:24:24 +0100 (Mon, 26 Feb 2007)
New Revision: 1129

Modified:
   trunk/src/host/dfu-util/src/main.c
Log:
* if status is bad, retry 


Modified: trunk/src/host/dfu-util/src/main.c
===================================================================
--- trunk/src/host/dfu-util/src/main.c  2007-02-26 03:15:33 UTC (rev 1128)
+++ trunk/src/host/dfu-util/src/main.c  2007-02-26 03:24:24 UTC (rev 1129)
@@ -560,6 +560,7 @@
                        fprintf(stderr, "error clear_status: %s\n", 
usb_strerror());
                        exit(1);
                }
+               goto status_again;
                break;
        case DFU_STATE_dfuDNLOAD_IDLE:
        case DFU_STATE_dfuUPLOAD_IDLE:




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-02-26 04:41:21 +0100 (Mon, 26 Feb 2007)
New Revision: 1130

Modified:
   trunk/src/target/u-boot/patches/uboot-dfu.patch
   trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch
Log:
* major re-write of EP0 handler and state machine of u-boot S3C2410 UDC driver, 
to
** correctly cope with endpoint size of 16 bytes, which results in faster 
transfers
** use lowercase hex digits in 'filesize' parameter of DFU-to-RAM upload
* enable 16bytes control pipe size
* make DFU correctly deal with 'set configuration' messages 


Modified: trunk/src/target/u-boot/patches/uboot-dfu.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-dfu.patch     2007-02-26 03:24:24 UTC 
(rev 1129)
+++ trunk/src/target/u-boot/patches/uboot-dfu.patch     2007-02-26 03:41:21 UTC 
(rev 1130)
@@ -1,7 +1,7 @@
 Index: u-boot/drivers/usbdcore_ep0.c
 ===================================================================
---- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-25 15:37:52.000000000 +0100
-+++ u-boot/drivers/usbdcore_ep0.c      2007-02-25 19:41:13.000000000 +0100
+--- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-26 04:20:02.000000000 +0100
++++ u-boot/drivers/usbdcore_ep0.c      2007-02-26 04:31:03.000000000 +0100
 @@ -42,10 +42,15 @@
   */
  
@@ -98,8 +98,8 @@
 Index: u-boot/drivers/usbdfu.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/drivers/usbdfu.c    2007-02-25 21:44:46.000000000 +0100
-@@ -0,0 +1,940 @@
++++ u-boot/drivers/usbdfu.c    2007-02-26 04:23:14.000000000 +0100
+@@ -0,0 +1,943 @@
 +/*
 + * (C) 2007 by OpenMoko, Inc.
 + * Author: Harald Welte <[EMAIL PROTECTED]>
@@ -145,8 +145,6 @@
 +#include <config.h>
 +#if defined(CONFIG_USBD_DFU)
 +
-+//#define DEBUG
-+
 +#include <common.h>
 +DECLARE_GLOBAL_DATA_PTR;
 +
@@ -375,7 +373,7 @@
 +              switch (dev->alternate) {
 +                      char buf[12];
 +              case 0:
-+                      sprintf(buf, "%lX", ds->ptr - ds->buf);
++                      sprintf(buf, "%lx", ds->ptr - ds->buf);
 +                      setenv("filesize", buf);
 +                      ds->ptr = ds->buf;
 +                      break;
@@ -1008,6 +1006,10 @@
 +                      break;
 +              }
 +              break;
++      case DEVICE_CONFIGURED:
++      case DEVICE_DE_CONFIGURED:
++              debug("SET_CONFIGURATION(%u) ", device->configuration);
++              /* fallthrough */
 +      case DEVICE_SET_INTERFACE:
 +              debug("SET_INTERFACE(%u,%u) old_state = %u ",
 +                      device->interface, device->alternate,
@@ -1025,6 +1027,7 @@
 +              case DFU_STATE_dfuMANIFEST:
 +                      device->dfu_state = DFU_STATE_dfuERROR;
 +                      device->dfu_status = DFU_STATUS_errNOTDONE;
++                      /* FIXME: free malloc()ed buffer! */
 +                      break;
 +              case DFU_STATE_dfuMANIFEST_SYNC:
 +              case DFU_STATE_dfuUPLOAD_IDLE:
@@ -1042,8 +1045,8 @@
 +#endif /* CONFIG_USBD_DFU */
 Index: u-boot/drivers/Makefile
 ===================================================================
---- u-boot.orig/drivers/Makefile       2007-02-25 15:37:52.000000000 +0100
-+++ u-boot/drivers/Makefile    2007-02-25 15:37:53.000000000 +0100
+--- u-boot.orig/drivers/Makefile       2007-02-26 04:20:02.000000000 +0100
++++ u-boot/drivers/Makefile    2007-02-26 04:23:14.000000000 +0100
 @@ -46,7 +46,7 @@
          sl811_usb.o sm501.o smc91111.o smiLynxEM.o \
          status_led.o sym53c8xx.o ahci.o \
@@ -1055,8 +1058,8 @@
          pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o  \
 Index: u-boot/drivers/usbdcore.c
 ===================================================================
---- u-boot.orig/drivers/usbdcore.c     2007-02-25 15:36:49.000000000 +0100
-+++ u-boot/drivers/usbdcore.c  2007-02-25 21:38:24.000000000 +0100
+--- u-boot.orig/drivers/usbdcore.c     2007-02-26 04:20:02.000000000 +0100
++++ u-boot/drivers/usbdcore.c  2007-02-26 04:23:14.000000000 +0100
 @@ -31,6 +31,7 @@
  
  #include <malloc.h>
@@ -1111,8 +1114,8 @@
  }
 Index: u-boot/drivers/usbtty.c
 ===================================================================
---- u-boot.orig/drivers/usbtty.c       2007-02-25 15:37:52.000000000 +0100
-+++ u-boot/drivers/usbtty.c    2007-02-25 19:36:45.000000000 +0100
+--- u-boot.orig/drivers/usbtty.c       2007-02-26 04:20:02.000000000 +0100
++++ u-boot/drivers/usbtty.c    2007-02-26 04:23:14.000000000 +0100
 @@ -31,6 +31,8 @@
  #include "usbtty.h"
  #include "usb_cdc_acm.h"
@@ -1169,8 +1172,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-25 15:37:53.000000000 
+0100
-+++ u-boot/include/configs/neo1973.h   2007-02-25 15:37:53.000000000 +0100
+--- u-boot.orig/include/configs/neo1973.h      2007-02-26 04:23:14.000000000 
+0100
++++ u-boot/include/configs/neo1973.h   2007-02-26 04:23:14.000000000 +0100
 @@ -165,7 +165,7 @@
   */
  #define CONFIG_STACKSIZE      (128*1024)      /* regular stack */
@@ -1194,7 +1197,7 @@
 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-25 20:24:52.000000000 +0100
++++ u-boot/include/usb_dfu.h   2007-02-26 04:23:14.000000000 +0100
 @@ -0,0 +1,94 @@
 +#ifndef _DFU_H
 +#define _DFU_H
@@ -1293,7 +1296,7 @@
 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-25 15:37:53.000000000 
+0100
++++ u-boot/include/usb_dfu_descriptors.h       2007-02-26 04:23:14.000000000 
+0100
 @@ -0,0 +1,94 @@
 +#ifndef _USB_DFU_H
 +#define _USB_DFU_H
@@ -1391,8 +1394,8 @@
 +#endif /* _USB_DFU_H */
 Index: u-boot/include/usbdcore.h
 ===================================================================
---- u-boot.orig/include/usbdcore.h     2007-02-25 15:37:52.000000000 +0100
-+++ u-boot/include/usbdcore.h  2007-02-25 15:37:53.000000000 +0100
+--- u-boot.orig/include/usbdcore.h     2007-02-26 04:20:02.000000000 +0100
++++ u-boot/include/usbdcore.h  2007-02-26 04:23:14.000000000 +0100
 @@ -33,6 +33,7 @@
  
  #include <common.h>

Modified: trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch     2007-02-26 
03:24:24 UTC (rev 1129)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch     2007-02-26 
03:41:21 UTC (rev 1130)
@@ -2,8 +2,8 @@
 
 Index: u-boot/drivers/Makefile
 ===================================================================
---- u-boot.orig/drivers/Makefile       2007-02-24 13:38:27.000000000 +0100
-+++ u-boot/drivers/Makefile    2007-02-24 13:40:57.000000000 +0100
+--- u-boot.orig/drivers/Makefile       2007-02-25 15:36:51.000000000 +0100
++++ u-boot/drivers/Makefile    2007-02-26 04:31:08.000000000 +0100
 @@ -46,7 +46,7 @@
          sl811_usb.o sm501.o smc91111.o smiLynxEM.o \
          status_led.o sym53c8xx.o ahci.o \
@@ -16,8 +16,8 @@
 Index: u-boot/drivers/usbdcore_s3c2410.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/drivers/usbdcore_s3c2410.c  2007-02-24 13:42:08.000000000 +0100
-@@ -0,0 +1,740 @@
++++ u-boot/drivers/usbdcore_s3c2410.c  2007-02-26 04:30:57.000000000 +0100
+@@ -0,0 +1,730 @@
 +/* S3C2410 USB Device Controller Driver for u-boot
 + *
 + * (C) Copyright 2007 by OpenMoko, Inc.
@@ -177,7 +177,7 @@
 +
 +      /* clear stall status */
 +      if (ep0csr & S3C2410_UDC_EP0_CSR_SENTSTL) {
-+              debug("Clearing SENT_STALL\n");
++              serial_printf("Clearing SENT_STALL\n");
 +              clear_ep0_sst();
 +              if (ep0csr & S3C2410_UDC_EP0_CSR_SOPKTRDY)
 +                      clear_ep0_opr();
@@ -188,14 +188,16 @@
 +      /* clear setup end */
 +      if (ep0csr & S3C2410_UDC_EP0_CSR_SE
 +          /* && ep0->state != EP0_IDLE */) {
-+              debug("Clearing SETUP_END\n");
++              serial_printf("Clearing SETUP_END\n");
 +              clear_ep0_se();
++#if 1
 +              if (ep0csr & S3C2410_UDC_EP0_CSR_SOPKTRDY) {
 +                      /* Flush FIFO */
 +                      while (inl(S3C2410_UDC_OUT_FIFO_CNT1_REG))
 +                              inl(S3C2410_UDC_EP0_FIFO_REG);
 +                      clear_ep0_opr();
 +              }
++#endif
 +              ep0->state = EP0_IDLE;
 +              return;
 +      }
@@ -205,72 +207,36 @@
 +       * controller (and lead to bus enumeration failures) */
 +
 +      switch (ep0->state) {
++              int i, fifo_count;
++              unsigned char *datap;
 +      case EP0_IDLE:
-+              if (ep0csr & S3C2410_UDC_EP0_CSR_OPKRDY) {
-+                      int fifo_count;
-+                      unsigned char *datap = (unsigned char *) 
&ep0_urb->device_request;
-+                      /* host->device packet has been received */
++              if (!(ep0csr & S3C2410_UDC_EP0_CSR_OPKRDY))
++                      break;
 +
-+                      /* pull it out of the fifo */
-+                      fifo_count = fifo_count_out();
-+                      if (fifo_count != 8) {
-+                              debug("STRANGE FIFO COUNT: %u bytes\n", 
fifo_count);
-+                              set_ep0_ss();
-+                              return;
-+                      }
++              datap = (unsigned char *) &ep0_urb->device_request;
++              /* host->device packet has been received */
 +
-+                      while (fifo_count--) {
-+                              *datap = (unsigned 
char)inl(S3C2410_UDC_EP0_FIFO_REG);
-+                              datap++;
-+                      }
++              /* pull it out of the fifo */
++              fifo_count = fifo_count_out();
++              for (i = 0; i < fifo_count; i++) {
++                      *datap = (unsigned char)inl(S3C2410_UDC_EP0_FIFO_REG);
++                      datap++;
++              }
++              if (fifo_count != 8) {
++                      debug("STRANGE FIFO COUNT: %u bytes\n", fifo_count);
++                      set_ep0_ss();
++                      return;
++              }
 +
-+                      if ((ep0_urb->device_request.bmRequestType & 
USB_REQ_DIRECTION_MASK)
-+                           == USB_REQ_HOST2DEVICE) {
-+                              if (ep0_urb->device_request.wLength > 0) {
-+                                      /* receive remainder (DATA OUT phase) 
of transfer */
-+                                      /* FIXME: Implement this via state 
machine rather
-+                                       * than busy-waiting in the interrupt 
handler */
-+                                      //ep0->state = EP0_OUT_DATA_PHASE;
-+                                      clear_ep0_opr();
-+                                      ep0_urb->buffer = ep0_urb->buffer_data;
-+                                      ep0_urb->buffer_length = 
sizeof(ep0_urb->buffer_data);
-+                                      ep0_urb->actual_length = 0;
-+                                      do {
-+                                              u32 i;
-+                                              u32 urb_avail = 
ep0_urb->buffer_length
-+                                                                      - 
ep0_urb->actual_length;
-+                                              u_int8_t *cp = ep0_urb->buffer 
+ ep0_urb->actual_length;
-+
-+                                              ep0csr = 
inl(S3C2410_UDC_IN_CSR1_REG);
-+                                              if (!ep0csr & 
S3C2410_UDC_EP0_CSR_OPKRDY)
-+                                                      continue;
-+
-+                                              fifo_count = fifo_count_out();
-+                                              if (fifo_count < urb_avail)
-+                                                      urb_avail = fifo_count;
-+
-+                                              for (i = 0; i < urb_avail; i++)
-+                                                      *cp++ = 
inl(S3C2410_UDC_EP0_FIFO_REG);
-+
-+                                              ep0_urb->actual_length += 
urb_avail;
-+
-+                                              if (fifo_count < 8) {
-+                                                      //ep0->state = EP0_IDLE;
-+                                                      break;
-+                                              } else
-+                                                      clear_ep0_opr();
-+                                      } while (1);
-+                              }
-+                      } else
-+                              clear_ep0_opr();
-+
++              if (ep0_urb->device_request.wLength == 0) {
 +                      if (ep0_recv_setup(ep0_urb)) {
 +                              /* Not a setup packet, stall next EP0 
transaction */
-+                              debug("can't parse setup packet, still waiting 
for setup\n");
++                              debug("can't parse setup packet1\n");
 +                              set_ep0_ss();
++                              //set_ep0_de_out();
++                              ep0->state = EP0_IDLE;
 +                              return;
 +                      }
-+
 +                      /* There are some requests with which we need to deal
 +                       * manually here */
 +                      switch (ep0_urb->device_request.bRequest) {
@@ -285,50 +251,41 @@
 +                      case USB_REQ_SET_ADDRESS:
 +                              udc_set_address(udc_device->address);
 +                              usbd_device_event_irq(udc_device,
-+                                                      
DEVICE_ADDRESS_ASSIGNED, 0);
++                                              DEVICE_ADDRESS_ASSIGNED, 0);
 +                              break;
 +                      default:
 +                              break;
 +                      }
-+
-+                      /* check whether we need to write/read */
++                      set_ep0_de_out();
++                      ep0->state = EP0_IDLE;
++              } else {
 +                      if ((ep0_urb->device_request.bmRequestType & 
USB_REQ_DIRECTION_MASK)
 +                          == USB_REQ_HOST2DEVICE) {
-+                              /* we can't do this earlier since in the case
-+                               * of SET_ADDRESS we're not allowed to issues
-+                               * this command before we've actually set the
-+                               * address */
-+                              set_ep0_de_out();
++                              clear_ep0_opr();
++                              ep0->state = EP0_OUT_DATA_PHASE;
++                              ep0_urb->buffer = ep0_urb->buffer_data;
++                              ep0_urb->buffer_length = 
sizeof(ep0_urb->buffer_data);
++                              ep0_urb->actual_length = 0;
 +                      } else {
-+                              /* device -> host */
++                              ep0->state = EP0_IN_DATA_PHASE;
 +
++                              if (ep0_recv_setup(ep0_urb)) {
++                                      /* Not a setup packet, stall next EP0 
transaction */
++                                      debug("can't parse setup packet2\n");
++                                      set_ep0_ss();
++                                      //set_ep0_de_out();
++                                      ep0->state = EP0_IDLE;
++                                      return;
++                              }
++                              clear_ep0_opr();
 +                              ep0->tx_urb = ep0_urb;
 +                              ep0->sent = ep0->last = 0;
 +
 +                              if (s3c2410_write_noniso_tx_fifo(ep0)) {
 +                                      ep0->state = EP0_IDLE;
 +                                      set_ep0_de_in();
-+                              } else {
-+                                      ep0->state = EP0_IN_DATA_PHASE;
++                              } else
 +                                      set_ep0_ipr();
-+#if 0
-+                                      /* we optionally can do this 
blocking/polling */
-+                                      do {
-+                                              ep0csr = 
inl(S3C2410_UDC_IN_CSR1_REG);
-+                                              if ((ep0csr & 
S3C2410_UDC_EP0_CSR_IPKRDY))
-+                                                      continue;
-+
-+                                              ep0->sent += ep0->last;
-+                                              if 
(s3c2410_write_noniso_tx_fifo(ep0)) {
-+                                                      ep0->state = EP0_IDLE;
-+                                                      set_ep0_de_in();
-+                                                      break;
-+                                              } else {
-+                                                      set_ep0_ipr();
-+                                              }
-+                                      } while (1);
-+#endif
-+                              }
 +                      }
 +              }
 +              break;
@@ -339,14 +296,39 @@
 +                      if (s3c2410_write_noniso_tx_fifo(ep0)) {
 +                              ep0->state = EP0_IDLE;
 +                              set_ep0_de_in();
-+                      } else {
-+                              ep0->state = EP0_IN_DATA_PHASE;
++                      } else
 +                              set_ep0_ipr();
-+                      }
 +              }
 +              break;
 +      case EP0_OUT_DATA_PHASE:
-+              /* FIXME: Not supported */
++              if (ep0csr & S3C2410_UDC_EP0_CSR_OPKRDY) {
++                      u32 urb_avail = ep0_urb->buffer_length - 
ep0_urb->actual_length;
++                      u_int8_t *cp = ep0_urb->buffer + ep0_urb->actual_length;
++                      int i, fifo_count;
++
++                      fifo_count = fifo_count_out();
++                      if (fifo_count < urb_avail)
++                              urb_avail = fifo_count;
++
++                      for (i = 0; i < urb_avail; i++)
++                              *cp++ = inl(S3C2410_UDC_EP0_FIFO_REG);
++
++                      ep0_urb->actual_length += urb_avail;
++
++                      if (fifo_count < ep0->rcv_packetSize ||
++                          ep0_urb->actual_length >= 
ep0_urb->device_request.wLength) {
++                              ep0->state = EP0_IDLE;
++                              if (ep0_recv_setup(ep0_urb)) {
++                                      /* Not a setup packet, stall next EP0 
transaction */
++                                      debug("can't parse setup packet3\n");
++                                      set_ep0_ss();
++                                      //set_ep0_de_out();
++                                      return;
++                              }
++                              set_ep0_de_out();
++                      } else
++                              clear_ep0_opr();
++              }
 +              break;
 +      case EP0_END_XFER:
 +              ep0->state = EP0_IDLE;
@@ -496,8 +478,8 @@
 +              int i;
 +
 +              if (usbd_status & S3C2410_UDC_INT_EP0) {
-+                      s3c2410_udc_ep0();
 +                      outl(S3C2410_UDC_INT_EP0, S3C2410_UDC_EP_INT_REG);
++                      s3c2410_udc_ep0();
 +              }
 +
 +              for (i = 1; i < 5; i++) {
@@ -505,8 +487,8 @@
 +
 +                      if (usbd_status & tmp) {
 +                              /* FIXME: Handle EP X */
-+                              s3c2410_udc_epn(i);
 +                              outl(tmp, S3C2410_UDC_EP_INT_REG);
++                              s3c2410_udc_epn(i);
 +                      }
 +              }
 +      }
@@ -558,7 +540,6 @@
 +       * here.
 +       */
 +      clk_power->CLKCON |= (1 << 7);
-+      irq->INTMSK &= ~BIT_USBD;
 +
 +      /* Print banner with device revision */
 +      printf("USB:   S3C2410 USB Deviced\n");
@@ -566,11 +547,10 @@
 +      /*
 +       * At this point, device is ready for configuration...
 +       */
++      outl(0x00, S3C2410_UDC_EP_INT_EN_REG);
++      outl(0x00, S3C2410_UDC_USB_INT_EN_REG);
 +
-+      //debug("disable USB interrupts");
-+      debug("enable USB interrupts");
-+      outl(0xff, S3C2410_UDC_EP_INT_EN_REG);
-+      outl(0x04, S3C2410_UDC_USB_INT_EN_REG);
++      irq->INTMSK &= ~BIT_USBD;
 +
 +      return 0;
 +}
@@ -608,16 +588,26 @@
 +                      packet_size = endpoint->rcv_packetSize;
 +                      attributes = endpoint->rcv_attributes;
 +              }
-+      }
++      } else
++              packet_size = endpoint->tx_packetSize;
 +
-+      if (packet_size <= 8)
++      switch (packet_size) {
++      case 8:
 +              maxp = S3C2410_UDC_MAXP_8;
-+      else if (packet_size <= 16)
++              break;
++      case 16:
 +              maxp = S3C2410_UDC_MAXP_16;
-+      else if (packet_size <= 32)
++              break;
++      case 32:
 +              maxp = S3C2410_UDC_MAXP_32;
-+      else
++              break;
++      case 64:
 +              maxp = S3C2410_UDC_MAXP_64;
++              break;
++      default:
++              debug("invalid packet size %u\n", packet_size);
++              return -1;
++      }
 +
 +      debug("setting up endpoint %u addr %x packet_size %u maxp %u\n", ep,
 +              endpoint->endpoint_address, packet_size, maxp);
@@ -761,7 +751,7 @@
 Index: u-boot/drivers/usbdcore_s3c2410.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/drivers/usbdcore_s3c2410.h  2007-02-24 13:38:29.000000000 +0100
++++ u-boot/drivers/usbdcore_s3c2410.h  2007-02-26 03:54:07.000000000 +0100
 @@ -0,0 +1,273 @@
 +/* linux/include/asm/arch-s3c2410/regs-udc.h
 + *
@@ -1026,7 +1016,7 @@
 +#endif
 +
 +/* S3C2410 Endpoint parameters */
-+#define EP0_MAX_PACKET_SIZE   8
++#define EP0_MAX_PACKET_SIZE   16
 +#define UDC_OUT_ENDPOINT      2
 +#define UDC_OUT_PACKET_SIZE   64
 +#define UDC_IN_ENDPOINT               1
@@ -1038,8 +1028,8 @@
 +#endif
 Index: u-boot/drivers/usbdcore_ep0.c
 ===================================================================
---- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-24 13:38:28.000000000 +0100
-+++ u-boot/drivers/usbdcore_ep0.c      2007-02-24 13:40:57.000000000 +0100
+--- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-25 15:37:52.000000000 +0100
++++ u-boot/drivers/usbdcore_ep0.c      2007-02-26 04:31:08.000000000 +0100
 @@ -43,7 +43,7 @@
  
  #include <common.h>
@@ -1135,9 +1125,9 @@
                case USB_REQ_SET_DESCRIPTOR:    /* XXX should we support this? 
*/
 Index: u-boot/include/configs/neo1973.h
 ===================================================================
---- u-boot.orig/include/configs/neo1973.h      2007-02-24 13:38:28.000000000 
+0100
-+++ u-boot/include/configs/neo1973.h   2007-02-24 13:42:25.000000000 +0100
-@@ -176,6 +176,16 @@
+--- u-boot.orig/include/configs/neo1973.h      2007-02-25 15:36:51.000000000 
+0100
++++ u-boot/include/configs/neo1973.h   2007-02-26 04:31:10.000000000 +0100
+@@ -171,6 +171,16 @@
  #define CONFIG_USB_OHCI               1
  #endif
  
@@ -1156,8 +1146,8 @@
   */
 Index: u-boot/cpu/arm920t/s3c24x0/interrupts.c
 ===================================================================
---- u-boot.orig/cpu/arm920t/s3c24x0/interrupts.c       2007-02-24 
13:38:28.000000000 +0100
-+++ u-boot/cpu/arm920t/s3c24x0/interrupts.c    2007-02-24 13:38:29.000000000 
+0100
+--- u-boot.orig/cpu/arm920t/s3c24x0/interrupts.c       2007-02-25 
15:37:52.000000000 +0100
++++ u-boot/cpu/arm920t/s3c24x0/interrupts.c    2007-02-25 15:37:52.000000000 
+0100
 @@ -222,6 +222,13 @@
        S3C24X0_INTERRUPT * irq = S3C24X0_GetBase_INTERRUPT();
        u_int32_t intpnd = irq->INTPND;
@@ -1174,8 +1164,8 @@
  
 Index: u-boot/drivers/usbtty.h
 ===================================================================
---- u-boot.orig/drivers/usbtty.h       2007-02-24 13:38:28.000000000 +0100
-+++ u-boot/drivers/usbtty.h    2007-02-24 13:38:29.000000000 +0100
+--- u-boot.orig/drivers/usbtty.h       2007-02-25 15:37:52.000000000 +0100
++++ u-boot/drivers/usbtty.h    2007-02-25 15:37:52.000000000 +0100
 @@ -29,6 +29,8 @@
  #include "usbdcore_mpc8xx.h"
  #elif defined(CONFIG_OMAP1510)
@@ -1187,8 +1177,8 @@
  #include <config.h>
 Index: u-boot/board/neo1973/cmd_neo1973.c
 ===================================================================
---- u-boot.orig/board/neo1973/cmd_neo1973.c    2007-02-24 13:38:28.000000000 
+0100
-+++ u-boot/board/neo1973/cmd_neo1973.c 2007-02-24 13:38:29.000000000 +0100
+--- u-boot.orig/board/neo1973/cmd_neo1973.c    2007-02-25 15:36:51.000000000 
+0100
++++ u-boot/board/neo1973/cmd_neo1973.c 2007-02-25 15:37:52.000000000 +0100
 @@ -93,6 +93,18 @@
                        neo1973_vibrator(1);
                else




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

Reply via email to