Changeset 4674


Ignore:
Timestamp:
09/27/08 16:37:38 (5 years ago)
Author:
werner
Message:
  • moved SPI clock setting from hack-silence-battery.patch (oops !) to tweak-spi.patch
  • set the maximum SPI clock to 12MHz and explained what happens if we exceed this limit
  • removed unnecessary dummy read before last SPI byte
Location:
developers/werner/wlan-spi/patches
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/wlan-spi/patches/hack-silence-battery.patch

    r4672 r4674  
    1515        } 
    1616  
    17 Index: korig/arch/arm/mach-s3c2440/mach-gta02.c 
    18 =================================================================== 
    19 --- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c       2008-09-26 21:19:03.000000000 -0300 
    20 +++ korig/arch/arm/mach-s3c2440/mach-gta02.c    2008-09-26 21:19:07.000000000 -0300 
    21 @@ -1239,7 +1239,7 @@ 
    22  static struct spi_board_info gta02_spi_mmc_bdinfo = { 
    23         .modalias       = "mmc_spi", 
    24         .irq            = IRQ_EINT3,    /* unused ? */ 
    25 -       .max_speed_hz   = 25 * 1000 * 1000, 
    26 +       .max_speed_hz   = 10 * 1000 * 1000, 
    27         .bus_num        = 0, 
    28         .chip_select    = 0, 
    29         .mode           = SPI_MODE_0, 
  • developers/werner/wlan-spi/patches/tweak-spi.patch

    r4672 r4674  
    1 Work in progress. Makes spi_s3c24xx.c work for 1 and 10MHz. 
    2 Something breaks at 20 or 25MHz. 
     1Work in progress. Makes spi_s3c24xx.c work for up to 12MHz. 
     2 
     3At speeds of 13MHz or higher, we have setup time issues. I.e., the 
     4SPI host sees the data coming from the device delayed by one bit, 
     5even though things look fine on the scope. 
     6 
     7This 12MHz/13MHz "barrier" exists with or without probes attached, 
     8suggesting capacitative loading plays only a minor role in this. 
    39 
    410Index: korig/drivers/spi/spi_s3c24xx.c 
    511=================================================================== 
    6 --- korig.orig/drivers/spi/spi_s3c24xx.c        2008-09-26 20:47:30.000000000 -0300 
    7 +++ korig/drivers/spi/spi_s3c24xx.c     2008-09-26 21:06:23.000000000 -0300 
    8 @@ -198,6 +198,29 @@ 
     12--- korig.orig/drivers/spi/spi_s3c24xx.c        2008-09-27 11:28:42.000000000 -0300 
     13+++ korig/drivers/spi/spi_s3c24xx.c     2008-09-27 11:29:40.000000000 -0300 
     14@@ -198,6 +198,27 @@ 
    915        writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT); 
    1016        wait_for_completion(&hw->done); 
     
    1218+       /* 
    1319+        * Get the last byte. Since we don't have more data we can send in 
    14 +        * order to clock the byte out of the SPI system, we need to wait and 
    15 +        * to provide a clock by a dummy read. 
     20+        * order to clock the byte out of the SPI system, we need to wait. 
    1621+        * 
    1722+        * Duh, I'm just handwaving here about possible explanations of what's 
     
    2126+       if (hw->rx && hw->count) { 
    2227+               udelay(1+10*1000000/spi->max_speed_hz); 
    23 +               //readb(hw->regs + S3C2410_SPRDAT); 
    2428+               hw->rx[hw->count-1] = readb(hw->regs + S3C2410_SPRDAT); 
    2529+       } 
     
    3640 } 
    3741  
    38 @@ -233,8 +256,23 @@ 
     42@@ -233,8 +254,23 @@ 
    3943  
    4044        hw->count++; 
     
    6266        count++; 
    6367  
     68Index: korig/arch/arm/mach-s3c2440/mach-gta02.c 
     69=================================================================== 
     70--- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c       2008-09-27 11:29:48.000000000 -0300 
     71+++ korig/arch/arm/mach-s3c2440/mach-gta02.c    2008-09-27 11:30:13.000000000 -0300 
     72@@ -1239,7 +1239,7 @@ 
     73 static struct spi_board_info gta02_spi_mmc_bdinfo = { 
     74        .modalias       = "mmc_spi", 
     75        .irq            = IRQ_EINT3,    /* unused ? */ 
     76-       .max_speed_hz   = 25 * 1000 * 1000, 
     77+       .max_speed_hz   = 12 * 1000 * 1000, /* SPI doesn't want to go faster */ 
     78        .bus_num        = 0, 
     79        .chip_select    = 0, 
     80        .mode           = SPI_MODE_0, 
Note: See TracChangeset for help on using the changeset viewer.