r4737 - in developers/werner/wlan-spi/patches-tracking: . attic

werner at docs.openmoko.org werner at docs.openmoko.org
Sun Nov 2 07:41:15 CET 2008


Author: werner
Date: 2008-11-02 07:41:14 +0100 (Sun, 02 Nov 2008)
New Revision: 4737

Added:
   developers/werner/wlan-spi/patches-tracking/attic/
   developers/werner/wlan-spi/patches-tracking/attic/christer-mmc-byte-alignment.patch
   developers/werner/wlan-spi/patches-tracking/attic/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch
   developers/werner/wlan-spi/patches-tracking/attic/fix-mmc-busy-loop-on-bytes.patch
   developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi.patch
   developers/werner/wlan-spi/patches-tracking/attic/hack-disable-ecc.patch
   developers/werner/wlan-spi/patches-tracking/attic/hack-mmc-spi-coexistence.patch
   developers/werner/wlan-spi/patches-tracking/attic/hack-revert-s3cmci.patch
   developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-fix-int-mode.patch
   developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-from-int-to-poll.patch
   developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-cpufreq-driver-mmc.patch
   developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-mmc-faster-transfer-core.patch
Removed:
   developers/werner/wlan-spi/patches-tracking/christer-mmc-byte-alignment.patch
   developers/werner/wlan-spi/patches-tracking/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch
   developers/werner/wlan-spi/patches-tracking/fix-mmc-busy-loop-on-bytes.patch
   developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi.patch
   developers/werner/wlan-spi/patches-tracking/hack-disable-ecc.patch
   developers/werner/wlan-spi/patches-tracking/hack-mmc-spi-coexistence.patch
   developers/werner/wlan-spi/patches-tracking/hack-revert-s3cmci.patch
   developers/werner/wlan-spi/patches-tracking/s3c-spi-fix-int-mode.patch
   developers/werner/wlan-spi/patches-tracking/s3c-spi-from-int-to-poll.patch
   developers/werner/wlan-spi/patches-tracking/s3c24xx-cpufreq-driver-mmc.patch
   developers/werner/wlan-spi/patches-tracking/s3c24xx-mmc-faster-transfer-core.patch
Modified:
   developers/werner/wlan-spi/patches-tracking/ar6k-without-sdio.patch
   developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch
   developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch
   developers/werner/wlan-spi/patches-tracking/series
Log:
Rebasing and cleanup.

- moved patches that are no longer used to attic/
- removed support for SDIO over hardware-accelerated SPI
- rebased on latest stable-tracking



Modified: developers/werner/wlan-spi/patches-tracking/ar6k-without-sdio.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/ar6k-without-sdio.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/ar6k-without-sdio.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -13,9 +13,9 @@
 
 Index: ktrack/arch/arm/Kconfig
 ===================================================================
---- ktrack.orig/arch/arm/Kconfig	2008-10-29 03:31:30.000000000 -0200
-+++ ktrack/arch/arm/Kconfig	2008-10-29 03:31:36.000000000 -0200
-@@ -1270,7 +1270,7 @@
+--- ktrack.orig/arch/arm/Kconfig	2008-11-02 02:50:01.000000000 -0200
++++ ktrack/arch/arm/Kconfig	2008-11-02 04:29:20.000000000 -0200
+@@ -1269,7 +1269,7 @@
  
  source "drivers/uwb/Kconfig"
  
@@ -26,9 +26,9 @@
  
 Index: ktrack/drivers/Makefile
 ===================================================================
---- ktrack.orig/drivers/Makefile	2008-10-29 03:31:30.000000000 -0200
-+++ ktrack/drivers/Makefile	2008-10-29 03:31:36.000000000 -0200
-@@ -86,6 +86,7 @@
+--- ktrack.orig/drivers/Makefile	2008-11-02 02:50:02.000000000 -0200
++++ ktrack/drivers/Makefile	2008-11-02 04:29:20.000000000 -0200
+@@ -87,6 +87,7 @@
  obj-$(CONFIG_MMC)		+= mmc/
  obj-$(CONFIG_MEMSTICK)		+= memstick/
  obj-$(CONFIG_SDIO)              += sdio/
@@ -39,7 +39,7 @@
 Index: ktrack/drivers/ar6000/Kconfig
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ ktrack/drivers/ar6000/Kconfig	2008-10-29 03:31:36.000000000 -0200
++++ ktrack/drivers/ar6000/Kconfig	2008-11-02 04:29:20.000000000 -0200
 @@ -0,0 +1,7 @@
 +config AR6000_WLAN
 +        tristate "ar6000 wireless networking over sdio"
@@ -50,8 +50,8 @@
 +          good luck.
 Index: ktrack/drivers/ar6000/Makefile
 ===================================================================
---- ktrack.orig/drivers/ar6000/Makefile	2008-10-29 03:31:30.000000000 -0200
-+++ ktrack/drivers/ar6000/Makefile	2008-10-29 03:31:36.000000000 -0200
+--- ktrack.orig/drivers/ar6000/Makefile	2008-11-02 02:50:02.000000000 -0200
++++ ktrack/drivers/ar6000/Makefile	2008-11-02 04:29:20.000000000 -0200
 @@ -13,7 +13,7 @@
  
  EXTRA_CFLAGS += -DKERNEL_2_6

