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. r4672 - developers/werner/wlan-spi/patches
      ([EMAIL PROTECTED])
   2. r4673 - developers/werner/ahrt/host/tmc/lib
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-09-27 02:22:28 +0200 (Sat, 27 Sep 2008)
New Revision: 4672

Added:
   developers/werner/wlan-spi/patches/dont-poll-irq.patch
   developers/werner/wlan-spi/patches/tweak-spi.patch
Modified:
   developers/werner/wlan-spi/patches/gta02-no-glamo-mmc.patch
   developers/werner/wlan-spi/patches/hack-silence-battery.patch
   developers/werner/wlan-spi/patches/series
Log:
First steps towards getting S3C SPI to work. Still freaks out at higher
clock speeds and interrupt mode is actually the least efficient possible
mode.



Added: developers/werner/wlan-spi/patches/dont-poll-irq.patch
===================================================================
--- developers/werner/wlan-spi/patches/dont-poll-irq.patch                      
        (rev 0)
+++ developers/werner/wlan-spi/patches/dont-poll-irq.patch      2008-09-27 
00:22:28 UTC (rev 4672)
@@ -0,0 +1,33 @@
+The interrupt polling interferes with monitoring of the SDIO transactions.
+Disable it when debugging.
+
+Index: korig/drivers/mmc/core/sdio_irq.c
+===================================================================
+--- korig.orig/drivers/mmc/core/sdio_irq.c     2008-09-22 20:50:31.000000000 
-0300
++++ korig/drivers/mmc/core/sdio_irq.c  2008-09-22 20:51:13.000000000 -0300
+@@ -70,7 +70,7 @@
+       unsigned long period, idle_period;
+       int ret;
+ 
+-      sched_setscheduler(current, SCHED_FIFO, &param);
++//    sched_setscheduler(current, SCHED_FIFO, &param);
+ 
+       /*
+        * We want to allow for SDIO cards to work even on non SDIO
+@@ -102,7 +102,7 @@
+               ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
+               if (ret)
+                       break;
+-              ret = process_sdio_pending_irqs(host->card);
++//            ret = process_sdio_pending_irqs(host->card);
+               mmc_release_host(host);
+ 
+               /*
+@@ -128,6 +128,7 @@
+                       }
+               }
+ 
++yield();
+               set_task_state(current, TASK_INTERRUPTIBLE);
+               if (host->caps & MMC_CAP_SDIO_IRQ)
+                       host->ops->enable_sdio_irq(host, 1);

Modified: developers/werner/wlan-spi/patches/gta02-no-glamo-mmc.patch
===================================================================
--- developers/werner/wlan-spi/patches/gta02-no-glamo-mmc.patch 2008-09-25 
04:59:33 UTC (rev 4671)
+++ developers/werner/wlan-spi/patches/gta02-no-glamo-mmc.patch 2008-09-27 
00:22:28 UTC (rev 4672)
@@ -7,8 +7,17 @@
 
 Index: korig/arch/arm/mach-s3c2440/mach-gta02.c
 ===================================================================
---- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c      2008-09-09 
21:18:55.000000000 -0300
-+++ korig/arch/arm/mach-s3c2440/mach-gta02.c   2008-09-09 21:20:25.000000000 
-0300
+--- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c      2008-09-17 
19:37:50.000000000 -0300
++++ korig/arch/arm/mach-s3c2440/mach-gta02.c   2008-09-26 20:29:53.000000000 
-0300
+@@ -1239,7 +1239,7 @@
+ static struct spi_board_info gta02_spi_mmc_bdinfo = {
+       .modalias       = "mmc_spi",
+       .irq            = IRQ_EINT3,    /* unused ? */
+-      .max_speed_hz   = 1 * 1000 * 1000,
++      .max_speed_hz   = 25 * 1000 * 1000,
+       .bus_num        = 0,
+       .chip_select    = 0,
+       .mode           = SPI_MODE_0,
 @@ -1476,12 +1476,14 @@
  
  static void gta02_glamo_mci_suspending(struct platform_device *dev)

Modified: developers/werner/wlan-spi/patches/hack-silence-battery.patch
===================================================================
--- developers/werner/wlan-spi/patches/hack-silence-battery.patch       
2008-09-25 04:59:33 UTC (rev 4671)
+++ developers/werner/wlan-spi/patches/hack-silence-battery.patch       
2008-09-27 00:22:28 UTC (rev 4672)
@@ -1,7 +1,7 @@
 Index: korig/drivers/power/power_supply_sysfs.c
 ===================================================================
---- korig.orig/drivers/power/power_supply_sysfs.c      2008-09-10 
14:32:02.000000000 -0300
-+++ korig/drivers/power/power_supply_sysfs.c   2008-09-10 14:32:18.000000000 
-0300
+--- korig.orig/drivers/power/power_supply_sysfs.c      2008-09-26 
21:18:02.000000000 -0300
++++ korig/drivers/power/power_supply_sysfs.c   2008-09-26 21:18:44.000000000 
-0300
 @@ -59,9 +59,11 @@
        ret = psy->get_property(psy, off, &value);
  
@@ -14,3 +14,16 @@
                return ret;
        }
  
+Index: korig/arch/arm/mach-s3c2440/mach-gta02.c
+===================================================================
+--- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c      2008-09-26 
21:19:03.000000000 -0300
++++ korig/arch/arm/mach-s3c2440/mach-gta02.c   2008-09-26 21:19:07.000000000 
-0300
+@@ -1239,7 +1239,7 @@
+ static struct spi_board_info gta02_spi_mmc_bdinfo = {
+       .modalias       = "mmc_spi",
+       .irq            = IRQ_EINT3,    /* unused ? */
+-      .max_speed_hz   = 25 * 1000 * 1000,
++      .max_speed_hz   = 10 * 1000 * 1000,
+       .bus_num        = 0,
+       .chip_select    = 0,
+       .mode           = SPI_MODE_0,

Modified: developers/werner/wlan-spi/patches/series
===================================================================
--- developers/werner/wlan-spi/patches/series   2008-09-25 04:59:33 UTC (rev 
4671)
+++ developers/werner/wlan-spi/patches/series   2008-09-27 00:22:28 UTC (rev 
4672)
@@ -25,4 +25,6 @@
 ar6k-essid-one-and-32.patch
 gta02-no-glamo-mmc.patch
 hack-silence-battery.patch
+tweak-spi.patch
+#dont-poll-irq.patch
 #try

Added: developers/werner/wlan-spi/patches/tweak-spi.patch
===================================================================
--- developers/werner/wlan-spi/patches/tweak-spi.patch                          
(rev 0)
+++ developers/werner/wlan-spi/patches/tweak-spi.patch  2008-09-27 00:22:28 UTC 
(rev 4672)
@@ -0,0 +1,63 @@
+Work in progress. Makes spi_s3c24xx.c work for 1 and 10MHz.
+Something breaks at 20 or 25MHz.
+
+Index: korig/drivers/spi/spi_s3c24xx.c
+===================================================================
+--- korig.orig/drivers/spi/spi_s3c24xx.c       2008-09-26 20:47:30.000000000 
-0300
++++ korig/drivers/spi/spi_s3c24xx.c    2008-09-26 21:06:23.000000000 -0300
+@@ -198,6 +198,29 @@
+       writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
+       wait_for_completion(&hw->done);
+ 
++      /*
++       * Get the last byte. Since we don't have more data we can send in
++       * order to clock the byte out of the SPI system, we need to wait and
++       * to provide a clock by a dummy read.
++       *
++       * Duh, I'm just handwaving here about possible explanations of what's
++       * going on in the hardware. This is the voodoo ritual that makes it
++       * work while anything else fails.
++       */
++      if (hw->rx && hw->count) {
++              udelay(1+10*1000000/spi->max_speed_hz);
++              //readb(hw->regs + S3C2410_SPRDAT);
++              hw->rx[hw->count-1] = readb(hw->regs + S3C2410_SPRDAT);
++      }
++
++      if (0&&t->rx_buf && t->len > 18) {
++              int i;
++
++              printk(KERN_INFO "RX (%p):", t->rx_buf);
++              for (i = 0; i != t->len; i++)
++                      printk(" %02x", ((u8 *) t->rx_buf)[i]);
++              printk("\n");
++      }
+       return hw->count;
+ }
+ 
+@@ -233,8 +256,23 @@
+ 
+       hw->count++;
+ 
+-      if (hw->rx)
+-              hw->rx[count] = readb(hw->regs + S3C2410_SPRDAT);
++      /*
++       * Misfeature #1: the first byte received can only be read after
++       * writing the second byte to send to the shifter.
++       *
++       * Misfeature #2: we need to consume all data received.
++       *
++       * Oddly enough,  it's not sufficient if we do a large number of SPRDAT
++       * reads before or right after starting the transmission. We really
++       * have to fetch a byte for each byte we send, or the SPI engine gets
++       * upset.
++       */
++      if (hw->rx) {
++              u8 b = readb(hw->regs + S3C2410_SPRDAT);
++
++              if (count)
++                      hw->rx[count-1] = b;
++      }
+ 
+       count++;
+ 




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-09-27 02:49:01 +0200 (Sat, 27 Sep 2008)
New Revision: 4673

Modified:
   developers/werner/ahrt/host/tmc/lib/crc.py
   developers/werner/ahrt/host/tmc/lib/scope.py
Log:
Highlight:
- logic analyzer downloads are now about 66% faster

Details:
- lib/crc.py (crc.crc16): didn't even run
- lib/scope.py (rigol_la_data): only add data if it is different from the
  previous sample



Modified: developers/werner/ahrt/host/tmc/lib/crc.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/crc.py  2008-09-27 00:22:28 UTC (rev 
4672)
+++ developers/werner/ahrt/host/tmc/lib/crc.py  2008-09-27 00:49:01 UTC (rev 
4673)
@@ -86,6 +86,6 @@
        return crc
 
     def crc16(self, crc, bytes):
-       for b in bytes(crc, bytes):
+       for b in bytes:
            crc = (crc >> 8) ^ self.crc16_syndrome[(crc ^ b) & 0xff]
        return crc

Modified: developers/werner/ahrt/host/tmc/lib/scope.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/scope.py        2008-09-27 00:22:28 UTC 
(rev 4672)
+++ developers/werner/ahrt/host/tmc/lib/scope.py        2008-09-27 00:49:01 UTC 
(rev 4673)
@@ -235,13 +235,29 @@
     res = []
     for b in range(0, 16):
        res.append(digital())
+
+    prev_low = 0
+    prev_high = 0
+
     i = 424
     while i != 1624:
        div = (i-1024)/100.0
        t = t0+div*td
-       for b in range(0, 8):
-           res[b].append(t, (ord(s[i]) & (1 << b)) != 0)
-           res[b+8].append(t, (ord(s[i+1]) & (1 << b)) != 0)
+
+       doit = i == 424 or i == 1622
+
+       byte = ord(s[i])
+       if byte ^ prev_low or doit:
+           prev_low = byte
+           for b in range(0, 8):
+               res[b].append(t, (byte & (1 << b)) != 0)
+
+       byte = ord(s[i+1])
+       if byte ^ prev_high or doit:
+           prev_high = byte
+           for b in range(0, 8):
+               res[b+8].append(t, (byte & (1 << b)) != 0)
+
        i += 2
     return res
 




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

Reply via email to