Copied: developers/werner/wlan-spi/patches-tracking/attic/christer-mmc-byte-alignment.patch (from rev 4735, developers/werner/wlan-spi/patches-tracking/christer-mmc-byte-alignment.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/christer-mmc-byte-alignment.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/christer-mmc-byte-alignment.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,228 @@
+From: Christer Weinigel <christer at weinigel.se>
+
+To be able to do SDIO the s3cmci driver has to support non-word-sized
+transfers.  Change pio_words into pio_bytes and fix up all the places
+where it is used.  
+
+This variant of the patch will not overrun the buffer when reading an
+odd number of bytes.  When writing, this variant will still read past
+the end of the buffer, but since the driver can't support non-word-
+aligned transfers anyway, this should not be a problem, since a
+word-aligned transfer will never cross a page boundary.
+
+This has been tested with a CSR SDIO Bluetooth Type A device on a
+Samsung S3C24A0 processor.
+
+Signed-off-by: Christer Weinigel <christer at weinigel.se>
+Signed-off-by: Ben Dooks <ben-linux at fluff.org>
+
+Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
+===================================================================
+--- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
++++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
+@@ -190,7 +190,7 @@ static inline void clear_imask(struct s3
+ }
+ 
+ static inline int get_data_buffer(struct s3cmci_host *host,
+-				  u32 *words, u32 **pointer)
++				  u32 *bytes, u32 **pointer)
+ {
+ 	struct scatterlist *sg;
+ 
+@@ -207,7 +207,7 @@ static inline int get_data_buffer(struct
+ 	}
+ 	sg = &host->mrq->data->sg[host->pio_sgptr];
+ 
+-	*words = sg->length >> 2;
++	*bytes = sg->length;
+ 	*pointer = sg_virt(sg);
+ 
+ 	host->pio_sgptr++;
+@@ -223,7 +223,7 @@ static inline u32 fifo_count(struct s3cm
+ 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
+ 
+ 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
+-	return fifostat >> 2;
++	return fifostat;
+ }
+ 
+ static inline u32 fifo_free(struct s3cmci_host *host)
+@@ -231,13 +231,14 @@ static inline u32 fifo_free(struct s3cmc
+ 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
+ 
+ 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
+-	return (63 - fifostat) >> 2;
++	return 63 - fifostat;
+ }
+ 
+ static void do_pio_read(struct s3cmci_host *host)
+ {
+ 	int res;
+ 	u32 fifo;
++	u32 fifo_words;
+ 	void __iomem *from_ptr;
+ 
+ 	/* write real prescaler to host, it might be set slow to fix */
+@@ -246,8 +247,8 @@ static void do_pio_read(struct s3cmci_ho
+ 	from_ptr = host->base + host->sdidata;
+ 
+ 	while ((fifo = fifo_count(host))) {
+-		if (!host->pio_words) {
+-			res = get_data_buffer(host, &host->pio_words,
++		if (!host->pio_bytes) {
++			res = get_data_buffer(host, &host->pio_bytes,
+ 					      &host->pio_ptr);
+ 			if (res) {
+ 				host->pio_active = XFER_NONE;
+@@ -260,26 +261,45 @@ static void do_pio_read(struct s3cmci_ho
+ 
+ 			dbg(host, dbg_pio,
+ 			    "pio_read(): new target: [%i]@[%p]\n",
+-			    host->pio_words, host->pio_ptr);
++			    host->pio_bytes, host->pio_ptr);
+ 		}
+ 
+ 		dbg(host, dbg_pio,
+ 		    "pio_read(): fifo:[%02i] buffer:[%03i] dcnt:[%08X]\n",
+-		    fifo, host->pio_words,
++		    fifo, host->pio_bytes,
+ 		    readl(host->base + S3C2410_SDIDCNT));
+ 
+-		if (fifo > host->pio_words)
+-			fifo = host->pio_words;
++		/* If we have reached the end of the block, we can
++		 * read a word and get 1 to 3 bytes.  If we in the
++		 * middle of the block, we have to read full words,
++		 * otherwise we will write garbage, so round down to
++		 * an even multiple of 4. */
++		if (fifo >= host->pio_bytes)
++			fifo = host->pio_bytes;
++		else
++			fifo -= fifo & 3;
+ 
+-		host->pio_words -= fifo;
++		host->pio_bytes -= fifo;
+ 		host->pio_count += fifo;
+ 
+-		while (fifo--)
++		fifo_words = fifo >> 2;
++		while (fifo_words--)
+ 			*(host->pio_ptr++) = readl(from_ptr);
++
++		if (fifo & 3) {
++			u32 n = fifo & 3;
++			u32 data = readl(from_ptr);
++			u8 *p = (u8 *)host->pio_ptr;
++
++			while (n--) {
++				*p++ = data;
++				data >>= 8;
++			}
++		}
+ 	}
+ 
+-	if (!host->pio_words) {
+-		res = get_data_buffer(host, &host->pio_words, &host->pio_ptr);
++	if (!host->pio_bytes) {
++		res = get_data_buffer(host, &host->pio_bytes, &host->pio_ptr);
+ 		if (res) {
+ 			dbg(host, dbg_pio,
+ 			    "pio_read(): complete (no more buffers).\n");
+@@ -303,8 +323,8 @@ static void do_pio_write(struct s3cmci_h
+ 	to_ptr = host->base + host->sdidata;
+ 
+ 	while ((fifo = fifo_free(host))) {
+-		if (!host->pio_words) {
+-			res = get_data_buffer(host, &host->pio_words,
++		if (!host->pio_bytes) {
++			res = get_data_buffer(host, &host->pio_bytes,
+ 							&host->pio_ptr);
+ 			if (res) {
+ 				dbg(host, dbg_pio,
+@@ -316,16 +336,23 @@ static void do_pio_write(struct s3cmci_h
+ 
+ 			dbg(host, dbg_pio,
+ 			    "pio_write(): new source: [%i]@[%p]\n",
+-			    host->pio_words, host->pio_ptr);
++			    host->pio_bytes, host->pio_ptr);
+ 
+ 		}
+ 
+-		if (fifo > host->pio_words)
+-			fifo = host->pio_words;
++		/* If we have reached the end of the block, we have to
++		 * write exactly the remaining number of bytes.  If we
++		 * in the middle of the block, we have to write full
++		 * words, so round down to an even multiple of 4. */
++		if (fifo >= host->pio_bytes)
++			fifo = host->pio_bytes;
++		else
++			fifo -= fifo & 3;
+ 
+-		host->pio_words -= fifo;
++		host->pio_bytes -= fifo;
+ 		host->pio_count += fifo;
+ 
++		fifo = (fifo + 3) >> 2;
+ 		while (fifo--)
+ 			writel(*(host->pio_ptr++), to_ptr);
+ 	}
+@@ -350,9 +377,9 @@ static void pio_tasklet(unsigned long da
+ 		clear_imask(host);
+ 		if (host->pio_active != XFER_NONE) {
+ 			dbg(host, dbg_err, "unfinished %s "
+-			    "- pio_count:[%u] pio_words:[%u]\n",
++			    "- pio_count:[%u] pio_bytes:[%u]\n",
+ 			    (host->pio_active == XFER_READ) ? "read" : "write",
+-			    host->pio_count, host->pio_words);
++			    host->pio_count, host->pio_bytes);
+ 
+ 			if (host->mrq->data)
+ 				host->mrq->data->error = -EINVAL;
+@@ -813,11 +840,10 @@ static int s3cmci_setup_data(struct s3cm
+ 		/* We cannot deal with unaligned blocks with more than
+ 		 * one block being transfered. */
+ 
+-		if (data->blocks > 1)
++		if (data->blocks > 1) {
++			pr_warning("%s: can't do non-word sized block transfers (blksz %d)\n", __func__, data->blksz);
+ 			return -EINVAL;
+-
+-		/* No support yet for non-word block transfers. */
+-		return -EINVAL;
++		}
+ 	}
+ 
+ 	while (readl(host->base + S3C2410_SDIDSTA) &
+@@ -897,7 +923,7 @@ static int s3cmci_prepare_pio(struct s3c
+ 	BUG_ON((data->flags & BOTH_DIR) == BOTH_DIR);
+ 
+ 	host->pio_sgptr = 0;
+-	host->pio_words = 0;
++	host->pio_bytes = 0;
+ 	host->pio_count = 0;
+ 	host->pio_active = rw ? XFER_WRITE : XFER_READ;
+ 
+Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h
+===================================================================
+--- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:51.000000000 +0100
++++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:51.000000000 +0100
+@@ -51,7 +51,7 @@ struct s3cmci_host {
+ 	int			dma_complete;
+ 
+ 	u32			pio_sgptr;
+-	u32			pio_words;
++	u32			pio_bytes;
+ 	u32			pio_count;
+ 	u32			*pio_ptr;
+ #define XFER_NONE 0
+
+-- 
+Ben (ben at fluff.org, http://www.fluff.org/)
+
+  'a smiley only costs 4 bytes'
+
+-------------------------------------------------------------------
+List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
+FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
+Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Copied: developers/werner/wlan-spi/patches-tracking/attic/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch (from rev 4735, developers/werner/wlan-spi/patches-tracking/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,42 @@
+Since the original authour (Thomas Kleffel) has been too busy to
+merge the s3cmci driver and keep it up to date, I (mostly as part
+of my role with Simtec Electronics) got the driver to a mergable
+state and have been maintaining it since I think that I should
+be added to the header. Also add a copyright statement for the
+new work. 
+
+Signed-off-by: Ben Dooks <ben-linux at fluff.org>
+
+Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
+===================================================================
+--- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:52.000000000 +0100
++++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:52.000000000 +0100
+@@ -3,6 +3,9 @@
+  *
+  *  Copyright (C) 2004-2006 maintech GmbH, Thomas Kleffel <tk at maintech.de>
+  *
++ * Current driver maintained by Ben Dooks and Simtec Electronics
++ *  Copyright (C) 2008 Simtec Electronics <ben-linux at fluff.org>
++ *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License version 2 as
+  * published by the Free Software Foundation.
+@@ -1560,7 +1563,7 @@ module_exit(s3cmci_exit);
+ 
+ MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
+ MODULE_LICENSE("GPL v2");
+-MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>");
++MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>, Ben Dooks <ben-linux at fluff.org>");
+ MODULE_ALIAS("platform:s3c2410-sdi");
+ MODULE_ALIAS("platform:s3c2412-sdi");
+ MODULE_ALIAS("platform:s3c2440-sdi");
+
+-- 
+Ben (ben at fluff.org, http://www.fluff.org/)
+
+  'a smiley only costs 4 bytes'
+
+-------------------------------------------------------------------
+List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
+FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
+Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Copied: developers/werner/wlan-spi/patches-tracking/attic/fix-mmc-busy-loop-on-bytes.patch (from rev 4736, developers/werner/wlan-spi/patches-tracking/fix-mmc-busy-loop-on-bytes.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/fix-mmc-busy-loop-on-bytes.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/fix-mmc-busy-loop-on-bytes.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,48 @@
+fix-mmc-busy-loop-on-bytes.patch
+
+christer-mmc-byte-alignment.patch reduced the FIFO I/O granularity
+from words to bytes. This also includes the decision when the FIFO
+is empty or full.
+
+However, we sometimes only want to transfer full words, in which
+case do_pio_read/do_pio_write busy-loop until the FIFO has filled
+up or drained enough.
+
+In the case of do_pio_write, this can cause an endless loop if the
+amount of data exceeds the FIFO size, because do_pio_write runs
+before the transfer is initiated, so the FIFO never drains.
+
+Signed-off-by: Werner Almesberger <werner at openmoko.org>
+
+---
+
+Index: ktrack/drivers/mmc/host/s3cmci.c
+===================================================================
+--- ktrack.orig/drivers/mmc/host/s3cmci.c	2008-10-30 23:07:50.000000000 -0200
++++ ktrack/drivers/mmc/host/s3cmci.c	2008-10-30 23:08:14.000000000 -0200
+@@ -289,8 +289,11 @@
+ 		 * an even multiple of 4. */
+ 		if (fifo >= host->pio_bytes)
+ 			fifo = host->pio_bytes;
+-		else
++		else {
+ 			fifo -= fifo & 3;
++			if (!fifo)
++				break;
++		}
+ 
+ 		host->pio_bytes -= fifo;
+ 		host->pio_count += fifo;
+@@ -362,8 +365,11 @@
+ 		 * words, so round down to an even multiple of 4. */
+ 		if (fifo >= host->pio_bytes)
+ 			fifo = host->pio_bytes;
+-		else
++		else {
+ 			fifo -= fifo & 3;
++			if (!fifo)
++				break;
++		}
+ 
+ 		host->pio_bytes -= fifo;
+ 		host->pio_count += fifo;

Copied: developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi.patch (from rev 4733, developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,81 @@
+Ongoing work on adding support for MMC-SPI using the S3C SPI driver.
+Note that this doesn't produce a valid bitstream yet.
+
+On GTA02, S3C SPI can only be used with WLAN if the SPI0 interface is
+wired to the SDIO interface. This is described here:
+http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/rework.pdf
+
+The correct wiring can be verified with the following script:
+http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/verify.sh
+
+Not-Yet-Signed-off-by: Werner Almesberger <werner at openmoko.org>
+
+Index: ktrack/arch/arm/mach-s3c2440/Kconfig
+===================================================================
+--- ktrack.orig/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:39:59.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:42:30.000000000 -0200
+@@ -113,6 +113,15 @@
+                 bool "GPIO bit-banging SPI"
+                 select MMC_SPI
+                 select SPI_S3C24XX_GPIO
++
++	config AR6K_SPI_S3C24XX
++		bool "Hardware-accelerated SPI (modification)"
++		select MMC_SPI
++		select SPI_S3C24XX
++		help
++		  This functionality requires that SPI0 is wired to
++		  the WLAN SDIO interface.
++
+ endchoice
+ 
+ endmenu
+Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
+===================================================================
+--- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:41:13.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:44:38.000000000 -0200
+@@ -1243,9 +1243,7 @@
+ /* ----- AR6000 WLAN interface --------------------------------------------- */
+ 
+ 
+-/* shared by all SPI drivers */
+-
+-#if defined(CONFIG_AR6K_SPI_S3C24XX_GPIO)
++#if defined(CONFIG_AR6K_SPI_S3C24XX) || defined(CONFIG_AR6K_SPI_S3C24XX_GPIO)
+ 
+ static struct spi_board_info gta02_spi_mmc_bdinfo[] = {
+ 	{
+@@ -1258,7 +1256,18 @@
+ 	}
+ };
+ 
+-#endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
++#endif /* CONFIG_AR6K_SPI_S3C24XX || CONFIG_AR6K_SPI_S3C24XX_GPIO */
++
++
++#ifdef CONFIG_AR6K_SPI_S3C24XX
++
++static struct s3c2410_spi_info spi_wlan_cfg = {
++	.pin_cs		= S3C2410_GPG2,
++	.num_cs		= 1,
++	.bus_num	= 0, /* link to gta02_spi_mmc_bdinfo */
++};
++
++#endif /* CONFIG_AR6K_SPI_S3C24XX */
+ 
+ 
+ #ifdef CONFIG_AR6K_SPI_S3C24XX_GPIO
+@@ -1756,6 +1765,13 @@
+ 	platform_device_register(&gta02_spi_wlan);
+ #endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
+ 
++#ifdef CONFIG_AR6K_SPI_S3C24XX
++	spi_register_board_info(gta02_spi_mmc_bdinfo,
++	    ARRAY_SIZE(gta02_spi_mmc_bdinfo));
++	s3c_device_spi0.dev.platform_data = &spi_wlan_cfg;
++	platform_device_register(&s3c_device_spi0);
++#endif /* CONFIG_AR6K_SPI_S3C24XX */
++
+ 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
+ 
+ 	s3c2410_pm_init();

Copied: developers/werner/wlan-spi/patches-tracking/attic/hack-disable-ecc.patch (from rev 4733, developers/werner/wlan-spi/patches-tracking/hack-disable-ecc.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/hack-disable-ecc.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/hack-disable-ecc.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,32 @@
+Index: ktrack/drivers/mtd/nand/nand_base.c
+===================================================================
+--- ktrack.orig/drivers/mtd/nand/nand_base.c	2008-10-29 00:57:08.000000000 -0200
++++ ktrack/drivers/mtd/nand/nand_base.c	2008-10-29 03:17:39.000000000 -0200
+@@ -775,6 +775,7 @@
+ 	uint32_t *eccpos = chip->ecc.layout->eccpos;
+ 
+ 	chip->ecc.read_page_raw(mtd, chip, buf);
++	return 0;
+ 
+ 	for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
+ 		chip->ecc.calculate(mtd, p, &ecc_calc[i]);
+@@ -830,6 +831,7 @@
+ 
+ 	p = bufpoi + data_col_addr;
+ 	chip->read_buf(mtd, p, datafrag_len);
++	return 0;
+ 
+ 	/* Calculate  ECC */
+ 	for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size)
+Index: ktrack/drivers/mtd/nand/nand_ecc.c
+===================================================================
+--- ktrack.orig/drivers/mtd/nand/nand_ecc.c	2008-10-29 00:57:08.000000000 -0200
++++ ktrack/drivers/mtd/nand/nand_ecc.c	2008-10-29 03:17:56.000000000 -0200
+@@ -434,6 +434,7 @@
+ 	const uint32_t eccsize_mult =
+ 			(((struct nand_chip *)mtd->priv)->ecc.size) >> 8;
+ 
++	return 0;
+ 	/*
+ 	 * b0 to b2 indicate which bit is faulty (if any)
+ 	 * we might need the xor result  more than once,

Copied: developers/werner/wlan-spi/patches-tracking/attic/hack-mmc-spi-coexistence.patch (from rev 4733, developers/werner/wlan-spi/patches-tracking/hack-mmc-spi-coexistence.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/hack-mmc-spi-coexistence.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/hack-mmc-spi-coexistence.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,56 @@
+In order to drive WLAN with S3C SPI on GTA02, the SPI0 interface has to
+be wired to the SDIO interface. This rework is described here:
+http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/rework.pdf
+
+The correct wiring can be verified with the following script:
+http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/verify.sh
+
+This patch makes sure that only one interface drives the bus at a time.
+
+Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
+===================================================================
+--- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 00:57:06.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:21:52.000000000 -0200
+@@ -1663,6 +1663,42 @@
+ 
+ 	mangle_pmu_pdata_by_system_rev();
+ 
++#ifdef CONFIG_AR6K_SPI_S3C24XX
++
++	printk(KERN_INFO "SPI/MMC co-existence: disabling SD/MMC\n");
++	s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2410_GPIO_INPUT);	/* CLK */
++	s3c2410_gpio_cfgpin(S3C2410_GPE6, S3C2410_GPIO_INPUT);	/* CMD */
++	s3c2410_gpio_cfgpin(S3C2410_GPE7, S3C2410_GPIO_INPUT);	/* DATA0 */
++	s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPIO_INPUT);	/* DATA1 */
++	s3c2410_gpio_cfgpin(S3C2410_GPE9, S3C2410_GPIO_INPUT);	/* DATA2 */
++	s3c2410_gpio_cfgpin(S3C2410_GPE10, S3C2410_GPIO_INPUT);	/* DATA3 */
++
++#else /* CONFIG_AR6K_SPI_S3C24XX */
++
++	printk(KERN_INFO "SPI/MMC co-existence: disabling SPI\n");
++	s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPIO_INPUT);	/* MISO */
++	s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPIO_INPUT);	/* MOSI */
++	s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPIO_INPUT);	/* CLK */
++	s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPIO_INPUT);	/* EINT3 */
++	s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPIO_INPUT);	/* nSS */
++
++#endif /* !CONFIG_AR6K_SPI_S3C24XX */
++
++	/* disable all pull-downs on SD/MMC and SPI  */
++
++	s3c2410_gpio_pullup(S3C2410_GPE5, 1);   /* SD/MMC block */
++	s3c2410_gpio_pullup(S3C2410_GPE6, 1);
++	s3c2410_gpio_pullup(S3C2410_GPE7, 1);
++	s3c2410_gpio_pullup(S3C2410_GPE8, 1);
++	s3c2410_gpio_pullup(S3C2410_GPE9, 1);
++	s3c2410_gpio_pullup(S3C2410_GPE10, 1);
++
++	s3c2410_gpio_pullup(S3C2410_GPE11, 1);  /* SPI block */
++	s3c2410_gpio_pullup(S3C2410_GPE12, 1);
++	s3c2410_gpio_pullup(S3C2410_GPE13, 1);
++	s3c2410_gpio_pullup(S3C2410_GPF3, 1);
++	s3c2410_gpio_pullup(S3C2410_GPG2, 1);
++
+ 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
+ 
+ 	s3c2410_pm_init();

Copied: developers/werner/wlan-spi/patches-tracking/attic/hack-revert-s3cmci.patch (from rev 4735, developers/werner/wlan-spi/patches-tracking/hack-revert-s3cmci.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/hack-revert-s3cmci.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/hack-revert-s3cmci.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,461 @@
+Index: ktrack/drivers/mmc/host/s3cmci.c
+===================================================================
+--- ktrack.orig/drivers/mmc/host/s3cmci.c	2008-10-30 21:33:18.000000000 -0200
++++ ktrack/drivers/mmc/host/s3cmci.c	2008-10-30 21:33:28.000000000 -0200
+@@ -2,10 +2,6 @@
+  *  linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
+  *
+  *  Copyright (C) 2004-2006 maintech GmbH, Thomas Kleffel <tk at maintech.de>
+- *  Copyright (C) 2007 Harald Welte <laforge at gnumonks.org>
+- *
+- * Current driver maintained by Ben Dooks and Simtec Electronics
+- *  Copyright (C) 2008 Simtec Electronics <ben-linux at fluff.org>
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License version 2 as
+@@ -17,7 +13,6 @@
+ #include <linux/clk.h>
+ #include <linux/mmc/host.h>
+ #include <linux/platform_device.h>
+-#include <linux/cpufreq.h>
+ #include <linux/irq.h>
+ #include <linux/io.h>
+ 
+@@ -28,14 +23,6 @@
+ 
+ #include <asm/plat-s3c24xx/mci.h>
+ 
+-#include <asm/dma.h>
+-#include <asm/dma-mapping.h>
+-
+-#include <asm/io.h>
+-#include <mach/regs-gpio.h>
+-#include <mach/mci.h>
+-#include <mach/dma.h>
+-
+ #include "s3cmci.h"
+ 
+ #define DRIVER_NAME "s3c-mci"
+@@ -52,9 +39,9 @@
+ 	dbg_conf  = (1 << 8),
+ };
+ 
+-static const int dbgmap_err   = dbg_fail;
++static const int dbgmap_err   = dbg_err | dbg_fail;
+ static const int dbgmap_info  = dbg_info | dbg_conf;
+-static const int dbgmap_debug = dbg_err | dbg_debug;
++static const int dbgmap_debug = dbg_debug;
+ 
+ #define dbg(host, channels, args...)		  \
+ 	do {					  \
+@@ -202,7 +189,7 @@
+ }
+ 
+ static inline int get_data_buffer(struct s3cmci_host *host,
+-				  u32 *bytes, u32 **pointer)
++				  u32 *words, u32 **pointer)
+ {
+ 	struct scatterlist *sg;
+ 
+@@ -219,7 +206,7 @@
+ 	}
+ 	sg = &host->mrq->data->sg[host->pio_sgptr];
+ 
+-	*bytes = sg->length;
++	*words = sg->length >> 2;
+ 	*pointer = sg_virt(sg);
+ 
+ 	host->pio_sgptr++;
+@@ -235,7 +222,7 @@
+ 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
+ 
+ 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
+-	return fifostat;
++	return fifostat >> 2;
+ }
+ 
+ static inline u32 fifo_free(struct s3cmci_host *host)
+@@ -243,15 +230,13 @@
+ 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
+ 
+ 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
+-	return 63 - fifostat;
++	return (63 - fifostat) >> 2;
+ }
+ 
+ static void do_pio_read(struct s3cmci_host *host)
+ {
+ 	int res;
+ 	u32 fifo;
+-	u32 *ptr;
+-	u32 fifo_words;
+ 	void __iomem *from_ptr;
+ 
+ 	/* write real prescaler to host, it might be set slow to fix */
+@@ -260,8 +245,8 @@
+ 	from_ptr = host->base + host->sdidata;
+ 
+ 	while ((fifo = fifo_count(host))) {
+-		if (!host->pio_bytes) {
+-			res = get_data_buffer(host, &host->pio_bytes,
++		if (!host->pio_words) {
++			res = get_data_buffer(host, &host->pio_words,
+ 					      &host->pio_ptr);
+ 			if (res) {
+ 				host->pio_active = XFER_NONE;
+@@ -274,47 +259,26 @@
+ 
+ 			dbg(host, dbg_pio,
+ 			    "pio_read(): new target: [%i]@[%p]\n",
+-			    host->pio_bytes, host->pio_ptr);
++			    host->pio_words, host->pio_ptr);
+ 		}
+ 
+ 		dbg(host, dbg_pio,
+ 		    "pio_read(): fifo:[%02i] buffer:[%03i] dcnt:[%08X]\n",
+-		    fifo, host->pio_bytes,
++		    fifo, host->pio_words,
+ 		    readl(host->base + S3C2410_SDIDCNT));
+ 
+-		/* If we have reached the end of the block, we can
+-		 * read a word and get 1 to 3 bytes.  If we in the
+-		 * middle of the block, we have to read full words,
+-		 * otherwise we will write garbage, so round down to
+-		 * an even multiple of 4. */
+-		if (fifo >= host->pio_bytes)
+-			fifo = host->pio_bytes;
+-		else
+-			fifo -= fifo & 3;
++		if (fifo > host->pio_words)
++			fifo = host->pio_words;
+ 
+-		host->pio_bytes -= fifo;
++		host->pio_words -= fifo;
+ 		host->pio_count += fifo;
+ 
+-		fifo_words = fifo >> 2;
+-		ptr = host->pio_ptr;
+-		while (fifo_words--)
+-			*ptr++ = readl(from_ptr);
+-		host->pio_ptr = ptr;
+-
+-		if (fifo & 3) {
+-			u32 n = fifo & 3;
+-			u32 data = readl(from_ptr);
+-			u8 *p = (u8 *)host->pio_ptr;
+-
+-			while (n--) {
+-				*p++ = data;
+-				data >>= 8;
+-			}
+-		}
++		while (fifo--)
++			*(host->pio_ptr++) = readl(from_ptr);
+ 	}
+ 
+-	if (!host->pio_bytes) {
+-		res = get_data_buffer(host, &host->pio_bytes, &host->pio_ptr);
++	if (!host->pio_words) {
++		res = get_data_buffer(host, &host->pio_words, &host->pio_ptr);
+ 		if (res) {
+ 			dbg(host, dbg_pio,
+ 			    "pio_read(): complete (no more buffers).\n");
+@@ -334,13 +298,12 @@
+ 	void __iomem *to_ptr;
+ 	int res;
+ 	u32 fifo;
+-	u32 *ptr;
+ 
+ 	to_ptr = host->base + host->sdidata;
+ 
+ 	while ((fifo = fifo_free(host))) {
+-		if (!host->pio_bytes) {
+-			res = get_data_buffer(host, &host->pio_bytes,
++		if (!host->pio_words) {
++			res = get_data_buffer(host, &host->pio_words,
+ 							&host->pio_ptr);
+ 			if (res) {
+ 				dbg(host, dbg_pio,
+@@ -352,27 +315,18 @@
+ 
+ 			dbg(host, dbg_pio,
+ 			    "pio_write(): new source: [%i]@[%p]\n",
+-			    host->pio_bytes, host->pio_ptr);
++			    host->pio_words, host->pio_ptr);
+ 
+ 		}
+ 
+-		/* If we have reached the end of the block, we have to
+-		 * write exactly the remaining number of bytes.  If we
+-		 * in the middle of the block, we have to write full
+-		 * words, so round down to an even multiple of 4. */
+-		if (fifo >= host->pio_bytes)
+-			fifo = host->pio_bytes;
+-		else
+-			fifo -= fifo & 3;
++		if (fifo > host->pio_words)
++			fifo = host->pio_words;
+ 
+-		host->pio_bytes -= fifo;
++		host->pio_words -= fifo;
+ 		host->pio_count += fifo;
+ 
+-		fifo = (fifo + 3) >> 2;
+-		ptr = host->pio_ptr;
+ 		while (fifo--)
+-			writel(*ptr++, to_ptr);
+-		host->pio_ptr = ptr;
++			writel(*(host->pio_ptr++), to_ptr);
+ 	}
+ 
+ 	enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
+@@ -382,6 +336,7 @@
+ {
+ 	struct s3cmci_host *host = (struct s3cmci_host *) data;
+ 
++
+ 	disable_irq(host->irq);
+ 
+ 	if (host->pio_active == XFER_WRITE)
+@@ -394,9 +349,9 @@
+ 		clear_imask(host);
+ 		if (host->pio_active != XFER_NONE) {
+ 			dbg(host, dbg_err, "unfinished %s "
+-			    "- pio_count:[%u] pio_bytes:[%u]\n",
++			    "- pio_count:[%u] pio_words:[%u]\n",
+ 			    (host->pio_active == XFER_READ) ? "read" : "write",
+-			    host->pio_count, host->pio_bytes);
++			    host->pio_count, host->pio_words);
+ 
+ 			if (host->mrq->data)
+ 				host->mrq->data->error = -EINVAL;
+@@ -622,6 +577,7 @@
+ 
+ 	spin_unlock_irqrestore(&host->complete_lock, iflags);
+ 	return IRQ_HANDLED;
++
+ }
+ 
+ /*
+@@ -856,10 +812,11 @@
+ 		/* We cannot deal with unaligned blocks with more than
+ 		 * one block being transfered. */
+ 
+-		if (data->blocks > 1) {
+-			pr_warning("%s: can't do non-word sized block transfers (blksz %d)\n", __func__, data->blksz);
++		if (data->blocks > 1)
+ 			return -EINVAL;
+-		}
++
++		/* No support yet for non-word block transfers. */
++		return -EINVAL;
+ 	}
+ 
+ 	while (readl(host->base + S3C2410_SDIDSTA) &
+@@ -939,7 +896,7 @@
+ 	BUG_ON((data->flags & BOTH_DIR) == BOTH_DIR);
+ 
+ 	host->pio_sgptr = 0;
+-	host->pio_bytes = 0;
++	host->pio_words = 0;
+ 	host->pio_count = 0;
+ 	host->pio_active = rw ? XFER_WRITE : XFER_READ;
+ 
+@@ -1034,7 +991,6 @@
+ 			dbg(host, dbg_err, "data prepare error %d\n", res);
+ 			cmd->error = res;
+ 			cmd->data->error = res;
+-			cmd->data->error = -EIO;
+ 
+ 			mmc_request_done(mmc, mrq);
+ 			return;
+@@ -1077,33 +1033,10 @@
+ 		s3cmci_send_request(mmc);
+ }
+ 
+-static void s3cmci_set_clk(struct s3cmci_host *host, struct mmc_ios *ios)
+-{
+-	u32 mci_psc;
+-
+-	/* Set clock */
+-	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
+-		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
+-
+-		if (host->real_rate <= ios->clock)
+-			break;
+-	}
+-
+-	if (mci_psc > 255)
+-		mci_psc = 255;
+-
+-	host->prescaler = mci_psc;
+-	writel(host->prescaler, host->base + S3C2410_SDIPRE);
+-
+-	/* If requested clock is 0, real_rate will be 0, too */
+-	if (ios->clock == 0)
+-		host->real_rate = 0;
+-}
+-
+ static void s3cmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+ {
+ 	struct s3cmci_host *host = mmc_priv(mmc);
+-	u32 mci_con;
++	u32 mci_psc, mci_con;
+ 
+ 	/* Set the power state */
+ 
+@@ -1141,7 +1074,23 @@
+ 		break;
+ 	}
+ 
+-	s3cmci_set_clk(host, ios);
++	/* Set clock */
++	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
++		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
++
++		if (host->real_rate <= ios->clock)
++			break;
++	}
++
++	if (mci_psc > 255)
++		mci_psc = 255;
++
++	host->prescaler = mci_psc;
++	writel(host->prescaler, host->base + S3C2410_SDIPRE);
++
++	/* If requested clock is 0, real_rate will be 0, too */
++	if (ios->clock == 0)
++		host->real_rate = 0;
+ 
+ 	/* Set CLOCK_ENABLE */
+ 	if (ios->clock)
+@@ -1199,61 +1148,6 @@
+ 	 * checks. Any zero fields to ensure reaonable defaults are picked. */
+ };
+ 
+-#ifdef CONFIG_CPU_FREQ
+-
+-static int s3cmci_cpufreq_transition(struct notifier_block *nb,
+-				     unsigned long val, void *data)
+-{
+-	struct s3cmci_host *host;
+-	struct mmc_host *mmc;
+-	unsigned long newclk;
+-	unsigned long flags;
+-
+-	host = container_of(nb, struct s3cmci_host, freq_transition);
+-	newclk = clk_get_rate(host->clk);
+-	mmc = host->mmc;
+-
+-	if ((val == CPUFREQ_PRECHANGE && newclk > host->clk_rate) ||
+-	    (val == CPUFREQ_POSTCHANGE && newclk < host->clk_rate)) {
+-		spin_lock_irqsave(&mmc->lock, flags);
+-
+-		host->clk_rate = newclk;
+-
+-		if (mmc->ios.power_mode != MMC_POWER_OFF &&
+-		    mmc->ios.clock != 0)
+-			s3cmci_set_clk(host, &mmc->ios);
+-
+-		spin_unlock_irqrestore(&mmc->lock, flags);
+-	}
+-
+-	return 0;
+-}
+-
+-static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
+-{
+-	host->freq_transition.notifier_call = s3cmci_cpufreq_transition;
+-
+-	return cpufreq_register_notifier(&host->freq_transition,
+-					 CPUFREQ_TRANSITION_NOTIFIER);
+-}
+-
+-static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
+-{
+-	cpufreq_unregister_notifier(&host->freq_transition,
+-				    CPUFREQ_TRANSITION_NOTIFIER);
+-}
+-
+-#else
+-static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
+-{
+-	return 0;
+-}
+-
+-static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
+-{
+-}
+-#endif
+-
+ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
+ {
+ 	struct s3cmci_host *host;
+@@ -1404,16 +1298,10 @@
+ 	    (host->is2440?"2440":""),
+ 	    host->base, host->irq, host->irq_cd, host->dma);
+ 
+-	ret = s3cmci_cpufreq_register(host);
+-	if (ret) {
+-		dev_err(&pdev->dev, "failed to register cpufreq\n");
+-		goto free_dmabuf;
+-	}
+-
+ 	ret = mmc_add_host(mmc);
+ 	if (ret) {
+ 		dev_err(&pdev->dev, "failed to add mmc host.\n");
+-		goto free_cpufreq;
++		goto free_dmabuf;
+ 	}
+ 
+ 	platform_set_drvdata(pdev, mmc);
+@@ -1421,9 +1309,6 @@
+ 
+ 	return 0;
+ 
+- free_cpufreq:
+-	s3cmci_cpufreq_deregister(host);
+-
+  free_dmabuf:
+ 	clk_disable(host->clk);
+ 
+@@ -1457,7 +1342,6 @@
+ 	if (host->irq_cd >= 0)
+ 		free_irq(host->irq_cd, host);
+ 
+-	s3cmci_cpufreq_deregister(host);
+ 	mmc_remove_host(mmc);
+ 	clk_disable(host->clk);
+ }
+@@ -1571,8 +1455,7 @@
+ 
+ MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
+ MODULE_LICENSE("GPL v2");
+-MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>, Ben Dooks <ben-linux at fluff.org>");
++MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>");
+ MODULE_ALIAS("platform:s3c2410-sdi");
+ MODULE_ALIAS("platform:s3c2412-sdi");
+ MODULE_ALIAS("platform:s3c2440-sdi");
+-
+Index: ktrack/drivers/mmc/host/s3cmci.h
+===================================================================
+--- ktrack.orig/drivers/mmc/host/s3cmci.h	2008-10-30 21:33:18.000000000 -0200
++++ ktrack/drivers/mmc/host/s3cmci.h	2008-10-30 21:33:29.000000000 -0200
+@@ -51,7 +51,7 @@
+ 	int			dma_complete;
+ 
+ 	u32			pio_sgptr;
+-	u32			pio_bytes;
++	u32			pio_words;
+ 	u32			pio_count;
+ 	u32			*pio_ptr;
+ #define XFER_NONE 0
+@@ -67,8 +67,4 @@
+ 
+ 	unsigned int		ccnt, dcnt;
+ 	struct tasklet_struct	pio_tasklet;
+-
+-#ifdef CONFIG_CPU_FREQ
+-	struct notifier_block	freq_transition;
+-#endif
+ };

Copied: developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-fix-int-mode.patch (from rev 4715, developers/werner/wlan-spi/patches-tracking/s3c-spi-fix-int-mode.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-fix-int-mode.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-fix-int-mode.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,63 @@
+Work in progress. Makes spi_s3c24xx.c work for up to 12MHz.
+
+At speeds of 13MHz or higher, we have setup time issues. I.e., the
+SPI host sees the data coming from the device delayed by one bit,
+even though things look fine on the scope.
+
+This 12MHz/13MHz "barrier" exists with or without probes attached,
+suggesting capacitative loading plays only a minor role in this.
+
+Index: ktrack/drivers/spi/spi_s3c24xx.c
+===================================================================
+--- ktrack.orig/drivers/spi/spi_s3c24xx.c	2008-10-10 10:52:14.000000000 -0200
++++ ktrack/drivers/spi/spi_s3c24xx.c	2008-10-15 23:14:27.000000000 -0200
+@@ -199,6 +199,27 @@
+ 
+ 	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.
++	 *
++	 * 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);
++		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;
+ }
+ 
+@@ -222,8 +243,19 @@
+ 
+ 	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 the byte preceding the first byte
++	 * or the SPI engine gets upset.
++	 */
++	if (hw->rx) {
++		u8 b = readb(hw->regs + S3C2410_SPRDAT);
++
++		if (count)
++			hw->rx[count-1] = b;
++	}
+ 
+ 	count++;
+ 

Copied: developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-from-int-to-poll.patch (from rev 4733, developers/werner/wlan-spi/patches-tracking/s3c-spi-from-int-to-poll.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-from-int-to-poll.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/s3c-spi-from-int-to-poll.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,105 @@
+Change the S3C SPI driver to use poll mode instead of interrupt mode.
+This reduces the gap between bytes from about 2.25us [1] to 100ns [2].
+
+[1] http://people.openmoko.org/werner/wlan-spi/spi-int.png
+[2] http://people.openmoko.org/werner/wlan-spi/spi-poll.png
+
+Index: ktrack/drivers/spi/spi_s3c24xx.c
+===================================================================
+--- ktrack.orig/drivers/spi/spi_s3c24xx.c	2008-10-29 03:47:03.000000000 -0200
++++ ktrack/drivers/spi/spi_s3c24xx.c	2008-10-29 03:47:04.000000000 -0200
+@@ -56,7 +56,7 @@
+ 	struct s3c2410_spi_info *pdata;
+ };
+ 
+-#define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_INT)
++#define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_POLL)
+ #define SPPIN_DEFAULT (S3C2410_SPPIN_KEEP)
+ 
+ static inline struct s3c24xx_spi *to_hw(struct spi_device *sdev)
+@@ -183,6 +183,7 @@
+ static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
+ {
+ 	struct s3c24xx_spi *hw = to_hw(spi);
++	int i;
+ 
+ 	dev_dbg(&spi->dev, "txrx: tx %p, rx %p, len %d\n",
+ 		t->tx_buf, t->rx_buf, t->len);
+@@ -194,10 +195,19 @@
+ 
+ 	init_completion(&hw->done);
+ 
+-	/* send the first byte */
+-	writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
++	for (i = 0; i != t->len; i++) {
++		u8 spsta;
+ 
+-	wait_for_completion(&hw->done);
++		writeb(hw_txbyte(hw, i), hw->regs + S3C2410_SPTDAT);
++		do spsta = readb(hw->regs + S3C2410_SPSTA);
++		while (!(spsta & S3C2410_SPSTA_READY));
++		if (hw->rx) {
++			u8 b = readb(hw->regs + S3C2410_SPRDAT);
++
++			if (i)
++				hw->rx[i-1] = b;
++		}
++	}
+ 
+ 	/*
+ 	 * Get the last byte. Since we don't have more data we can send in
+@@ -207,9 +217,9 @@
+ 	 * going on in the hardware. This is the voodoo ritual that makes it
+ 	 * work while anything else fails.
+ 	 */
+-	if (hw->rx && hw->count) {
++	if (hw->rx && i) {
+ 		udelay(1+10*1000000/spi->max_speed_hz);
+-		hw->rx[hw->count-1] = readb(hw->regs + S3C2410_SPRDAT);
++		hw->rx[i-1] = readb(hw->regs + S3C2410_SPRDAT);
+ 	}
+ 
+ 	if (0&&t->rx_buf && t->len > 18) {
+@@ -220,7 +230,7 @@
+ 			printk(" %02x", ((u8 *) t->rx_buf)[i]);
+ 		printk("\n");
+ 	}
+-	return hw->count;
++	return t->len;
+ }
+ 
+ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
+@@ -355,6 +365,7 @@
+ 		goto err_no_iomap;
+ 	}
+ 
++#if 0
+ 	hw->irq = platform_get_irq(pdev, 0);
+ 	if (hw->irq < 0) {
+ 		dev_err(&pdev->dev, "No IRQ specified\n");
+@@ -367,6 +378,7 @@
+ 		dev_err(&pdev->dev, "Cannot claim IRQ\n");
+ 		goto err_no_irq;
+ 	}
++#endif
+ 
+ 	hw->clk = clk_get(&pdev->dev, "spi");
+ 	if (IS_ERR(hw->clk)) {
+@@ -402,7 +414,7 @@
+ 	clk_put(hw->clk);
+ 
+  err_no_clk:
+-	free_irq(hw->irq, hw);
++	//free_irq(hw->irq, hw);
+ 
+  err_no_irq:
+ 	iounmap(hw->regs);
+@@ -430,7 +442,7 @@
+ 	clk_disable(hw->clk);
+ 	clk_put(hw->clk);
+ 
+-	free_irq(hw->irq, hw);
++	//free_irq(hw->irq, hw);
+ 	iounmap(hw->regs);
+ 
+ 	release_resource(hw->ioarea);

Copied: developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-cpufreq-driver-mmc.patch (from rev 4735, developers/werner/wlan-spi/patches-tracking/s3c24xx-cpufreq-driver-mmc.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-cpufreq-driver-mmc.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-cpufreq-driver-mmc.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,198 @@
+Add support for CPU frequency scalling for the s3c_mci
+driver.
+
+Signed-off-by: Ben Dooks <ben-linux at fluff.org>
+
+Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
+===================================================================
+--- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:40.000000000 +0100
++++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
+@@ -13,6 +13,7 @@
+ #include <linux/clk.h>
+ #include <linux/mmc/host.h>
+ #include <linux/platform_device.h>
++#include <linux/cpufreq.h>
+ #include <linux/irq.h>
+ #include <linux/io.h>
+ 
+@@ -1033,10 +1034,33 @@ static void s3cmci_request(struct mmc_ho
+ 		s3cmci_send_request(mmc);
+ }
+ 
++static void s3cmci_set_clk(struct s3cmci_host *host, struct mmc_ios *ios)
++{
++	u32 mci_psc;
++
++	/* Set clock */
++	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
++		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
++
++		if (host->real_rate <= ios->clock)
++			break;
++	}
++
++	if (mci_psc > 255)
++		mci_psc = 255;
++
++	host->prescaler = mci_psc;
++	writel(host->prescaler, host->base + S3C2410_SDIPRE);
++
++	/* If requested clock is 0, real_rate will be 0, too */
++	if (ios->clock == 0)
++		host->real_rate = 0;
++}
++
+ static void s3cmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+ {
+ 	struct s3cmci_host *host = mmc_priv(mmc);
+-	u32 mci_psc, mci_con;
++	u32 mci_con;
+ 
+ 	/* Set the power state */
+ 
+@@ -1074,23 +1098,7 @@ static void s3cmci_set_ios(struct mmc_ho
+ 		break;
+ 	}
+ 
+-	/* Set clock */
+-	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
+-		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
+-
+-		if (host->real_rate <= ios->clock)
+-			break;
+-	}
+-
+-	if (mci_psc > 255)
+-		mci_psc = 255;
+-
+-	host->prescaler = mci_psc;
+-	writel(host->prescaler, host->base + S3C2410_SDIPRE);
+-
+-	/* If requested clock is 0, real_rate will be 0, too */
+-	if (ios->clock == 0)
+-		host->real_rate = 0;
++	s3cmci_set_clk(host, ios);
+ 
+ 	/* Set CLOCK_ENABLE */
+ 	if (ios->clock)
+@@ -1148,6 +1156,61 @@ static struct s3c24xx_mci_pdata s3cmci_d
+ 	 * checks. Any zero fields to ensure reaonable defaults are picked. */
+ };
+ 
++#ifdef CONFIG_CPU_FREQ
++
++static int s3cmci_cpufreq_transition(struct notifier_block *nb,
++				     unsigned long val, void *data)
++{
++	struct s3cmci_host *host;
++	struct mmc_host *mmc;
++	unsigned long newclk;
++	unsigned long flags;
++
++	host = container_of(nb, struct s3cmci_host, freq_transition);
++	newclk = clk_get_rate(host->clk);
++	mmc = host->mmc;
++
++	if ((val == CPUFREQ_PRECHANGE && host->clk_rate > newclk) ||
++	    (val == CPUFREQ_POSTCHANGE && host->clk_rate < newclk)) {
++		spin_lock_irqsave(&mmc->lock, flags);
++
++		host->clk_rate = newclk;
++
++		if (mmc->ios.power_mode != MMC_POWER_OFF &&
++		    mmc->ios.clock != 0)
++			s3cmci_set_clk(host, &mmc->ios);
++
++		spin_unlock_irqrestore(&mmc->lock, flags);
++	}
++
++	return 0;
++}
++
++static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
++{
++	host->freq_transition.notifier_call = s3cmci_cpufreq_transition;
++
++	return cpufreq_register_notifier(&host->freq_transition,
++					 CPUFREQ_TRANSITION_NOTIFIER);
++}
++
++static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
++{
++	cpufreq_unregister_notifier(&host->freq_transition,
++				    CPUFREQ_TRANSITION_NOTIFIER);
++}
++
++#else
++static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
++{
++	return 0;
++}
++
++static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
++{
++}
++#endif
++
+ static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
+ {
+ 	struct s3cmci_host *host;
+@@ -1298,10 +1361,16 @@ static int __devinit s3cmci_probe(struct
+ 	    (host->is2440?"2440":""),
+ 	    host->base, host->irq, host->irq_cd, host->dma);
+ 
++	ret = s3cmci_cpufreq_register(host);
++	if (ret) {
++		dev_err(&pdev->dev, "failed to register cpufreq\n");
++		goto free_dmabuf;
++	}
++
+ 	ret = mmc_add_host(mmc);
+ 	if (ret) {
+ 		dev_err(&pdev->dev, "failed to add mmc host.\n");
+-		goto free_dmabuf;
++		goto free_cpufreq;
+ 	}
+ 
+ 	platform_set_drvdata(pdev, mmc);
+@@ -1309,6 +1378,9 @@ static int __devinit s3cmci_probe(struct
+ 
+ 	return 0;
+ 
++ free_cpufreq:
++	s3cmci_cpufreq_deregister(host);
++
+  free_dmabuf:
+ 	clk_disable(host->clk);
+ 
+@@ -1342,6 +1414,7 @@ static void s3cmci_shutdown(struct platf
+ 	if (host->irq_cd >= 0)
+ 		free_irq(host->irq_cd, host);
+ 
++	s3cmci_cpufreq_deregister(host);
+ 	mmc_remove_host(mmc);
+ 	clk_disable(host->clk);
+ }
+Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h
+===================================================================
+--- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:40.000000000 +0100
++++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:51.000000000 +0100
+@@ -67,4 +67,8 @@ struct s3cmci_host {
+ 
+ 	unsigned int		ccnt, dcnt;
+ 	struct tasklet_struct	pio_tasklet;
++
++#ifdef CONFIG_CPU_FREQ
++	struct notifier_block	freq_transition;
++#endif
+ };
+
+-- 
+Ben (ben at fluff.org, http://www.fluff.org/)
+
+  'a smiley only costs 4 bytes'
+
+-------------------------------------------------------------------
+List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
+FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
+Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Copied: developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-mmc-faster-transfer-core.patch (from rev 4735, developers/werner/wlan-spi/patches-tracking/s3c24xx-mmc-faster-transfer-core.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-mmc-faster-transfer-core.patch	                        (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/s3c24xx-mmc-faster-transfer-core.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -0,0 +1,82 @@
+The s3cmci driver uses the host->pio_ptr field to
+point to the current position into the buffer for data
+transfer. During the transfers it does the following:
+
+	while (fifo_words--)
+		*(host->pio_ptr++) = readl(from_ptr);
+
+This is inefficent, as host->pio_ptr is not used in any
+other part of the transfer but the compiler emits code
+which does the following:
+
+	while (fifo_words--) {
+		u32 *ptr = host->pio_ptr;
+		*ptr = readl(from_ptr);
+		ptr++;
+		host->pio_ptr = ptr;
+	}
+
+This is obviously a waste of a load and store each time
+around the loop, which could be up to 16 times depending
+on how much needs to be transfered.
+
+Move the ptr accesses to outside the while loop so that
+we do not end up reloading/re-writing the pointer.
+
+Note, this seems to make the code 16 bytes larger.
+
+Signed-off-by: Ben Dooks <ben-linux at fluff.org>
+Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
+===================================================================
+--- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
++++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:52.000000000 +0100
+@@ -238,6 +238,7 @@ static void do_pio_read(struct s3cmci_ho
+ {
+ 	int res;
+ 	u32 fifo;
++	u32 *ptr;
+ 	u32 fifo_words;
+ 	void __iomem *from_ptr;
+ 
+@@ -283,8 +284,10 @@ static void do_pio_read(struct s3cmci_ho
+ 		host->pio_count += fifo;
+ 
+ 		fifo_words = fifo >> 2;
++		ptr = host->pio_ptr;
+ 		while (fifo_words--)
+-			*(host->pio_ptr++) = readl(from_ptr);
++			*ptr++ = readl(from_ptr);
++		host->pio_ptr = ptr;
+ 
+ 		if (fifo & 3) {
+ 			u32 n = fifo & 3;
+@@ -319,6 +322,7 @@ static void do_pio_write(struct s3cmci_h
+ 	void __iomem *to_ptr;
+ 	int res;
+ 	u32 fifo;
++	u32 *ptr;
+ 
+ 	to_ptr = host->base + host->sdidata;
+ 
+@@ -353,8 +357,10 @@ static void do_pio_write(struct s3cmci_h
+ 		host->pio_count += fifo;
+ 
+ 		fifo = (fifo + 3) >> 2;
++		ptr = host->pio_ptr;
+ 		while (fifo--)
+-			writel(*(host->pio_ptr++), to_ptr);
++			writel(*ptr++, to_ptr);
++		host->pio_ptr = ptr;
+ 	}
+ 
+ 	enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
+
+-- 
+Ben (ben at fluff.org, http://www.fluff.org/)
+
+  'a smiley only costs 4 bytes'
+
+-------------------------------------------------------------------
+List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
+FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
+Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Deleted: developers/werner/wlan-spi/patches-tracking/christer-mmc-byte-alignment.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/christer-mmc-byte-alignment.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/christer-mmc-byte-alignment.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,228 +0,0 @@
-From: Christer Weinigel <christer at weinigel.se>
-
-To be able to do SDIO the s3cmci driver has to support non-word-sized
-transfers.  Change pio_words into pio_bytes and fix up all the places
-where it is used.  
-
-This variant of the patch will not overrun the buffer when reading an
-odd number of bytes.  When writing, this variant will still read past
-the end of the buffer, but since the driver can't support non-word-
-aligned transfers anyway, this should not be a problem, since a
-word-aligned transfer will never cross a page boundary.
-
-This has been tested with a CSR SDIO Bluetooth Type A device on a
-Samsung S3C24A0 processor.
-
-Signed-off-by: Christer Weinigel <christer at weinigel.se>
-Signed-off-by: Ben Dooks <ben-linux at fluff.org>
-
-Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
-===================================================================
---- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
-+++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
-@@ -190,7 +190,7 @@ static inline void clear_imask(struct s3
- }
- 
- static inline int get_data_buffer(struct s3cmci_host *host,
--				  u32 *words, u32 **pointer)
-+				  u32 *bytes, u32 **pointer)
- {
- 	struct scatterlist *sg;
- 
-@@ -207,7 +207,7 @@ static inline int get_data_buffer(struct
- 	}
- 	sg = &host->mrq->data->sg[host->pio_sgptr];
- 
--	*words = sg->length >> 2;
-+	*bytes = sg->length;
- 	*pointer = sg_virt(sg);
- 
- 	host->pio_sgptr++;
-@@ -223,7 +223,7 @@ static inline u32 fifo_count(struct s3cm
- 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
- 
- 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
--	return fifostat >> 2;
-+	return fifostat;
- }
- 
- static inline u32 fifo_free(struct s3cmci_host *host)
-@@ -231,13 +231,14 @@ static inline u32 fifo_free(struct s3cmc
- 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
- 
- 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
--	return (63 - fifostat) >> 2;
-+	return 63 - fifostat;
- }
- 
- static void do_pio_read(struct s3cmci_host *host)
- {
- 	int res;
- 	u32 fifo;
-+	u32 fifo_words;
- 	void __iomem *from_ptr;
- 
- 	/* write real prescaler to host, it might be set slow to fix */
-@@ -246,8 +247,8 @@ static void do_pio_read(struct s3cmci_ho
- 	from_ptr = host->base + host->sdidata;
- 
- 	while ((fifo = fifo_count(host))) {
--		if (!host->pio_words) {
--			res = get_data_buffer(host, &host->pio_words,
-+		if (!host->pio_bytes) {
-+			res = get_data_buffer(host, &host->pio_bytes,
- 					      &host->pio_ptr);
- 			if (res) {
- 				host->pio_active = XFER_NONE;
-@@ -260,26 +261,45 @@ static void do_pio_read(struct s3cmci_ho
- 
- 			dbg(host, dbg_pio,
- 			    "pio_read(): new target: [%i]@[%p]\n",
--			    host->pio_words, host->pio_ptr);
-+			    host->pio_bytes, host->pio_ptr);
- 		}
- 
- 		dbg(host, dbg_pio,
- 		    "pio_read(): fifo:[%02i] buffer:[%03i] dcnt:[%08X]\n",
--		    fifo, host->pio_words,
-+		    fifo, host->pio_bytes,
- 		    readl(host->base + S3C2410_SDIDCNT));
- 
--		if (fifo > host->pio_words)
--			fifo = host->pio_words;
-+		/* If we have reached the end of the block, we can
-+		 * read a word and get 1 to 3 bytes.  If we in the
-+		 * middle of the block, we have to read full words,
-+		 * otherwise we will write garbage, so round down to
-+		 * an even multiple of 4. */
-+		if (fifo >= host->pio_bytes)
-+			fifo = host->pio_bytes;
-+		else
-+			fifo -= fifo & 3;
- 
--		host->pio_words -= fifo;
-+		host->pio_bytes -= fifo;
- 		host->pio_count += fifo;
- 
--		while (fifo--)
-+		fifo_words = fifo >> 2;
-+		while (fifo_words--)
- 			*(host->pio_ptr++) = readl(from_ptr);
-+
-+		if (fifo & 3) {
-+			u32 n = fifo & 3;
-+			u32 data = readl(from_ptr);
-+			u8 *p = (u8 *)host->pio_ptr;
-+
-+			while (n--) {
-+				*p++ = data;
-+				data >>= 8;
-+			}
-+		}
- 	}
- 
--	if (!host->pio_words) {
--		res = get_data_buffer(host, &host->pio_words, &host->pio_ptr);
-+	if (!host->pio_bytes) {
-+		res = get_data_buffer(host, &host->pio_bytes, &host->pio_ptr);
- 		if (res) {
- 			dbg(host, dbg_pio,
- 			    "pio_read(): complete (no more buffers).\n");
-@@ -303,8 +323,8 @@ static void do_pio_write(struct s3cmci_h
- 	to_ptr = host->base + host->sdidata;
- 
- 	while ((fifo = fifo_free(host))) {
--		if (!host->pio_words) {
--			res = get_data_buffer(host, &host->pio_words,
-+		if (!host->pio_bytes) {
-+			res = get_data_buffer(host, &host->pio_bytes,
- 							&host->pio_ptr);
- 			if (res) {
- 				dbg(host, dbg_pio,
-@@ -316,16 +336,23 @@ static void do_pio_write(struct s3cmci_h
- 
- 			dbg(host, dbg_pio,
- 			    "pio_write(): new source: [%i]@[%p]\n",
--			    host->pio_words, host->pio_ptr);
-+			    host->pio_bytes, host->pio_ptr);
- 
- 		}
- 
--		if (fifo > host->pio_words)
--			fifo = host->pio_words;
-+		/* If we have reached the end of the block, we have to
-+		 * write exactly the remaining number of bytes.  If we
-+		 * in the middle of the block, we have to write full
-+		 * words, so round down to an even multiple of 4. */
-+		if (fifo >= host->pio_bytes)
-+			fifo = host->pio_bytes;
-+		else
-+			fifo -= fifo & 3;
- 
--		host->pio_words -= fifo;
-+		host->pio_bytes -= fifo;
- 		host->pio_count += fifo;
- 
-+		fifo = (fifo + 3) >> 2;
- 		while (fifo--)
- 			writel(*(host->pio_ptr++), to_ptr);
- 	}
-@@ -350,9 +377,9 @@ static void pio_tasklet(unsigned long da
- 		clear_imask(host);
- 		if (host->pio_active != XFER_NONE) {
- 			dbg(host, dbg_err, "unfinished %s "
--			    "- pio_count:[%u] pio_words:[%u]\n",
-+			    "- pio_count:[%u] pio_bytes:[%u]\n",
- 			    (host->pio_active == XFER_READ) ? "read" : "write",
--			    host->pio_count, host->pio_words);
-+			    host->pio_count, host->pio_bytes);
- 
- 			if (host->mrq->data)
- 				host->mrq->data->error = -EINVAL;
-@@ -813,11 +840,10 @@ static int s3cmci_setup_data(struct s3cm
- 		/* We cannot deal with unaligned blocks with more than
- 		 * one block being transfered. */
- 
--		if (data->blocks > 1)
-+		if (data->blocks > 1) {
-+			pr_warning("%s: can't do non-word sized block transfers (blksz %d)\n", __func__, data->blksz);
- 			return -EINVAL;
--
--		/* No support yet for non-word block transfers. */
--		return -EINVAL;
-+		}
- 	}
- 
- 	while (readl(host->base + S3C2410_SDIDSTA) &
-@@ -897,7 +923,7 @@ static int s3cmci_prepare_pio(struct s3c
- 	BUG_ON((data->flags & BOTH_DIR) == BOTH_DIR);
- 
- 	host->pio_sgptr = 0;
--	host->pio_words = 0;
-+	host->pio_bytes = 0;
- 	host->pio_count = 0;
- 	host->pio_active = rw ? XFER_WRITE : XFER_READ;
- 
-Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h
-===================================================================
---- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:51.000000000 +0100
-+++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:51.000000000 +0100
-@@ -51,7 +51,7 @@ struct s3cmci_host {
- 	int			dma_complete;
- 
- 	u32			pio_sgptr;
--	u32			pio_words;
-+	u32			pio_bytes;
- 	u32			pio_count;
- 	u32			*pio_ptr;
- #define XFER_NONE 0
-
--- 
-Ben (ben at fluff.org, http://www.fluff.org/)
-
-  'a smiley only costs 4 bytes'
-
--------------------------------------------------------------------
-List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
-FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
-Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Deleted: developers/werner/wlan-spi/patches-tracking/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/drivers-s3c24xx-mmc-add-us-to-copyright-header.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,42 +0,0 @@
-Since the original authour (Thomas Kleffel) has been too busy to
-merge the s3cmci driver and keep it up to date, I (mostly as part
-of my role with Simtec Electronics) got the driver to a mergable
-state and have been maintaining it since I think that I should
-be added to the header. Also add a copyright statement for the
-new work. 
-
-Signed-off-by: Ben Dooks <ben-linux at fluff.org>
-
-Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
-===================================================================
---- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:52.000000000 +0100
-+++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:52.000000000 +0100
-@@ -3,6 +3,9 @@
-  *
-  *  Copyright (C) 2004-2006 maintech GmbH, Thomas Kleffel <tk at maintech.de>
-  *
-+ * Current driver maintained by Ben Dooks and Simtec Electronics
-+ *  Copyright (C) 2008 Simtec Electronics <ben-linux at fluff.org>
-+ *
-  * This program is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License version 2 as
-  * published by the Free Software Foundation.
-@@ -1560,7 +1563,7 @@ module_exit(s3cmci_exit);
- 
- MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
- MODULE_LICENSE("GPL v2");
--MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>");
-+MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>, Ben Dooks <ben-linux at fluff.org>");
- MODULE_ALIAS("platform:s3c2410-sdi");
- MODULE_ALIAS("platform:s3c2412-sdi");
- MODULE_ALIAS("platform:s3c2440-sdi");
-
--- 
-Ben (ben at fluff.org, http://www.fluff.org/)
-
-  'a smiley only costs 4 bytes'
-
--------------------------------------------------------------------
-List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
-FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
-Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Deleted: developers/werner/wlan-spi/patches-tracking/fix-mmc-busy-loop-on-bytes.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/fix-mmc-busy-loop-on-bytes.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/fix-mmc-busy-loop-on-bytes.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,48 +0,0 @@
-fix-mmc-busy-loop-on-bytes.patch
-
-christer-mmc-byte-alignment.patch reduced the FIFO I/O granularity
-from words to bytes. This also includes the decision when the FIFO
-is empty or full.
-
-However, we sometimes only want to transfer full words, in which
-case do_pio_read/do_pio_write busy-loop until the FIFO has filled
-up or drained enough.
-
-In the case of do_pio_write, this can cause an endless loop if the
-amount of data exceeds the FIFO size, because do_pio_write runs
-before the transfer is initiated, so the FIFO never drains.
-
-Signed-off-by: Werner Almesberger <werner at openmoko.org>
-
----
-
-Index: ktrack/drivers/mmc/host/s3cmci.c
-===================================================================
---- ktrack.orig/drivers/mmc/host/s3cmci.c	2008-10-30 23:07:50.000000000 -0200
-+++ ktrack/drivers/mmc/host/s3cmci.c	2008-10-30 23:08:14.000000000 -0200
-@@ -289,8 +289,11 @@
- 		 * an even multiple of 4. */
- 		if (fifo >= host->pio_bytes)
- 			fifo = host->pio_bytes;
--		else
-+		else {
- 			fifo -= fifo & 3;
-+			if (!fifo)
-+				break;
-+		}
- 
- 		host->pio_bytes -= fifo;
- 		host->pio_count += fifo;
-@@ -362,8 +365,11 @@
- 		 * words, so round down to an even multiple of 4. */
- 		if (fifo >= host->pio_bytes)
- 			fifo = host->pio_bytes;
--		else
-+		else {
- 			fifo -= fifo & 3;
-+			if (!fifo)
-+				break;
-+		}
- 
- 		host->pio_bytes -= fifo;
- 		host->pio_count += fifo;

Modified: developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,16 +1,14 @@
-Almost there !
+Use S3C SDI on GTA02.
 
-In two successive tries, enabling this driver killed I2C.
-Nothing like that happened after a rebuild. Odd.
-
 Index: ktrack/arch/arm/mach-s3c2440/Kconfig
 ===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:47:18.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:47:21.000000000 -0200
-@@ -122,6 +122,10 @@
- 		  This functionality requires that SPI0 is wired to
- 		  the WLAN SDIO interface.
- 
+--- ktrack.orig/arch/arm/mach-s3c2440/Kconfig	2008-11-02 04:29:34.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/Kconfig	2008-11-02 04:32:14.000000000 -0200
+@@ -113,6 +113,11 @@
+                 bool "GPIO bit-banging SPI"
+                 select MMC_SPI
+                 select SPI_S3C24XX_GPIO
++
 +	config AR6K_S3CMCI
 +		bool "S3C MMC/SD/SDIO driver"
 +		select MMC_S3C
@@ -20,17 +18,17 @@
  endmenu
 Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
 ===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:47:18.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:47:21.000000000 -0200
-@@ -1723,6 +1723,11 @@
+--- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-11-02 04:29:34.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-11-02 04:33:05.000000000 -0200
+@@ -1720,6 +1720,11 @@
+ 	platform_device_register(&gta02_spi_wlan);
+ #endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
  
- 	mangle_pmu_pdata_by_system_rev();
- 
 +#ifdef CONFIG_AR6K_S3CMCI
 +	s3c_device_sdi.dev.platform_data = NULL;
 +	platform_device_register(&s3c_device_sdi); /* @@@ just for testing */
 +#endif /* CONFIG_AR6K_S3CMCI */
 +
- #ifdef CONFIG_AR6K_SPI_S3C24XX
+ 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
  
- 	printk(KERN_INFO "SPI/MMC co-existence: disabling SD/MMC\n");
+ 	s3c2410_pm_init();

Modified: developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -13,8 +13,8 @@
 
 Index: ktrack/arch/arm/mach-s3c2440/Kconfig
 ===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/Kconfig	2008-10-29 00:57:06.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:39:59.000000000 -0200
+--- ktrack.orig/arch/arm/mach-s3c2440/Kconfig	2008-11-02 02:50:01.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/Kconfig	2008-11-02 04:29:34.000000000 -0200
 @@ -101,6 +101,20 @@
  	   Say Y here if you are using an early hardware revision
  	   of the FIC/Openmoko Neo1973 GTA02 GSM Phone.
@@ -38,8 +38,8 @@
  #source "arch/arm/mach-s3c2440/camera/Kconfig"
 Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
 ===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:33:37.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:41:13.000000000 -0200
+--- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-11-02 04:29:28.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-11-02 04:29:34.000000000 -0200
 @@ -37,6 +37,7 @@
  #include <linux/spi/spi.h>
  #include <linux/spi/glamo.h>
@@ -136,10 +136,10 @@
  static struct resource gta02_led_resources[] = {
  	{
  		.name	= "gta02-power:orange",
-@@ -1668,6 +1750,12 @@
- 	s3c2410_gpio_pullup(S3C2410_GPF3, 1);
- 	s3c2410_gpio_pullup(S3C2410_GPG2, 1);
+@@ -1632,6 +1714,12 @@
  
+ 	mangle_pmu_pdata_by_system_rev();
+ 
 +#ifdef CONFIG_AR6K_SPI_S3C24XX_GPIO
 +	s3c2410_gpio_setpin(S3C2410_GPE10, 1);	/* nSS */
 +	s3c2410_gpio_cfgpin(S3C2410_GPE10, S3C2410_GPIO_OUTPUT);

Deleted: developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,81 +0,0 @@
-Ongoing work on adding support for MMC-SPI using the S3C SPI driver.
-Note that this doesn't produce a valid bitstream yet.
-
-On GTA02, S3C SPI can only be used with WLAN if the SPI0 interface is
-wired to the SDIO interface. This is described here:
-http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/rework.pdf
-
-The correct wiring can be verified with the following script:
-http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/verify.sh
-
-Not-Yet-Signed-off-by: Werner Almesberger <werner at openmoko.org>
-
-Index: ktrack/arch/arm/mach-s3c2440/Kconfig
-===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:39:59.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/Kconfig	2008-10-29 03:42:30.000000000 -0200
-@@ -113,6 +113,15 @@
-                 bool "GPIO bit-banging SPI"
-                 select MMC_SPI
-                 select SPI_S3C24XX_GPIO
-+
-+	config AR6K_SPI_S3C24XX
-+		bool "Hardware-accelerated SPI (modification)"
-+		select MMC_SPI
-+		select SPI_S3C24XX
-+		help
-+		  This functionality requires that SPI0 is wired to
-+		  the WLAN SDIO interface.
-+
- endchoice
- 
- endmenu
-Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
-===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:41:13.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:44:38.000000000 -0200
-@@ -1243,9 +1243,7 @@
- /* ----- AR6000 WLAN interface --------------------------------------------- */
- 
- 
--/* shared by all SPI drivers */
--
--#if defined(CONFIG_AR6K_SPI_S3C24XX_GPIO)
-+#if defined(CONFIG_AR6K_SPI_S3C24XX) || defined(CONFIG_AR6K_SPI_S3C24XX_GPIO)
- 
- static struct spi_board_info gta02_spi_mmc_bdinfo[] = {
- 	{
-@@ -1258,7 +1256,18 @@
- 	}
- };
- 
--#endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
-+#endif /* CONFIG_AR6K_SPI_S3C24XX || CONFIG_AR6K_SPI_S3C24XX_GPIO */
-+
-+
-+#ifdef CONFIG_AR6K_SPI_S3C24XX
-+
-+static struct s3c2410_spi_info spi_wlan_cfg = {
-+	.pin_cs		= S3C2410_GPG2,
-+	.num_cs		= 1,
-+	.bus_num	= 0, /* link to gta02_spi_mmc_bdinfo */
-+};
-+
-+#endif /* CONFIG_AR6K_SPI_S3C24XX */
- 
- 
- #ifdef CONFIG_AR6K_SPI_S3C24XX_GPIO
-@@ -1756,6 +1765,13 @@
- 	platform_device_register(&gta02_spi_wlan);
- #endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
- 
-+#ifdef CONFIG_AR6K_SPI_S3C24XX
-+	spi_register_board_info(gta02_spi_mmc_bdinfo,
-+	    ARRAY_SIZE(gta02_spi_mmc_bdinfo));
-+	s3c_device_spi0.dev.platform_data = &spi_wlan_cfg;
-+	platform_device_register(&s3c_device_spi0);
-+#endif /* CONFIG_AR6K_SPI_S3C24XX */
-+
- 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
- 
- 	s3c2410_pm_init();

Deleted: developers/werner/wlan-spi/patches-tracking/hack-disable-ecc.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hack-disable-ecc.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/hack-disable-ecc.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,32 +0,0 @@
-Index: ktrack/drivers/mtd/nand/nand_base.c
-===================================================================
---- ktrack.orig/drivers/mtd/nand/nand_base.c	2008-10-29 00:57:08.000000000 -0200
-+++ ktrack/drivers/mtd/nand/nand_base.c	2008-10-29 03:17:39.000000000 -0200
-@@ -775,6 +775,7 @@
- 	uint32_t *eccpos = chip->ecc.layout->eccpos;
- 
- 	chip->ecc.read_page_raw(mtd, chip, buf);
-+	return 0;
- 
- 	for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
- 		chip->ecc.calculate(mtd, p, &ecc_calc[i]);
-@@ -830,6 +831,7 @@
- 
- 	p = bufpoi + data_col_addr;
- 	chip->read_buf(mtd, p, datafrag_len);
-+	return 0;
- 
- 	/* Calculate  ECC */
- 	for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size)
-Index: ktrack/drivers/mtd/nand/nand_ecc.c
-===================================================================
---- ktrack.orig/drivers/mtd/nand/nand_ecc.c	2008-10-29 00:57:08.000000000 -0200
-+++ ktrack/drivers/mtd/nand/nand_ecc.c	2008-10-29 03:17:56.000000000 -0200
-@@ -434,6 +434,7 @@
- 	const uint32_t eccsize_mult =
- 			(((struct nand_chip *)mtd->priv)->ecc.size) >> 8;
- 
-+	return 0;
- 	/*
- 	 * b0 to b2 indicate which bit is faulty (if any)
- 	 * we might need the xor result  more than once,

Deleted: developers/werner/wlan-spi/patches-tracking/hack-mmc-spi-coexistence.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hack-mmc-spi-coexistence.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/hack-mmc-spi-coexistence.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,56 +0,0 @@
-In order to drive WLAN with S3C SPI on GTA02, the SPI0 interface has to
-be wired to the SDIO interface. This rework is described here:
-http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/rework.pdf
-
-The correct wiring can be verified with the following script:
-http://svn.openmoko.org/developers/werner/wlan-spi/gta02-spi/verify.sh
-
-This patch makes sure that only one interface drives the bus at a time.
-
-Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
-===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 00:57:06.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-10-29 03:21:52.000000000 -0200
-@@ -1663,6 +1663,42 @@
- 
- 	mangle_pmu_pdata_by_system_rev();
- 
-+#ifdef CONFIG_AR6K_SPI_S3C24XX
-+
-+	printk(KERN_INFO "SPI/MMC co-existence: disabling SD/MMC\n");
-+	s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2410_GPIO_INPUT);	/* CLK */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE6, S3C2410_GPIO_INPUT);	/* CMD */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE7, S3C2410_GPIO_INPUT);	/* DATA0 */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPIO_INPUT);	/* DATA1 */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE9, S3C2410_GPIO_INPUT);	/* DATA2 */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE10, S3C2410_GPIO_INPUT);	/* DATA3 */
-+
-+#else /* CONFIG_AR6K_SPI_S3C24XX */
-+
-+	printk(KERN_INFO "SPI/MMC co-existence: disabling SPI\n");
-+	s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPIO_INPUT);	/* MISO */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPIO_INPUT);	/* MOSI */
-+	s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPIO_INPUT);	/* CLK */
-+	s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPIO_INPUT);	/* EINT3 */
-+	s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPIO_INPUT);	/* nSS */
-+
-+#endif /* !CONFIG_AR6K_SPI_S3C24XX */
-+
-+	/* disable all pull-downs on SD/MMC and SPI  */
-+
-+	s3c2410_gpio_pullup(S3C2410_GPE5, 1);   /* SD/MMC block */
-+	s3c2410_gpio_pullup(S3C2410_GPE6, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPE7, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPE8, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPE9, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPE10, 1);
-+
-+	s3c2410_gpio_pullup(S3C2410_GPE11, 1);  /* SPI block */
-+	s3c2410_gpio_pullup(S3C2410_GPE12, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPE13, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPF3, 1);
-+	s3c2410_gpio_pullup(S3C2410_GPG2, 1);
-+
- 	platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
- 
- 	s3c2410_pm_init();

Deleted: developers/werner/wlan-spi/patches-tracking/hack-revert-s3cmci.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hack-revert-s3cmci.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/hack-revert-s3cmci.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,461 +0,0 @@
-Index: ktrack/drivers/mmc/host/s3cmci.c
-===================================================================
---- ktrack.orig/drivers/mmc/host/s3cmci.c	2008-10-30 21:33:18.000000000 -0200
-+++ ktrack/drivers/mmc/host/s3cmci.c	2008-10-30 21:33:28.000000000 -0200
-@@ -2,10 +2,6 @@
-  *  linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
-  *
-  *  Copyright (C) 2004-2006 maintech GmbH, Thomas Kleffel <tk at maintech.de>
-- *  Copyright (C) 2007 Harald Welte <laforge at gnumonks.org>
-- *
-- * Current driver maintained by Ben Dooks and Simtec Electronics
-- *  Copyright (C) 2008 Simtec Electronics <ben-linux at fluff.org>
-  *
-  * This program is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License version 2 as
-@@ -17,7 +13,6 @@
- #include <linux/clk.h>
- #include <linux/mmc/host.h>
- #include <linux/platform_device.h>
--#include <linux/cpufreq.h>
- #include <linux/irq.h>
- #include <linux/io.h>
- 
-@@ -28,14 +23,6 @@
- 
- #include <asm/plat-s3c24xx/mci.h>
- 
--#include <asm/dma.h>
--#include <asm/dma-mapping.h>
--
--#include <asm/io.h>
--#include <mach/regs-gpio.h>
--#include <mach/mci.h>
--#include <mach/dma.h>
--
- #include "s3cmci.h"
- 
- #define DRIVER_NAME "s3c-mci"
-@@ -52,9 +39,9 @@
- 	dbg_conf  = (1 << 8),
- };
- 
--static const int dbgmap_err   = dbg_fail;
-+static const int dbgmap_err   = dbg_err | dbg_fail;
- static const int dbgmap_info  = dbg_info | dbg_conf;
--static const int dbgmap_debug = dbg_err | dbg_debug;
-+static const int dbgmap_debug = dbg_debug;
- 
- #define dbg(host, channels, args...)		  \
- 	do {					  \
-@@ -202,7 +189,7 @@
- }
- 
- static inline int get_data_buffer(struct s3cmci_host *host,
--				  u32 *bytes, u32 **pointer)
-+				  u32 *words, u32 **pointer)
- {
- 	struct scatterlist *sg;
- 
-@@ -219,7 +206,7 @@
- 	}
- 	sg = &host->mrq->data->sg[host->pio_sgptr];
- 
--	*bytes = sg->length;
-+	*words = sg->length >> 2;
- 	*pointer = sg_virt(sg);
- 
- 	host->pio_sgptr++;
-@@ -235,7 +222,7 @@
- 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
- 
- 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
--	return fifostat;
-+	return fifostat >> 2;
- }
- 
- static inline u32 fifo_free(struct s3cmci_host *host)
-@@ -243,15 +230,13 @@
- 	u32 fifostat = readl(host->base + S3C2410_SDIFSTA);
- 
- 	fifostat &= S3C2410_SDIFSTA_COUNTMASK;
--	return 63 - fifostat;
-+	return (63 - fifostat) >> 2;
- }
- 
- static void do_pio_read(struct s3cmci_host *host)
- {
- 	int res;
- 	u32 fifo;
--	u32 *ptr;
--	u32 fifo_words;
- 	void __iomem *from_ptr;
- 
- 	/* write real prescaler to host, it might be set slow to fix */
-@@ -260,8 +245,8 @@
- 	from_ptr = host->base + host->sdidata;
- 
- 	while ((fifo = fifo_count(host))) {
--		if (!host->pio_bytes) {
--			res = get_data_buffer(host, &host->pio_bytes,
-+		if (!host->pio_words) {
-+			res = get_data_buffer(host, &host->pio_words,
- 					      &host->pio_ptr);
- 			if (res) {
- 				host->pio_active = XFER_NONE;
-@@ -274,47 +259,26 @@
- 
- 			dbg(host, dbg_pio,
- 			    "pio_read(): new target: [%i]@[%p]\n",
--			    host->pio_bytes, host->pio_ptr);
-+			    host->pio_words, host->pio_ptr);
- 		}
- 
- 		dbg(host, dbg_pio,
- 		    "pio_read(): fifo:[%02i] buffer:[%03i] dcnt:[%08X]\n",
--		    fifo, host->pio_bytes,
-+		    fifo, host->pio_words,
- 		    readl(host->base + S3C2410_SDIDCNT));
- 
--		/* If we have reached the end of the block, we can
--		 * read a word and get 1 to 3 bytes.  If we in the
--		 * middle of the block, we have to read full words,
--		 * otherwise we will write garbage, so round down to
--		 * an even multiple of 4. */
--		if (fifo >= host->pio_bytes)
--			fifo = host->pio_bytes;
--		else
--			fifo -= fifo & 3;
-+		if (fifo > host->pio_words)
-+			fifo = host->pio_words;
- 
--		host->pio_bytes -= fifo;
-+		host->pio_words -= fifo;
- 		host->pio_count += fifo;
- 
--		fifo_words = fifo >> 2;
--		ptr = host->pio_ptr;
--		while (fifo_words--)
--			*ptr++ = readl(from_ptr);
--		host->pio_ptr = ptr;
--
--		if (fifo & 3) {
--			u32 n = fifo & 3;
--			u32 data = readl(from_ptr);
--			u8 *p = (u8 *)host->pio_ptr;
--
--			while (n--) {
--				*p++ = data;
--				data >>= 8;
--			}
--		}
-+		while (fifo--)
-+			*(host->pio_ptr++) = readl(from_ptr);
- 	}
- 
--	if (!host->pio_bytes) {
--		res = get_data_buffer(host, &host->pio_bytes, &host->pio_ptr);
-+	if (!host->pio_words) {
-+		res = get_data_buffer(host, &host->pio_words, &host->pio_ptr);
- 		if (res) {
- 			dbg(host, dbg_pio,
- 			    "pio_read(): complete (no more buffers).\n");
-@@ -334,13 +298,12 @@
- 	void __iomem *to_ptr;
- 	int res;
- 	u32 fifo;
--	u32 *ptr;
- 
- 	to_ptr = host->base + host->sdidata;
- 
- 	while ((fifo = fifo_free(host))) {
--		if (!host->pio_bytes) {
--			res = get_data_buffer(host, &host->pio_bytes,
-+		if (!host->pio_words) {
-+			res = get_data_buffer(host, &host->pio_words,
- 							&host->pio_ptr);
- 			if (res) {
- 				dbg(host, dbg_pio,
-@@ -352,27 +315,18 @@
- 
- 			dbg(host, dbg_pio,
- 			    "pio_write(): new source: [%i]@[%p]\n",
--			    host->pio_bytes, host->pio_ptr);
-+			    host->pio_words, host->pio_ptr);
- 
- 		}
- 
--		/* If we have reached the end of the block, we have to
--		 * write exactly the remaining number of bytes.  If we
--		 * in the middle of the block, we have to write full
--		 * words, so round down to an even multiple of 4. */
--		if (fifo >= host->pio_bytes)
--			fifo = host->pio_bytes;
--		else
--			fifo -= fifo & 3;
-+		if (fifo > host->pio_words)
-+			fifo = host->pio_words;
- 
--		host->pio_bytes -= fifo;
-+		host->pio_words -= fifo;
- 		host->pio_count += fifo;
- 
--		fifo = (fifo + 3) >> 2;
--		ptr = host->pio_ptr;
- 		while (fifo--)
--			writel(*ptr++, to_ptr);
--		host->pio_ptr = ptr;
-+			writel(*(host->pio_ptr++), to_ptr);
- 	}
- 
- 	enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
-@@ -382,6 +336,7 @@
- {
- 	struct s3cmci_host *host = (struct s3cmci_host *) data;
- 
-+
- 	disable_irq(host->irq);
- 
- 	if (host->pio_active == XFER_WRITE)
-@@ -394,9 +349,9 @@
- 		clear_imask(host);
- 		if (host->pio_active != XFER_NONE) {
- 			dbg(host, dbg_err, "unfinished %s "
--			    "- pio_count:[%u] pio_bytes:[%u]\n",
-+			    "- pio_count:[%u] pio_words:[%u]\n",
- 			    (host->pio_active == XFER_READ) ? "read" : "write",
--			    host->pio_count, host->pio_bytes);
-+			    host->pio_count, host->pio_words);
- 
- 			if (host->mrq->data)
- 				host->mrq->data->error = -EINVAL;
-@@ -622,6 +577,7 @@
- 
- 	spin_unlock_irqrestore(&host->complete_lock, iflags);
- 	return IRQ_HANDLED;
-+
- }
- 
- /*
-@@ -856,10 +812,11 @@
- 		/* We cannot deal with unaligned blocks with more than
- 		 * one block being transfered. */
- 
--		if (data->blocks > 1) {
--			pr_warning("%s: can't do non-word sized block transfers (blksz %d)\n", __func__, data->blksz);
-+		if (data->blocks > 1)
- 			return -EINVAL;
--		}
-+
-+		/* No support yet for non-word block transfers. */
-+		return -EINVAL;
- 	}
- 
- 	while (readl(host->base + S3C2410_SDIDSTA) &
-@@ -939,7 +896,7 @@
- 	BUG_ON((data->flags & BOTH_DIR) == BOTH_DIR);
- 
- 	host->pio_sgptr = 0;
--	host->pio_bytes = 0;
-+	host->pio_words = 0;
- 	host->pio_count = 0;
- 	host->pio_active = rw ? XFER_WRITE : XFER_READ;
- 
-@@ -1034,7 +991,6 @@
- 			dbg(host, dbg_err, "data prepare error %d\n", res);
- 			cmd->error = res;
- 			cmd->data->error = res;
--			cmd->data->error = -EIO;
- 
- 			mmc_request_done(mmc, mrq);
- 			return;
-@@ -1077,33 +1033,10 @@
- 		s3cmci_send_request(mmc);
- }
- 
--static void s3cmci_set_clk(struct s3cmci_host *host, struct mmc_ios *ios)
--{
--	u32 mci_psc;
--
--	/* Set clock */
--	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
--		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
--
--		if (host->real_rate <= ios->clock)
--			break;
--	}
--
--	if (mci_psc > 255)
--		mci_psc = 255;
--
--	host->prescaler = mci_psc;
--	writel(host->prescaler, host->base + S3C2410_SDIPRE);
--
--	/* If requested clock is 0, real_rate will be 0, too */
--	if (ios->clock == 0)
--		host->real_rate = 0;
--}
--
- static void s3cmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- {
- 	struct s3cmci_host *host = mmc_priv(mmc);
--	u32 mci_con;
-+	u32 mci_psc, mci_con;
- 
- 	/* Set the power state */
- 
-@@ -1141,7 +1074,23 @@
- 		break;
- 	}
- 
--	s3cmci_set_clk(host, ios);
-+	/* Set clock */
-+	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
-+		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
-+
-+		if (host->real_rate <= ios->clock)
-+			break;
-+	}
-+
-+	if (mci_psc > 255)
-+		mci_psc = 255;
-+
-+	host->prescaler = mci_psc;
-+	writel(host->prescaler, host->base + S3C2410_SDIPRE);
-+
-+	/* If requested clock is 0, real_rate will be 0, too */
-+	if (ios->clock == 0)
-+		host->real_rate = 0;
- 
- 	/* Set CLOCK_ENABLE */
- 	if (ios->clock)
-@@ -1199,61 +1148,6 @@
- 	 * checks. Any zero fields to ensure reaonable defaults are picked. */
- };
- 
--#ifdef CONFIG_CPU_FREQ
--
--static int s3cmci_cpufreq_transition(struct notifier_block *nb,
--				     unsigned long val, void *data)
--{
--	struct s3cmci_host *host;
--	struct mmc_host *mmc;
--	unsigned long newclk;
--	unsigned long flags;
--
--	host = container_of(nb, struct s3cmci_host, freq_transition);
--	newclk = clk_get_rate(host->clk);
--	mmc = host->mmc;
--
--	if ((val == CPUFREQ_PRECHANGE && newclk > host->clk_rate) ||
--	    (val == CPUFREQ_POSTCHANGE && newclk < host->clk_rate)) {
--		spin_lock_irqsave(&mmc->lock, flags);
--
--		host->clk_rate = newclk;
--
--		if (mmc->ios.power_mode != MMC_POWER_OFF &&
--		    mmc->ios.clock != 0)
--			s3cmci_set_clk(host, &mmc->ios);
--
--		spin_unlock_irqrestore(&mmc->lock, flags);
--	}
--
--	return 0;
--}
--
--static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
--{
--	host->freq_transition.notifier_call = s3cmci_cpufreq_transition;
--
--	return cpufreq_register_notifier(&host->freq_transition,
--					 CPUFREQ_TRANSITION_NOTIFIER);
--}
--
--static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
--{
--	cpufreq_unregister_notifier(&host->freq_transition,
--				    CPUFREQ_TRANSITION_NOTIFIER);
--}
--
--#else
--static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
--{
--	return 0;
--}
--
--static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
--{
--}
--#endif
--
- static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
- {
- 	struct s3cmci_host *host;
-@@ -1404,16 +1298,10 @@
- 	    (host->is2440?"2440":""),
- 	    host->base, host->irq, host->irq_cd, host->dma);
- 
--	ret = s3cmci_cpufreq_register(host);
--	if (ret) {
--		dev_err(&pdev->dev, "failed to register cpufreq\n");
--		goto free_dmabuf;
--	}
--
- 	ret = mmc_add_host(mmc);
- 	if (ret) {
- 		dev_err(&pdev->dev, "failed to add mmc host.\n");
--		goto free_cpufreq;
-+		goto free_dmabuf;
- 	}
- 
- 	platform_set_drvdata(pdev, mmc);
-@@ -1421,9 +1309,6 @@
- 
- 	return 0;
- 
-- free_cpufreq:
--	s3cmci_cpufreq_deregister(host);
--
-  free_dmabuf:
- 	clk_disable(host->clk);
- 
-@@ -1457,7 +1342,6 @@
- 	if (host->irq_cd >= 0)
- 		free_irq(host->irq_cd, host);
- 
--	s3cmci_cpufreq_deregister(host);
- 	mmc_remove_host(mmc);
- 	clk_disable(host->clk);
- }
-@@ -1571,8 +1455,7 @@
- 
- MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
- MODULE_LICENSE("GPL v2");
--MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>, Ben Dooks <ben-linux at fluff.org>");
-+MODULE_AUTHOR("Thomas Kleffel <tk at maintech.de>");
- MODULE_ALIAS("platform:s3c2410-sdi");
- MODULE_ALIAS("platform:s3c2412-sdi");
- MODULE_ALIAS("platform:s3c2440-sdi");
--
-Index: ktrack/drivers/mmc/host/s3cmci.h
-===================================================================
---- ktrack.orig/drivers/mmc/host/s3cmci.h	2008-10-30 21:33:18.000000000 -0200
-+++ ktrack/drivers/mmc/host/s3cmci.h	2008-10-30 21:33:29.000000000 -0200
-@@ -51,7 +51,7 @@
- 	int			dma_complete;
- 
- 	u32			pio_sgptr;
--	u32			pio_bytes;
-+	u32			pio_words;
- 	u32			pio_count;
- 	u32			*pio_ptr;
- #define XFER_NONE 0
-@@ -67,8 +67,4 @@
- 
- 	unsigned int		ccnt, dcnt;
- 	struct tasklet_struct	pio_tasklet;
--
--#ifdef CONFIG_CPU_FREQ
--	struct notifier_block	freq_transition;
--#endif
- };

Deleted: developers/werner/wlan-spi/patches-tracking/s3c-spi-fix-int-mode.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/s3c-spi-fix-int-mode.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/s3c-spi-fix-int-mode.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,63 +0,0 @@
-Work in progress. Makes spi_s3c24xx.c work for up to 12MHz.
-
-At speeds of 13MHz or higher, we have setup time issues. I.e., the
-SPI host sees the data coming from the device delayed by one bit,
-even though things look fine on the scope.
-
-This 12MHz/13MHz "barrier" exists with or without probes attached,
-suggesting capacitative loading plays only a minor role in this.
-
-Index: ktrack/drivers/spi/spi_s3c24xx.c
-===================================================================
---- ktrack.orig/drivers/spi/spi_s3c24xx.c	2008-10-10 10:52:14.000000000 -0200
-+++ ktrack/drivers/spi/spi_s3c24xx.c	2008-10-15 23:14:27.000000000 -0200
-@@ -199,6 +199,27 @@
- 
- 	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.
-+	 *
-+	 * 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);
-+		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;
- }
- 
-@@ -222,8 +243,19 @@
- 
- 	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 the byte preceding the first byte
-+	 * or the SPI engine gets upset.
-+	 */
-+	if (hw->rx) {
-+		u8 b = readb(hw->regs + S3C2410_SPRDAT);
-+
-+		if (count)
-+			hw->rx[count-1] = b;
-+	}
- 
- 	count++;
- 

Deleted: developers/werner/wlan-spi/patches-tracking/s3c-spi-from-int-to-poll.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/s3c-spi-from-int-to-poll.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/s3c-spi-from-int-to-poll.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,105 +0,0 @@
-Change the S3C SPI driver to use poll mode instead of interrupt mode.
-This reduces the gap between bytes from about 2.25us [1] to 100ns [2].
-
-[1] http://people.openmoko.org/werner/wlan-spi/spi-int.png
-[2] http://people.openmoko.org/werner/wlan-spi/spi-poll.png
-
-Index: ktrack/drivers/spi/spi_s3c24xx.c
-===================================================================
---- ktrack.orig/drivers/spi/spi_s3c24xx.c	2008-10-29 03:47:03.000000000 -0200
-+++ ktrack/drivers/spi/spi_s3c24xx.c	2008-10-29 03:47:04.000000000 -0200
-@@ -56,7 +56,7 @@
- 	struct s3c2410_spi_info *pdata;
- };
- 
--#define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_INT)
-+#define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_POLL)
- #define SPPIN_DEFAULT (S3C2410_SPPIN_KEEP)
- 
- static inline struct s3c24xx_spi *to_hw(struct spi_device *sdev)
-@@ -183,6 +183,7 @@
- static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
- {
- 	struct s3c24xx_spi *hw = to_hw(spi);
-+	int i;
- 
- 	dev_dbg(&spi->dev, "txrx: tx %p, rx %p, len %d\n",
- 		t->tx_buf, t->rx_buf, t->len);
-@@ -194,10 +195,19 @@
- 
- 	init_completion(&hw->done);
- 
--	/* send the first byte */
--	writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
-+	for (i = 0; i != t->len; i++) {
-+		u8 spsta;
- 
--	wait_for_completion(&hw->done);
-+		writeb(hw_txbyte(hw, i), hw->regs + S3C2410_SPTDAT);
-+		do spsta = readb(hw->regs + S3C2410_SPSTA);
-+		while (!(spsta & S3C2410_SPSTA_READY));
-+		if (hw->rx) {
-+			u8 b = readb(hw->regs + S3C2410_SPRDAT);
-+
-+			if (i)
-+				hw->rx[i-1] = b;
-+		}
-+	}
- 
- 	/*
- 	 * Get the last byte. Since we don't have more data we can send in
-@@ -207,9 +217,9 @@
- 	 * going on in the hardware. This is the voodoo ritual that makes it
- 	 * work while anything else fails.
- 	 */
--	if (hw->rx && hw->count) {
-+	if (hw->rx && i) {
- 		udelay(1+10*1000000/spi->max_speed_hz);
--		hw->rx[hw->count-1] = readb(hw->regs + S3C2410_SPRDAT);
-+		hw->rx[i-1] = readb(hw->regs + S3C2410_SPRDAT);
- 	}
- 
- 	if (0&&t->rx_buf && t->len > 18) {
-@@ -220,7 +230,7 @@
- 			printk(" %02x", ((u8 *) t->rx_buf)[i]);
- 		printk("\n");
- 	}
--	return hw->count;
-+	return t->len;
- }
- 
- static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
-@@ -355,6 +365,7 @@
- 		goto err_no_iomap;
- 	}
- 
-+#if 0
- 	hw->irq = platform_get_irq(pdev, 0);
- 	if (hw->irq < 0) {
- 		dev_err(&pdev->dev, "No IRQ specified\n");
-@@ -367,6 +378,7 @@
- 		dev_err(&pdev->dev, "Cannot claim IRQ\n");
- 		goto err_no_irq;
- 	}
-+#endif
- 
- 	hw->clk = clk_get(&pdev->dev, "spi");
- 	if (IS_ERR(hw->clk)) {
-@@ -402,7 +414,7 @@
- 	clk_put(hw->clk);
- 
-  err_no_clk:
--	free_irq(hw->irq, hw);
-+	//free_irq(hw->irq, hw);
- 
-  err_no_irq:
- 	iounmap(hw->regs);
-@@ -430,7 +442,7 @@
- 	clk_disable(hw->clk);
- 	clk_put(hw->clk);
- 
--	free_irq(hw->irq, hw);
-+	//free_irq(hw->irq, hw);
- 	iounmap(hw->regs);
- 
- 	release_resource(hw->ioarea);

Deleted: developers/werner/wlan-spi/patches-tracking/s3c24xx-cpufreq-driver-mmc.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/s3c24xx-cpufreq-driver-mmc.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/s3c24xx-cpufreq-driver-mmc.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,198 +0,0 @@
-Add support for CPU frequency scalling for the s3c_mci
-driver.
-
-Signed-off-by: Ben Dooks <ben-linux at fluff.org>
-
-Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
-===================================================================
---- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:40.000000000 +0100
-+++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
-@@ -13,6 +13,7 @@
- #include <linux/clk.h>
- #include <linux/mmc/host.h>
- #include <linux/platform_device.h>
-+#include <linux/cpufreq.h>
- #include <linux/irq.h>
- #include <linux/io.h>
- 
-@@ -1033,10 +1034,33 @@ static void s3cmci_request(struct mmc_ho
- 		s3cmci_send_request(mmc);
- }
- 
-+static void s3cmci_set_clk(struct s3cmci_host *host, struct mmc_ios *ios)
-+{
-+	u32 mci_psc;
-+
-+	/* Set clock */
-+	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
-+		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
-+
-+		if (host->real_rate <= ios->clock)
-+			break;
-+	}
-+
-+	if (mci_psc > 255)
-+		mci_psc = 255;
-+
-+	host->prescaler = mci_psc;
-+	writel(host->prescaler, host->base + S3C2410_SDIPRE);
-+
-+	/* If requested clock is 0, real_rate will be 0, too */
-+	if (ios->clock == 0)
-+		host->real_rate = 0;
-+}
-+
- static void s3cmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
- {
- 	struct s3cmci_host *host = mmc_priv(mmc);
--	u32 mci_psc, mci_con;
-+	u32 mci_con;
- 
- 	/* Set the power state */
- 
-@@ -1074,23 +1098,7 @@ static void s3cmci_set_ios(struct mmc_ho
- 		break;
- 	}
- 
--	/* Set clock */
--	for (mci_psc = 0; mci_psc < 255; mci_psc++) {
--		host->real_rate = host->clk_rate / (host->clk_div*(mci_psc+1));
--
--		if (host->real_rate <= ios->clock)
--			break;
--	}
--
--	if (mci_psc > 255)
--		mci_psc = 255;
--
--	host->prescaler = mci_psc;
--	writel(host->prescaler, host->base + S3C2410_SDIPRE);
--
--	/* If requested clock is 0, real_rate will be 0, too */
--	if (ios->clock == 0)
--		host->real_rate = 0;
-+	s3cmci_set_clk(host, ios);
- 
- 	/* Set CLOCK_ENABLE */
- 	if (ios->clock)
-@@ -1148,6 +1156,61 @@ static struct s3c24xx_mci_pdata s3cmci_d
- 	 * checks. Any zero fields to ensure reaonable defaults are picked. */
- };
- 
-+#ifdef CONFIG_CPU_FREQ
-+
-+static int s3cmci_cpufreq_transition(struct notifier_block *nb,
-+				     unsigned long val, void *data)
-+{
-+	struct s3cmci_host *host;
-+	struct mmc_host *mmc;
-+	unsigned long newclk;
-+	unsigned long flags;
-+
-+	host = container_of(nb, struct s3cmci_host, freq_transition);
-+	newclk = clk_get_rate(host->clk);
-+	mmc = host->mmc;
-+
-+	if ((val == CPUFREQ_PRECHANGE && host->clk_rate > newclk) ||
-+	    (val == CPUFREQ_POSTCHANGE && host->clk_rate < newclk)) {
-+		spin_lock_irqsave(&mmc->lock, flags);
-+
-+		host->clk_rate = newclk;
-+
-+		if (mmc->ios.power_mode != MMC_POWER_OFF &&
-+		    mmc->ios.clock != 0)
-+			s3cmci_set_clk(host, &mmc->ios);
-+
-+		spin_unlock_irqrestore(&mmc->lock, flags);
-+	}
-+
-+	return 0;
-+}
-+
-+static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
-+{
-+	host->freq_transition.notifier_call = s3cmci_cpufreq_transition;
-+
-+	return cpufreq_register_notifier(&host->freq_transition,
-+					 CPUFREQ_TRANSITION_NOTIFIER);
-+}
-+
-+static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
-+{
-+	cpufreq_unregister_notifier(&host->freq_transition,
-+				    CPUFREQ_TRANSITION_NOTIFIER);
-+}
-+
-+#else
-+static inline int s3cmci_cpufreq_register(struct s3cmci_host *host)
-+{
-+	return 0;
-+}
-+
-+static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
-+{
-+}
-+#endif
-+
- static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440)
- {
- 	struct s3cmci_host *host;
-@@ -1298,10 +1361,16 @@ static int __devinit s3cmci_probe(struct
- 	    (host->is2440?"2440":""),
- 	    host->base, host->irq, host->irq_cd, host->dma);
- 
-+	ret = s3cmci_cpufreq_register(host);
-+	if (ret) {
-+		dev_err(&pdev->dev, "failed to register cpufreq\n");
-+		goto free_dmabuf;
-+	}
-+
- 	ret = mmc_add_host(mmc);
- 	if (ret) {
- 		dev_err(&pdev->dev, "failed to add mmc host.\n");
--		goto free_dmabuf;
-+		goto free_cpufreq;
- 	}
- 
- 	platform_set_drvdata(pdev, mmc);
-@@ -1309,6 +1378,9 @@ static int __devinit s3cmci_probe(struct
- 
- 	return 0;
- 
-+ free_cpufreq:
-+	s3cmci_cpufreq_deregister(host);
-+
-  free_dmabuf:
- 	clk_disable(host->clk);
- 
-@@ -1342,6 +1414,7 @@ static void s3cmci_shutdown(struct platf
- 	if (host->irq_cd >= 0)
- 		free_irq(host->irq_cd, host);
- 
-+	s3cmci_cpufreq_deregister(host);
- 	mmc_remove_host(mmc);
- 	clk_disable(host->clk);
- }
-Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h
-===================================================================
---- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:40.000000000 +0100
-+++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.h	2008-09-26 18:38:51.000000000 +0100
-@@ -67,4 +67,8 @@ struct s3cmci_host {
- 
- 	unsigned int		ccnt, dcnt;
- 	struct tasklet_struct	pio_tasklet;
-+
-+#ifdef CONFIG_CPU_FREQ
-+	struct notifier_block	freq_transition;
-+#endif
- };
-
--- 
-Ben (ben at fluff.org, http://www.fluff.org/)
-
-  'a smiley only costs 4 bytes'
-
--------------------------------------------------------------------
-List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
-FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
-Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Deleted: developers/werner/wlan-spi/patches-tracking/s3c24xx-mmc-faster-transfer-core.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/s3c24xx-mmc-faster-transfer-core.patch	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/s3c24xx-mmc-faster-transfer-core.patch	2008-11-02 06:41:14 UTC (rev 4737)
@@ -1,82 +0,0 @@
-The s3cmci driver uses the host->pio_ptr field to
-point to the current position into the buffer for data
-transfer. During the transfers it does the following:
-
-	while (fifo_words--)
-		*(host->pio_ptr++) = readl(from_ptr);
-
-This is inefficent, as host->pio_ptr is not used in any
-other part of the transfer but the compiler emits code
-which does the following:
-
-	while (fifo_words--) {
-		u32 *ptr = host->pio_ptr;
-		*ptr = readl(from_ptr);
-		ptr++;
-		host->pio_ptr = ptr;
-	}
-
-This is obviously a waste of a load and store each time
-around the loop, which could be up to 16 times depending
-on how much needs to be transfered.
-
-Move the ptr accesses to outside the while loop so that
-we do not end up reloading/re-writing the pointer.
-
-Note, this seems to make the code 16 bytes larger.
-
-Signed-off-by: Ben Dooks <ben-linux at fluff.org>
-Index: linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c
-===================================================================
---- linux-2.6.27-rc7.orig/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:51.000000000 +0100
-+++ linux-2.6.27-rc7/drivers/mmc/host/s3cmci.c	2008-09-26 18:38:52.000000000 +0100
-@@ -238,6 +238,7 @@ static void do_pio_read(struct s3cmci_ho
- {
- 	int res;
- 	u32 fifo;
-+	u32 *ptr;
- 	u32 fifo_words;
- 	void __iomem *from_ptr;
- 
-@@ -283,8 +284,10 @@ static void do_pio_read(struct s3cmci_ho
- 		host->pio_count += fifo;
- 
- 		fifo_words = fifo >> 2;
-+		ptr = host->pio_ptr;
- 		while (fifo_words--)
--			*(host->pio_ptr++) = readl(from_ptr);
-+			*ptr++ = readl(from_ptr);
-+		host->pio_ptr = ptr;
- 
- 		if (fifo & 3) {
- 			u32 n = fifo & 3;
-@@ -319,6 +322,7 @@ static void do_pio_write(struct s3cmci_h
- 	void __iomem *to_ptr;
- 	int res;
- 	u32 fifo;
-+	u32 *ptr;
- 
- 	to_ptr = host->base + host->sdidata;
- 
-@@ -353,8 +357,10 @@ static void do_pio_write(struct s3cmci_h
- 		host->pio_count += fifo;
- 
- 		fifo = (fifo + 3) >> 2;
-+		ptr = host->pio_ptr;
- 		while (fifo--)
--			writel(*(host->pio_ptr++), to_ptr);
-+			writel(*ptr++, to_ptr);
-+		host->pio_ptr = ptr;
- 	}
- 
- 	enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
-
--- 
-Ben (ben at fluff.org, http://www.fluff.org/)
-
-  'a smiley only costs 4 bytes'
-
--------------------------------------------------------------------
-List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
-FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
-Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

Modified: developers/werner/wlan-spi/patches-tracking/series
===================================================================
--- developers/werner/wlan-spi/patches-tracking/series	2008-10-31 01:27:17 UTC (rev 4736)
+++ developers/werner/wlan-spi/patches-tracking/series	2008-11-02 06:41:14 UTC (rev 4737)
@@ -15,30 +15,13 @@
 # rm -rf drivers/sdio
 #
 
-hack-disable-ecc.patch
-hack-mmc-spi-coexistence.patch
 ar6k-without-sdio.patch
 gta02-remove-sdio.patch
 hif-linux-sdio.patch
 gta02-mmc-spi-bitbang.patch
-gta02-mmc-spi.patch
-s3c-spi-fix-int-mode.patch 
-s3c-spi-from-int-to-poll.patch
 
-# broken in recent stable-tracking
-
 gta02-mmc-mci.patch
 
-# to find out how to unbreak mmc-mci, we revert the recent changes to s3cmci
-# and then apply them one by one, looking for the culprit.
-
-#hack-revert-s3cmci.patch
-#s3c24xx-cpufreq-driver-mmc.patch
-#christer-mmc-byte-alignment.patch
-fix-mmc-busy-loop-on-bytes.patch
-#s3c24xx-mmc-faster-transfer-core.patch
-#drivers-s3c24xx-mmc-add-us-to-copyright-header.patch
-
 # dirty experimental stuff follows
 
 # didn't survive the move to 2.6.27 :-(




More information about the commitlog mailing list