--- Begin Message ---
Author: werner
Date: 2008-11-02 14:03:00 +0100 (Sun, 02 Nov 2008)
New Revision: 4740
Added:
developers/werner/wlan-spi/patches-tracking/sdio-add-atheros-ar6k.patch
Modified:
developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
developers/werner/wlan-spi/patches-tracking/series
Log:
More cleanup. Make the ar6k driver work as a module.
sdio-add-atheros-ar6k.patch:
- moved Atheros and AR6k SDIO IDs to include/linux/mmc/sdio_ids.h
drivers/ar6000/hif/hif2.c:
- explain why we can't make the io thread TASK_UNINTERRUPTIBLE
- upon removal, wait for the request queue to drain
- replaced global static hif_device with dynamic allocation
- removed redefinition of dev_dbg
- oops, ar6000_drv.c already has module_init and module_exit. Restructured
initialization sequence accordingly.
- print "HIFInit" only as KERN_DEBUG, not KERN_INFO
Modified: developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
2008-11-02 09:46:58 UTC (rev 4739)
+++ developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
2008-11-02 13:03:00 UTC (rev 4740)
@@ -11,8 +11,8 @@
Index: ktrack/drivers/ar6000/Makefile
===================================================================
---- ktrack.orig/drivers/ar6000/Makefile 2008-11-02 05:48:42.000000000
-0200
-+++ ktrack/drivers/ar6000/Makefile 2008-11-02 05:48:44.000000000 -0200
+--- ktrack.orig/drivers/ar6000/Makefile 2008-11-02 08:01:22.000000000
-0200
++++ ktrack/drivers/ar6000/Makefile 2008-11-02 08:04:17.000000000 -0200
@@ -21,7 +21,7 @@
htc/htc_recv.o \
htc/htc_services.o \
@@ -25,8 +25,8 @@
Index: ktrack/drivers/ar6000/hif/hif2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ ktrack/drivers/ar6000/hif/hif2.c 2008-11-02 07:44:12.000000000 -0200
-@@ -0,0 +1,569 @@
++++ ktrack/drivers/ar6000/hif/hif2.c 2008-11-02 11:01:12.000000000 -0200
+@@ -0,0 +1,592 @@
+/*
+ * hif2.c - HIF layer re-implementation for the Linux SDIO stack
+ *
@@ -52,6 +52,7 @@
+#include <linux/spinlock.h>
+#include <linux/mmc/sdio_func.h>
+#include <linux/mmc/sdio.h>
++#include <linux/mmc/sdio_ids.h>
+#include <asm/gpio.h>
+
+#include "athdefs.h"
@@ -98,9 +99,6 @@
+ */
+
+
-+//#define dev_dbg dev_info
-+#define dev_dbg(dev, ...) ((void) dev)
-+
+#define MBOXES 4
+
+#define HIF_MBOX_BLOCK_SIZE 128
@@ -139,7 +137,6 @@
+};
+
+
-+static HIF_DEVICE hif_device;
+static HTC_CALLBACKS htcCallbacks;
+
+
@@ -196,6 +193,23 @@
+}
+
+
++static void wait_queue_empty(struct hif_device *hif)
++{
++ unsigned long flags;
++ int empty;
++
++ while (1) {
++ spin_lock_irqsave(&hif->queue_lock, flags);
++ empty = list_empty(&hif->queue);
++ spin_unlock_irqrestore(&hif->queue_lock, flags);
++ if (empty)
++ break;
++ else
++ yield();
++ }
++}
++
++
+static int io(void *data)
+{
+ struct hif_device *hif = data;
@@ -204,6 +218,12 @@
+
+ while (1) {
+ while (1) {
++ /*
++ * Since we never use signals here, one might think
++ * that this ought to be TASK_UNINTERRUPTIBLE. However,
++ * such a task would increase the load average and,
++ * worse, it would trigger the softlockup check.
++ */
+ prepare_to_wait(&hif->wait, &wait, TASK_INTERRUPTIBLE);
+ if (kthread_should_stop()) {
+ finish_wait(&hif->wait, &wait);
@@ -406,20 +426,9 @@
+}
+
+
-+/* ----- Device initialization and shutdown (HIF side) ---------------------
*/
++/* ----- Device configuration (HIF side) -----------------------------------
*/
+
+
-+int HIFInit(HTC_CALLBACKS *callbacks)
-+{
-+ BUG_ON(!callbacks);
-+
-+ printk(KERN_INFO "HIFInit\n");
-+ htcCallbacks = *callbacks;
-+
-+ return 0;
-+}
-+
-+
+A_STATUS HIFConfigureDevice(HIF_DEVICE *hif,
+ HIF_DEVICE_CONFIG_OPCODE opcode, void *config, A_UINT32 configLen)
+{
@@ -450,34 +459,31 @@
+}
+
+
-+void HIFShutDownDevice(HIF_DEVICE *hif)
-+{
-+ struct device *dev = HIFGetOSDevice(hif);
++/* ----- Device probe and removal (Linux side) -----------------------------
*/
+
-+ dev_dbg(dev, "HIFShutDownDevice\n");
-+}
+
-+
-+/* ----- Device setup and removal (Linux side) -----------------------------
*/
-+
-+
+static int sdio_ar6000_probe(struct sdio_func *func,
+ const struct sdio_device_id *id)
+{
+ struct device *dev = &func->dev;
++ struct hif_device *hif;
+ int ret;
+
+ dev_dbg(dev, "sdio_ar6000_probe\n");
+ BUG_ON(!htcCallbacks.deviceInsertedHandler);
+
-+ sdio_set_drvdata(func, &hif_device);
++ hif = kzalloc(sizeof(*hif), GFP_KERNEL);
++ if (!hif)
++ return -ENOMEM;
++
++ sdio_set_drvdata(func, hif);
+ sdio_claim_host(func);
+ sdio_enable_func(func);
+
-+ hif_device.func = func;
-+ INIT_LIST_HEAD(&hif_device.queue);
-+ init_waitqueue_head(&hif_device.wait);
-+ spin_lock_init(&hif_device.queue_lock);
++ hif->func = func;
++ INIT_LIST_HEAD(&hif->queue);
++ init_waitqueue_head(&hif->wait);
++ spin_lock_init(&hif->queue_lock);
+
+ ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE);
+ if (ret < 0) {
@@ -501,19 +507,19 @@
+
+ sdio_release_host(func);
+
-+ hif_device.io_task = kthread_run(io, &hif_device, "ar6000_io");
-+ if (IS_ERR(hif_device.io_task)) {
++ hif->io_task = kthread_run(io, hif, "ar6000_io");
++ if (IS_ERR(hif->io_task)) {
+ dev_err(dev, "kthread_run(ar6000_io): %d\n", ret);
+ goto out_func_ready;
+ }
+
-+ ret = htcCallbacks.deviceInsertedHandler(&hif_device);
++ ret = htcCallbacks.deviceInsertedHandler(hif);
+ if (ret == A_OK)
+ return 0;
+
+ dev_err(dev, "deviceInsertedHandler: %d\n", ret);
+
-+ ret = kthread_stop(hif_device.io_task);
++ ret = kthread_stop(hif->io_task);
+ if (ret)
+ dev_err(dev, "kthread_stop (ar6000_io): %d\n", ret);
+
@@ -536,23 +542,28 @@
+static void sdio_ar6000_remove(struct sdio_func *func)
+{
+ struct device *dev = &func->dev;
++ HIF_DEVICE *hif = sdio_get_drvdata(func);
+ int ret;
+
-+ ret = kthread_stop(hif_device.io_task);
++ ret = htcCallbacks.deviceRemovedHandler(hif->htc_handle, A_OK);
++ if (ret != A_OK)
++ dev_err(dev, "deviceRemovedHandler: %d\n", ret);
++ wait_queue_empty(hif);
++ ret = kthread_stop(hif->io_task);
+ if (ret)
+ dev_err(dev, "kthread_stop (ar6000_io): %d\n", ret);
+ sdio_claim_host(func);
+ sdio_release_irq(func);
++ sdio_set_drvdata(func, NULL);
+ sdio_disable_func(func);
+ sdio_release_host(func);
-+ /* @@@ remove */
++ kfree(hif);
+}
+
+
-+/* @@@ move these definitions to linux/mmc/sdio_ids.h */
-+#define SDIO_VENDOR_ID_ATHEROS 0x271
-+#define SDIO_DEVICE_ID_ATHEROS_AR6000 0x100
++/* ----- Device registration/unregistration (called by HIF) ----------------
*/
+
++
+#define ATHEROS_SDIO_DEVICE(id, offset) \
+ SDIO_DEVICE(SDIO_VENDOR_ID_ATHEROS, SDIO_DEVICE_ID_ATHEROS_##id |
(offset))
+
@@ -577,22 +588,34 @@
+};
+
+
-+static int __devinit sdio_ar6000_init(void)
++int HIFInit(HTC_CALLBACKS *callbacks)
+{
-+ printk(KERN_INFO "sdio_ar6000_init\n");
-+ return sdio_register_driver(&sdio_ar6000_driver);
++ int ret;
++
++ BUG_ON(!callbacks);
++
++ printk(KERN_DEBUG "HIFInit\n");
++ htcCallbacks = *callbacks;
++
++ ret = sdio_register_driver(&sdio_ar6000_driver);
++ if (ret) {
++ printk(KERN_ERR
++ "sdio_register_driver(sdio_ar6000_driver): %d\n", ret);
++ return A_ERROR;
++ }
++
++ return 0;
+}
+
+
-+static void __exit sdio_ar6000_exit(void)
++void HIFShutDownDevice(HIF_DEVICE *hif)
+{
-+ printk(KERN_INFO "sdio_ar6000_exit\n");
++ struct device *dev = HIFGetOSDevice(hif);
++
++ dev_dbg(dev, "HIFShutDownDevice\n");
+ sdio_unregister_driver(&sdio_ar6000_driver);
+}
+
+
-+module_init(sdio_ar6000_init);
-+module_exit(sdio_ar6000_exit);
-+
+MODULE_AUTHOR("Werner Almesberger");
+MODULE_LICENSE("GPL v2");
Added: developers/werner/wlan-spi/patches-tracking/sdio-add-atheros-ar6k.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/sdio-add-atheros-ar6k.patch
(rev 0)
+++ developers/werner/wlan-spi/patches-tracking/sdio-add-atheros-ar6k.patch
2008-11-02 13:03:00 UTC (rev 4740)
@@ -0,0 +1,12 @@
+Index: ktrack/include/linux/mmc/sdio_ids.h
+===================================================================
+--- ktrack.orig/include/linux/mmc/sdio_ids.h 2008-11-02 08:02:38.000000000
-0200
++++ ktrack/include/linux/mmc/sdio_ids.h 2008-11-02 08:02:55.000000000
-0200
+@@ -25,5 +25,7 @@
+
+ #define SDIO_VENDOR_ID_MARVELL 0x02df
+ #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103
++#define SDIO_VENDOR_ID_ATHEROS 0x0271
++#define SDIO_DEVICE_ID_ATHEROS_AR6000 0x0100
+
+ #endif
Modified: developers/werner/wlan-spi/patches-tracking/series
===================================================================
--- developers/werner/wlan-spi/patches-tracking/series 2008-11-02 09:46:58 UTC
(rev 4739)
+++ developers/werner/wlan-spi/patches-tracking/series 2008-11-02 13:03:00 UTC
(rev 4740)
@@ -17,6 +17,7 @@
ar6k-without-sdio.patch
gta02-remove-sdio.patch
+sdio-add-atheros-ar6k.patch
hif-linux-sdio.patch
gta02-mmc-spi-bitbang.patch
@@ -31,3 +32,4 @@
# still needs a bit more love ...
#s3c-mmc-sdio-int.patch
+#ecc
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-11-02 22:41:59 +0100 (Sun, 02 Nov 2008)
New Revision: 4743
Added:
developers/werner/wlan-perf/
developers/werner/wlan-perf/measure
developers/werner/wlan-perf/report
Log:
Tools to measure WLAN performance:
- measure: runs ttcp and ping between a Neo and a host (in both directions)
and records the results in files named _*
- report: pretty-prints the measurement data
Added: developers/werner/wlan-perf/measure
===================================================================
--- developers/werner/wlan-perf/measure (rev 0)
+++ developers/werner/wlan-perf/measure 2008-11-02 21:41:59 UTC (rev 4743)
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+N=10
+P=100
+
+
+host=192.168.1.2
+
+
+# ----- ttcp measurements -----------------------------------------------------
+
+
+ttcp_rx_one()
+{
+ neo ./ttcp -r -s 2>&1 | tee -a _rx_neo &
+ sleep 2
+ ttcp -t -s $neo 2>&1 | tee -a _rx_host
+ sleep 2
+}
+
+
+ttcp_tx_one()
+{
+ ttcp -r -s 2>&1 | tee -a _tx_host &
+ sleep 1
+ neo ./ttcp -t -s $host 2>&1 | tee -a _tx_neo
+ sleep 2
+}
+
+
+ttcp_loop()
+{
+ i=0
+ while [ $i -lt $N ]; do
+ i=`expr $i + 1`
+ echo ===== $i: "$@" =====
+ $@
+ done
+}
+
+
+ttcp_rx()
+{
+ ttcp_loop ttcp_rx_one
+}
+
+
+ttcp_tx()
+{
+ ttcp_loop ttcp_tx_one
+}
+
+
+# ----- ping measurements -----------------------------------------------------
+
+
+ping_rx()
+{
+ ping -c $P $neo | tee _ping_rx
+}
+
+
+ping_tx()
+{
+ neo ping -c $P $host | tee _ping_tx
+}
+
+
+# ----- setup -----------------------------------------------------------------
+
+
+neo=`neo ip address show dev eth0 | sed 's|.*inet \([^ ]*\)/.*|\1|p;d'`
+echo $neo
+
+neo killall ttcp ping
+killall ttcp ping
+
+rm -f _*
+
+ttcp_rx
+ttcp_tx
+ping_rx
+ping_tx
Property changes on: developers/werner/wlan-perf/measure
___________________________________________________________________
Name: svn:executable
+ *
Added: developers/werner/wlan-perf/report
===================================================================
--- developers/werner/wlan-perf/report (rev 0)
+++ developers/werner/wlan-perf/report 2008-11-02 21:41:59 UTC (rev 4743)
@@ -0,0 +1,115 @@
+#!/usr/bin/perl
+
+
+sub extract_ttcp()
+{
+ local ($name, *bytes, *time, *csw) = @_;
+
+ open(F, $name) || die "$name: $!";
+ while (<F>) {
+ if (/ (\d+) bytes in (\S+) real seconds/) {
+ push(@bytes, $1);
+ push(@time, $2);
+ }
+ if (/ (\d+)\+(\d+)csw/) {
+ push(@csw, $1+$2);
+ }
+ }
+ close F;
+}
+
+
+sub ttcp_format()
+{
+ local ($rate, $csw) = @_;
+
+ return sprintf("%8.2f %7d", $rate/1000, $csw);
+}
+
+
+sub ttcp_set()
+{
+ local (*bytes, *time, *csw, $i) = @_;
+
+ $bytes += $bytes[$i];
+ $time += $time[$i];
+ $csw += $csw[$i];
+ return &ttcp_format($bytes[$i]/$time[$i], $csw[$i]);
+}
+
+
+sub report_ttcp()
+{
+ local ($label_tx, $label_rx, $tx, $rx) = @_;
+ local (@tx_bytes, @tx_time, @tx_csw);
+ local (@rx_bytes, @rx_time, @rx_csw);
+ local ($tx_bytes, $tx_time, $tx_csw);
+ local ($rx_bytes, $rx_time, $rx_csw);
+ local ($gap) = " " x 4;
+
+ print "---- ",
+ $label_tx, " ", "-" x (15-length $label_tx), $gap,
+ $label_rx, " ", "-" x (15-length $label_rx), "\n";
+ print " " x 5,
+ sprintf("%-8s %-7s", "kB/s", "ctx_sw"), $gap,
+ sprintf("%-8s %-7s", "kB/s", "ctx_sw"), "\n";
+
+ &extract_ttcp($tx, *tx_bytes, *tx_time, *tx_csw);
+ &extract_ttcp($rx, *rx_bytes, *rx_time, *rx_csw);
+ for ($i = 0; $i != @tx_bytes; $i++) {
+ print sprintf("%3d: ", $i+1),
+ &ttcp_set(*tx_bytes, *tx_time, *tx_csw, $i), $gap,
+ &ttcp_set(*rx_bytes, *rx_time, *rx_csw, $i), "\n";
+ }
+ print "AVG: ",
+ &ttcp_format($tx_bytes/$tx_time, $tx_csw/@tx_bytes), $gap,
+ &ttcp_format($rx_bytes/$rx_time, $rx_csw/@tx_bytes), "\n";
+ print "\n";
+}
+
+
+sub extract_ping()
+{
+ local ($name) = @_;
+ local (@time);
+
+ open(F, $name) || die "$name: $!";
+ while (<F>) {
+ if (/ time=(\S+) ms/) {
+ push(@time, $1);
+ }
+ }
+ close F;
+ return @time;
+}
+
+
+sub report_ping()
+{
+ local ($title, $name) = @_;
+ local (@time);
+ local ($min, $max, $sum, $sq_sum, $avg);
+
+ @time = &extract_ping($name);
+ for (@time) {
+ $min = $_ if $_ < $min || !defined $min;
+ $max = $_ if $_ > $max || !defined $max;
+ $sum += $_;
+ $sq_sum += $_*$_;
+ }
+ $avg = $sum/@time;
+ print $title, ": ",
+ sprintf("%-7s/%-7s/%-7s %-7s", "min", "avg", "max", "stddev"),
+ sprintf(" (%d samples)", $#time+1), "\n";
+ print " " x length($title), " ",
+ sprintf("%7.2f", $min), "/",
+ sprintf("%7.2f", $avg), "/",
+ sprintf("%7.2f", $max), " ",
+ sprintf("%7.2f", sqrt($sq_sum/@time-$avg*$avg)), " ms\n";
+}
+
+
+&report_ttcp("host =>", "=> neo", "_rx_host", "_rx_neo");
+&report_ttcp("neo =>", "=> host", "_tx_neo", "_tx_host");
+&report_ping("host => neo", "_ping_rx");
+&report_ping("neo => host", "_ping_tx");
Property changes on: developers/werner/wlan-perf/report
___________________________________________________________________
Name: svn:executable
+ *
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-11-03 02:48:41 +0100 (Mon, 03 Nov 2008)
New Revision: 4744
Added:
developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi-bitbang.patch
developers/werner/wlan-spi/patches-tracking/attic/hack-dont-poll-irq.patch
developers/werner/wlan-spi/patches-tracking/attic/hif-direct-interrupt.patch
Removed:
developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch
developers/werner/wlan-spi/patches-tracking/hack-dont-poll-irq.patch
developers/werner/wlan-spi/patches-tracking/hif-direct-interrupt.patch
Modified:
developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch
developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
developers/werner/wlan-spi/patches-tracking/series
Log:
More cleanup and a little priority boost for the io task.
- moved hif-direct-interrupt.patch and hack-dont-poll-irq.patch to the attic as
well
- gta02-mmc-spi-bitbang.patch, last of the SPI drivers, to the attic
- gta02-mmc-mci.patch: since S3C MCI is now the only SDIO low-level driver, we
don't have to be able to select it by configuration
- arch/arm/mach-s3c2440/mach-gta02.c: remove obsolete gta02_mmc_cfg, remove the
experimental registration of s3c_device_sdi, and re-enable s3c_device_sdi in
the list of platform devices
- drivers/ar6000/hif/hif2.c: boost priority of io task to one level below
ksdioirqd
Copied:
developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi-bitbang.patch
(from rev 4737,
developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch)
===================================================================
---
developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi-bitbang.patch
(rev 0)
+++
developers/werner/wlan-spi/patches-tracking/attic/gta02-mmc-spi-bitbang.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -0,0 +1,151 @@
+gta02-mmc-spio-bitbang.patch
+
+This patch adds the platform definitions for using the AR6000 driver
+with MMC-SPI and the S3C SPI GPIO (bit-banging) driver.
+
+This configuration should work with all GTA02 models. No rework
+required.
+
+Note that this patch disables the acceleration sensors, because they
+also use the SPI GPIO driver. This needs a bit more integration.
+
+Not-Yet-Signed-off-by: Werner Almesberger <[EMAIL PROTECTED]>
+
+Index: ktrack/arch/arm/mach-s3c2440/Kconfig
+===================================================================
+--- 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.
+
++# @@@ Not a great place for this, but still better than dragging platform
++# details into driver land.
++
++choice
++ prompt "AR6K interface"
++ default AR6K_SPI_S3C24XX_GPIO
++ depends on MACH_NEO1973_GTA02 && AR6000_WLAN
++
++ config AR6K_SPI_S3C24XX_GPIO
++ bool "GPIO bit-banging SPI"
++ select MMC_SPI
++ select SPI_S3C24XX_GPIO
++endchoice
++
+ endmenu
+
+ #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-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>
+ #include <linux/spi/spi_bitbang.h>
++#include <linux/spi/mmc_spi.h>
+ #include <linux/mmc/host.h>
+
+ #include <linux/mtd/mtd.h>
+@@ -1238,6 +1239,87 @@
+ },
+ };
+
++
++/* ----- AR6000 WLAN interface ---------------------------------------------
*/
++
++
++/* shared by all SPI drivers */
++
++#if defined(CONFIG_AR6K_SPI_S3C24XX_GPIO)
++
++static struct spi_board_info gta02_spi_mmc_bdinfo[] = {
++ {
++ .modalias = "mmc_spi",
++ .irq = IRQ_EINT3, /* unused ? */
++ .max_speed_hz = 12 * 1000 * 1000,
++ .bus_num = 0,
++ .chip_select = 0,
++ .mode = SPI_MODE_0,
++ }
++};
++
++#endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
++
++
++#ifdef CONFIG_AR6K_SPI_S3C24XX_GPIO
++
++static void spi_wlan_cs(struct s3c2410_spigpio_info *spigpio_info,
++ int csid, int cs)
++{
++ switch (cs) {
++ case BITBANG_CS_ACTIVE:
++ s3c2410_gpio_setpin(S3C2410_GPE10, 0);
++ break;
++ case BITBANG_CS_INACTIVE:
++ s3c2410_gpio_setpin(S3C2410_GPE10, 1);
++ break;
++ }
++}
++
++static struct s3c2410_spigpio_info spi_gpio_wlan_cfg = {
++ .pin_clk = S3C2410_GPE5,
++ .pin_mosi = S3C2410_GPE6,
++ .pin_miso = S3C2410_GPE7,
++ .board_size = ARRAY_SIZE(gta02_spi_mmc_bdinfo),
++ .board_info = gta02_spi_mmc_bdinfo,
++ .chip_select = &spi_wlan_cs,
++ .num_chipselect = 1,
++};
++
++static struct resource gta02_spi_wlan_resource[] = {
++ [0] = {
++ .start = S3C2410_GPE5,
++ .end = S3C2410_GPE5,
++ },
++ [1] = {
++ .start = S3C2410_GPE6,
++ .end = S3C2410_GPE6,
++ },
++ [2] = {
++ .start = S3C2410_GPE7,
++ .end = S3C2410_GPE7,
++ },
++ [3] = {
++ .start = S3C2410_GPE10,
++ .end = S3C2410_GPE10,
++ },
++};
++
++static struct platform_device gta02_spi_wlan = {
++ .name = "spi_s3c24xx_gpio",
++ .id = 1,
++ .num_resources = ARRAY_SIZE(gta02_spi_wlan_resource),
++ .resource = gta02_spi_wlan_resource,
++ .dev = {
++ .platform_data = &spi_gpio_wlan_cfg,
++ },
++};
++
++#endif /* CONFIG_AR6K_SPI_S3C2410_GPIO */
++
++
++/* -------------------------------------------------------------------------
*/
++
+ static struct resource gta02_led_resources[] = {
+ {
+ .name = "gta02-power:orange",
+@@ -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);
++ platform_device_register(>a02_spi_wlan);
++#endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
++
+ platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
+
+ s3c2410_pm_init();
Copied:
developers/werner/wlan-spi/patches-tracking/attic/hack-dont-poll-irq.patch
(from rev 4716,
developers/werner/wlan-spi/patches-tracking/hack-dont-poll-irq.patch)
===================================================================
--- developers/werner/wlan-spi/patches-tracking/attic/hack-dont-poll-irq.patch
(rev 0)
+++ developers/werner/wlan-spi/patches-tracking/attic/hack-dont-poll-irq.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -0,0 +1,33 @@
+The interrupt polling interferes with monitoring of the SDIO transactions.
+Disable it when debugging.
+
+Index: ktrack/drivers/mmc/core/sdio_irq.c
+===================================================================
+--- ktrack.orig/drivers/mmc/core/sdio_irq.c 2008-10-10 10:52:06.000000000
-0200
++++ ktrack/drivers/mmc/core/sdio_irq.c 2008-10-16 01:15:05.000000000 -0200
+@@ -70,7 +70,7 @@
+ unsigned long period, idle_period;
+ int ret;
+
+- sched_setscheduler(current, SCHED_FIFO, ¶m);
++// sched_setscheduler(current, SCHED_FIFO, ¶m);
+
+ /*
+ * We want to allow for SDIO cards to work even on non SDIO
+@@ -102,7 +102,7 @@
+ ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
+ if (ret)
+ break;
+- ret = process_sdio_pending_irqs(host->card);
++// ret = process_sdio_pending_irqs(host->card);
+ mmc_release_host(host);
+
+ /*
+@@ -128,6 +128,7 @@
+ }
+ }
+
++yield();
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (host->caps & MMC_CAP_SDIO_IRQ)
+ host->ops->enable_sdio_irq(host, 1);
Copied:
developers/werner/wlan-spi/patches-tracking/attic/hif-direct-interrupt.patch
(from rev 4733,
developers/werner/wlan-spi/patches-tracking/hif-direct-interrupt.patch)
===================================================================
---
developers/werner/wlan-spi/patches-tracking/attic/hif-direct-interrupt.patch
(rev 0)
+++
developers/werner/wlan-spi/patches-tracking/attic/hif-direct-interrupt.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -0,0 +1,259 @@
+Proof-of-concept hack to directly use the interrupt coming from the card.
+
+The performance improvement isn't quite what I expected, only a meager
+4-5%, but perhaps more can be gained if we find a way to strip off some
+of the execution contexts. Right now, interrupts go through a workqueue,
+the AR6k driver, then the SDIO stack gets called from a kernel thread,
+and spi_bitbang uses a workqueue as well. It's almost surprising that we
+still get something done at all with those context switches.
+
+Index: ktrack/drivers/ar6000/hif/hif2.c
+===================================================================
+--- ktrack.orig/drivers/ar6000/hif/hif2.c 2008-10-29 23:48:33.000000000
-0200
++++ ktrack/drivers/ar6000/hif/hif2.c 2008-10-29 23:50:44.000000000 -0200
+@@ -21,9 +21,13 @@
+ #include <linux/list.h>
+ #include <linux/wait.h>
+ #include <linux/spinlock.h>
++#include <linux/irq.h>
++#include <linux/workqueue.h>
+ #include <linux/mmc/sdio_func.h>
+ #include <linux/mmc/sdio.h>
++
+ #include <asm/gpio.h>
++#include <mach/regs-gpio.h>
+
+ #include "athdefs.h"
+ #include "a_types.h"
+@@ -59,6 +63,9 @@
+ void *htc_handle;
+ struct sdio_func *func;
+
++ int irq;
++ struct work_struct work;
++
+ /*
+ * @@@ our sweet little bit of bogosity - the mechanism that lets us
+ * use the SDIO stack from softirqs. This really wants to use skbs.
+@@ -99,6 +106,18 @@
+ }
+
+
++/*
++ * @@@ The slave select games below don't quite work, I think because SPI sets
++ * it to inactive _after_ telling its caller that the operation is complete
++ * (which it is, after all).
++ *
++ * Doing this properly will be a bit of fun, I suppose, because the SPI stack
++ * doesn't have the concept of briefly disabling slave select right before a
++ * transmission.
++ *
++ * For some yet unexplained reason, hacking the SPI driver isn't enough, and
we
++ * need to force SS low with the s3c2410_gpio_setpin here.
++ */
+ static A_STATUS process_request(struct hif_request *req)
+ {
+ int ret;
+@@ -106,10 +125,12 @@
+
+ dev_dbg(&req->func->dev, "process_request(req %p)\n", req);
+ sdio_claim_host(req->func);
++ //s3c2410_gpio_setpin(S3C2410_GPG2, 1); /* raise SS */
+ if (req->read)
+ ret = req->read(req->func, req->buf, req->addr, req->len);
+ else
+ ret = req->write(req->func, req->addr, req->buf, req->len);
++ s3c2410_gpio_setpin(S3C2410_GPG2, 0); /* lower SS to allow interrupts */
+ sdio_release_host(req->func);
+ status = ret ? A_ERROR : A_OK;
+ if (req->completion)
+@@ -278,7 +299,7 @@
+
+ /* =========================================================================
*/
+
+-#if 1
++#ifndef CONFIG_AR6000_GTA02_DIRECT_IRQ
+
+ /*
+ * Volatile ought to be good enough to make gcc do the right thing on S3C24xx.
+@@ -386,78 +407,76 @@
+ yield();
+ }
+
+-#endif
++#endif /* !CONFIG_AR6000_GTA02_DIRECT_IRQ */
+
+ /* =========================================================================
*/
+
+ /*
+ * The code below is for handling interrupts signalled out-of-band.
+ */
+-#if 0
+-#define IRQ_GPIO S3C2410_GPE8 /* SDDAT1 */
+
++#ifdef CONFIG_AR6000_GTA02_DIRECT_IRQ
+
+-static atomic_t mask = ATOMIC_INIT(1);
+
+-
+-static void sdio_ar6000_irq(struct sdio_func *func)
++static void sdio_ar6000_work(struct work_struct *work)
+ {
+- HIF_DEVICE *hif = sdio_get_drvdata(func);
++ HIF_DEVICE *hif = container_of(work, struct hif_device, work);
++ struct device *dev = HIFGetOSDevice(hif);
++ A_STATUS status;
+
+- printk(KERN_DEBUG "sdio_ar6000_irq -> %p\n", htcCallbacks.dsrHandler);
+- BUG();
++ dev_dbg(dev, "sdio_ar6000_work-> %p\n", htcCallbacks.dsrHandler);
++
++ /* absorb the usual initial stray interrupt */
++ if (!hif->htc_handle) {
++ HIFAckInterrupt(hif);
++ return;
++ }
++ status = htcCallbacks.dsrHandler(hif->htc_handle);
++ BUG_ON(status != A_OK);
+ }
+
+
+-static void sdio_ar6000_poll(void *context)
++static irqreturn_t sdio_ar6000_irq(int irq, void *arg)
+ {
+- HIF_DEVICE *hif = context;
+- A_STATUS status;
++ HIF_DEVICE *hif = arg;
++ struct device *dev = HIFGetOSDevice(hif);
+
+- while (1) {
+- yield();
+- if (!gpio_get_value(IRQ_GPIO))
+- continue;
+- if (!atomic_add_unless(&mask, 1, 1))
+- continue;
+- status = htcCallbacks.dsrHandler(hif->htc_handle);
+- BUG_ON(status != A_OK);
+- }
++ dev_dbg(dev, "sdio_ar6000_irq\n");
++ disable_irq(hif->irq);
++ if (!schedule_work(&hif->work))
++ dev_err(dev, "work already queued");
++ return IRQ_HANDLED;
+ }
+
+
+ void HIFAckInterrupt(HIF_DEVICE *hif)
+ {
+ struct device *dev = HIFGetOSDevice(hif);
+- int ret;
+
+- ret = atomic_dec_return(&mask);
+- BUG_ON(ret < 0);
+- dev_dbg(dev, "HIFAckInterrupt (%d)\n", ret);
++ dev_dbg(dev, "HIFAckInterrupt)\n");
++ enable_irq(hif->irq);
+ }
+
+
+ void HIFUnMaskInterrupt(HIF_DEVICE *hif)
+ {
+ struct device *dev = HIFGetOSDevice(hif);
+- int ret;
+
+- ret = atomic_dec_return(&mask);
+- BUG_ON(ret < 0);
+- dev_dbg(dev, "HIFUnMaskInterrupt (%d)\n", ret);
++ dev_dbg(dev, "HIFUnMaskInterrupt)\n");
++ enable_irq(hif->irq);
+ }
+
+
+ void HIFMaskInterrupt(HIF_DEVICE *hif)
+ {
+ struct device *dev = HIFGetOSDevice(hif);
+- int ret;
+
+- ret = atomic_inc_return(&mask);
+- BUG_ON(ret > 1);
+- dev_dbg(dev, "HIFMaskInterrupt (%d)\n", ret);
++ dev_dbg(dev, "HIFMaskInterrupt\n");
++ disable_irq(hif->irq);
+ }
+-#endif
++
++#endif /* CONFIG_AR6000_GTA02_DIRECT_IRQ */
++
+
+ /* =========================================================================
*/
+
+@@ -521,11 +540,32 @@
+ dev_err(dev, "sdio_set_block_size returns %d\n", ret);
+ /* @@@ cleanup */
+ }
++
++#ifndef CONFIG_AR6000_GTA02_DIRECT_IRQ
+ ret = sdio_claim_irq(func, sdio_ar6000_irq);
+ if (ret) {
+ dev_err(dev, "sdio_claim_irq returns %d\n", ret);
+ /* @@@ cleanup */
+ }
++#else /* !CONFIG_AR6000_GTA02_DIRECT_IRQ */
++ hif_device.irq = IRQ_EINT3;
++ INIT_WORK(&hif_device.work, sdio_ar6000_work);
++ ret = request_irq(hif_device.irq, sdio_ar6000_irq,
++ IRQF_TRIGGER_LOW, "ar6000", &hif_device);
++ if (ret) {
++ dev_err(dev, "request_irq returns %d\n", ret);
++ /* @@@ cleanup */
++ }
++ /* driver wants to be in charge of enabling the interrupt */
++ disable_irq(hif_device.irq);
++ sdio_f0_writeb(func, 3, SDIO_CCCR_IENx, &ret);
++ if (ret) {
++ dev_err(dev, "sdio_f0_writeb(SDIO_CCCR_IENx) returns %d\n",
++ ret);
++ /* @@@ cleanup */
++ }
++#endif /* CONFIG_AR6000_GTA02_DIRECT_IRQ */
++
+ /* Set SDIO_BUS_CD_DISABLE in SDIO_CCCR_IF ? */
+ #if 0
+ sdio_f0_writeb(func, SDIO_CCCR_CAP_E4MI, SDIO_CCCR_CAPS, &ret);
+Index: ktrack/drivers/spi/spi_bitbang.c
+===================================================================
+--- ktrack.orig/drivers/spi/spi_bitbang.c 2008-10-29 23:48:33.000000000
-0200
++++ ktrack/drivers/spi/spi_bitbang.c 2008-10-29 23:49:18.000000000 -0200
+@@ -323,6 +323,9 @@
+ * selected ...)
+ */
+ if (cs_change) {
++ /* @@@ AR6k SPI hack */
++ bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
++ ndelay(nsecs);
+ bitbang->chipselect(spi, BITBANG_CS_ACTIVE);
+ ndelay(nsecs);
+ }
+@@ -382,7 +385,8 @@
+ * cs_change has hinted that the next message will probably
+ * be for this chip too.
+ */
+- if (!(status == 0 && cs_change)) {
++ /* @@@ AR6k SPI hack */
++ if (0&&!(status == 0 && cs_change)) {
+ ndelay(nsecs);
+ bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
+ ndelay(nsecs);
+Index: ktrack/drivers/ar6000/Kconfig
+===================================================================
+--- ktrack.orig/drivers/ar6000/Kconfig 2008-10-29 23:48:33.000000000 -0200
++++ ktrack/drivers/ar6000/Kconfig 2008-10-29 23:49:18.000000000 -0200
+@@ -5,3 +5,8 @@
+ default m
+ help
+ good luck.
++
++config AR6000_GTA02_DIRECT_IRQ
++ bool "Hack: use direct interrupt on GTA02"
++ depends on AR6000_WLAN && !AR6K_S3CMCI
++ default n
Modified: developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch
2008-11-02 21:41:59 UTC (rev 4743)
+++ developers/werner/wlan-spi/patches-tracking/gta02-mmc-mci.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -1,34 +1,46 @@
Use S3C SDI on GTA02.
-Index: ktrack/arch/arm/mach-s3c2440/Kconfig
-===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/Kconfig 2008-11-02 11:04:06.000000000
-0200
-+++ ktrack/arch/arm/mach-s3c2440/Kconfig 2008-11-02 11:04:06.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
-+
- endchoice
-
- endmenu
Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
===================================================================
---- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c 2008-11-02
11:04:06.000000000 -0200
-+++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c 2008-11-02 11:04:06.000000000
-0200
-@@ -1720,6 +1720,11 @@
- platform_device_register(>a02_spi_wlan);
- #endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
+--- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c 2008-11-02
22:49:21.000000000 -0200
++++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c 2008-11-02 22:53:59.000000000
-0200
+@@ -902,12 +902,6 @@
+ .software_ecc = 1,
+ };
-+#ifdef CONFIG_AR6K_S3CMCI
-+ s3c_device_sdi.dev.platform_data = NULL;
-+ platform_device_register(&s3c_device_sdi); /* @@@ just for testing */
-+#endif /* CONFIG_AR6K_S3CMCI */
-+
- platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
+-static struct s3c24xx_mci_pdata gta02_mmc_cfg = {
+- .gpio_detect = GTA02v1_GPIO_nSD_DETECT,
+- .set_power = NULL,
+- .ocr_avail = MMC_VDD_32_33,
+-};
+-
+ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
+ {
+ printk(KERN_DEBUG "%s(%d)\n", __func__, cmd);
+@@ -1529,7 +1523,7 @@
+ &s3c_device_usb,
+ &s3c_device_wdt,
+ >a02_memconfig_device,
+- // &s3c_device_sdi, /* FIXME: temporary disable to avoid s3cmci bind */
++ &s3c_device_sdi,
+ &s3c_device_usbgadget,
+ &s3c_device_nand,
+ >a02_nor_flash,
+@@ -1607,17 +1601,6 @@
- s3c2410_pm_init();
+ s3c_device_usb.dev.platform_data = >a02_usb_info;
+ s3c_device_nand.dev.platform_data = >a02_nand_info;
+- s3c_device_sdi.dev.platform_data = >a02_mmc_cfg;
+-
+- /* Only GTA02v1 has a SD_DETECT GPIO. Since the slot is not
+- * hot-pluggable, this is not required anyway */
+- switch (system_rev) {
+- case GTA02v1_SYSTEM_REV:
+- break;
+- default:
+- gta02_mmc_cfg.gpio_detect = 0;
+- break;
+- }
+
+ /* acc sensor chip selects */
+ s3c2410_gpio_setpin(S3C2410_GPD12, 1);
Deleted: developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch
2008-11-02 21:41:59 UTC (rev 4743)
+++ developers/werner/wlan-spi/patches-tracking/gta02-mmc-spi-bitbang.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -1,151 +0,0 @@
-gta02-mmc-spio-bitbang.patch
-
-This patch adds the platform definitions for using the AR6000 driver
-with MMC-SPI and the S3C SPI GPIO (bit-banging) driver.
-
-This configuration should work with all GTA02 models. No rework
-required.
-
-Note that this patch disables the acceleration sensors, because they
-also use the SPI GPIO driver. This needs a bit more integration.
-
-Not-Yet-Signed-off-by: Werner Almesberger <[EMAIL PROTECTED]>
-
-Index: ktrack/arch/arm/mach-s3c2440/Kconfig
-===================================================================
---- 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.
-
-+# @@@ Not a great place for this, but still better than dragging platform
-+# details into driver land.
-+
-+choice
-+ prompt "AR6K interface"
-+ default AR6K_SPI_S3C24XX_GPIO
-+ depends on MACH_NEO1973_GTA02 && AR6000_WLAN
-+
-+ config AR6K_SPI_S3C24XX_GPIO
-+ bool "GPIO bit-banging SPI"
-+ select MMC_SPI
-+ select SPI_S3C24XX_GPIO
-+endchoice
-+
- endmenu
-
- #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-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>
- #include <linux/spi/spi_bitbang.h>
-+#include <linux/spi/mmc_spi.h>
- #include <linux/mmc/host.h>
-
- #include <linux/mtd/mtd.h>
-@@ -1238,6 +1239,87 @@
- },
- };
-
-+
-+/* ----- AR6000 WLAN interface ---------------------------------------------
*/
-+
-+
-+/* shared by all SPI drivers */
-+
-+#if defined(CONFIG_AR6K_SPI_S3C24XX_GPIO)
-+
-+static struct spi_board_info gta02_spi_mmc_bdinfo[] = {
-+ {
-+ .modalias = "mmc_spi",
-+ .irq = IRQ_EINT3, /* unused ? */
-+ .max_speed_hz = 12 * 1000 * 1000,
-+ .bus_num = 0,
-+ .chip_select = 0,
-+ .mode = SPI_MODE_0,
-+ }
-+};
-+
-+#endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
-+
-+
-+#ifdef CONFIG_AR6K_SPI_S3C24XX_GPIO
-+
-+static void spi_wlan_cs(struct s3c2410_spigpio_info *spigpio_info,
-+ int csid, int cs)
-+{
-+ switch (cs) {
-+ case BITBANG_CS_ACTIVE:
-+ s3c2410_gpio_setpin(S3C2410_GPE10, 0);
-+ break;
-+ case BITBANG_CS_INACTIVE:
-+ s3c2410_gpio_setpin(S3C2410_GPE10, 1);
-+ break;
-+ }
-+}
-+
-+static struct s3c2410_spigpio_info spi_gpio_wlan_cfg = {
-+ .pin_clk = S3C2410_GPE5,
-+ .pin_mosi = S3C2410_GPE6,
-+ .pin_miso = S3C2410_GPE7,
-+ .board_size = ARRAY_SIZE(gta02_spi_mmc_bdinfo),
-+ .board_info = gta02_spi_mmc_bdinfo,
-+ .chip_select = &spi_wlan_cs,
-+ .num_chipselect = 1,
-+};
-+
-+static struct resource gta02_spi_wlan_resource[] = {
-+ [0] = {
-+ .start = S3C2410_GPE5,
-+ .end = S3C2410_GPE5,
-+ },
-+ [1] = {
-+ .start = S3C2410_GPE6,
-+ .end = S3C2410_GPE6,
-+ },
-+ [2] = {
-+ .start = S3C2410_GPE7,
-+ .end = S3C2410_GPE7,
-+ },
-+ [3] = {
-+ .start = S3C2410_GPE10,
-+ .end = S3C2410_GPE10,
-+ },
-+};
-+
-+static struct platform_device gta02_spi_wlan = {
-+ .name = "spi_s3c24xx_gpio",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(gta02_spi_wlan_resource),
-+ .resource = gta02_spi_wlan_resource,
-+ .dev = {
-+ .platform_data = &spi_gpio_wlan_cfg,
-+ },
-+};
-+
-+#endif /* CONFIG_AR6K_SPI_S3C2410_GPIO */
-+
-+
-+/* -------------------------------------------------------------------------
*/
-+
- static struct resource gta02_led_resources[] = {
- {
- .name = "gta02-power:orange",
-@@ -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);
-+ platform_device_register(>a02_spi_wlan);
-+#endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
-+
- platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
-
- s3c2410_pm_init();
Deleted: developers/werner/wlan-spi/patches-tracking/hack-dont-poll-irq.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hack-dont-poll-irq.patch
2008-11-02 21:41:59 UTC (rev 4743)
+++ developers/werner/wlan-spi/patches-tracking/hack-dont-poll-irq.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -1,33 +0,0 @@
-The interrupt polling interferes with monitoring of the SDIO transactions.
-Disable it when debugging.
-
-Index: ktrack/drivers/mmc/core/sdio_irq.c
-===================================================================
---- ktrack.orig/drivers/mmc/core/sdio_irq.c 2008-10-10 10:52:06.000000000
-0200
-+++ ktrack/drivers/mmc/core/sdio_irq.c 2008-10-16 01:15:05.000000000 -0200
-@@ -70,7 +70,7 @@
- unsigned long period, idle_period;
- int ret;
-
-- sched_setscheduler(current, SCHED_FIFO, ¶m);
-+// sched_setscheduler(current, SCHED_FIFO, ¶m);
-
- /*
- * We want to allow for SDIO cards to work even on non SDIO
-@@ -102,7 +102,7 @@
- ret = __mmc_claim_host(host, &host->sdio_irq_thread_abort);
- if (ret)
- break;
-- ret = process_sdio_pending_irqs(host->card);
-+// ret = process_sdio_pending_irqs(host->card);
- mmc_release_host(host);
-
- /*
-@@ -128,6 +128,7 @@
- }
- }
-
-+yield();
- set_current_state(TASK_INTERRUPTIBLE);
- if (host->caps & MMC_CAP_SDIO_IRQ)
- host->ops->enable_sdio_irq(host, 1);
Deleted: developers/werner/wlan-spi/patches-tracking/hif-direct-interrupt.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hif-direct-interrupt.patch
2008-11-02 21:41:59 UTC (rev 4743)
+++ developers/werner/wlan-spi/patches-tracking/hif-direct-interrupt.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -1,259 +0,0 @@
-Proof-of-concept hack to directly use the interrupt coming from the card.
-
-The performance improvement isn't quite what I expected, only a meager
-4-5%, but perhaps more can be gained if we find a way to strip off some
-of the execution contexts. Right now, interrupts go through a workqueue,
-the AR6k driver, then the SDIO stack gets called from a kernel thread,
-and spi_bitbang uses a workqueue as well. It's almost surprising that we
-still get something done at all with those context switches.
-
-Index: ktrack/drivers/ar6000/hif/hif2.c
-===================================================================
---- ktrack.orig/drivers/ar6000/hif/hif2.c 2008-10-29 23:48:33.000000000
-0200
-+++ ktrack/drivers/ar6000/hif/hif2.c 2008-10-29 23:50:44.000000000 -0200
-@@ -21,9 +21,13 @@
- #include <linux/list.h>
- #include <linux/wait.h>
- #include <linux/spinlock.h>
-+#include <linux/irq.h>
-+#include <linux/workqueue.h>
- #include <linux/mmc/sdio_func.h>
- #include <linux/mmc/sdio.h>
-+
- #include <asm/gpio.h>
-+#include <mach/regs-gpio.h>
-
- #include "athdefs.h"
- #include "a_types.h"
-@@ -59,6 +63,9 @@
- void *htc_handle;
- struct sdio_func *func;
-
-+ int irq;
-+ struct work_struct work;
-+
- /*
- * @@@ our sweet little bit of bogosity - the mechanism that lets us
- * use the SDIO stack from softirqs. This really wants to use skbs.
-@@ -99,6 +106,18 @@
- }
-
-
-+/*
-+ * @@@ The slave select games below don't quite work, I think because SPI sets
-+ * it to inactive _after_ telling its caller that the operation is complete
-+ * (which it is, after all).
-+ *
-+ * Doing this properly will be a bit of fun, I suppose, because the SPI stack
-+ * doesn't have the concept of briefly disabling slave select right before a
-+ * transmission.
-+ *
-+ * For some yet unexplained reason, hacking the SPI driver isn't enough, and
we
-+ * need to force SS low with the s3c2410_gpio_setpin here.
-+ */
- static A_STATUS process_request(struct hif_request *req)
- {
- int ret;
-@@ -106,10 +125,12 @@
-
- dev_dbg(&req->func->dev, "process_request(req %p)\n", req);
- sdio_claim_host(req->func);
-+ //s3c2410_gpio_setpin(S3C2410_GPG2, 1); /* raise SS */
- if (req->read)
- ret = req->read(req->func, req->buf, req->addr, req->len);
- else
- ret = req->write(req->func, req->addr, req->buf, req->len);
-+ s3c2410_gpio_setpin(S3C2410_GPG2, 0); /* lower SS to allow interrupts */
- sdio_release_host(req->func);
- status = ret ? A_ERROR : A_OK;
- if (req->completion)
-@@ -278,7 +299,7 @@
-
- /* =========================================================================
*/
-
--#if 1
-+#ifndef CONFIG_AR6000_GTA02_DIRECT_IRQ
-
- /*
- * Volatile ought to be good enough to make gcc do the right thing on S3C24xx.
-@@ -386,78 +407,76 @@
- yield();
- }
-
--#endif
-+#endif /* !CONFIG_AR6000_GTA02_DIRECT_IRQ */
-
- /* =========================================================================
*/
-
- /*
- * The code below is for handling interrupts signalled out-of-band.
- */
--#if 0
--#define IRQ_GPIO S3C2410_GPE8 /* SDDAT1 */
-
-+#ifdef CONFIG_AR6000_GTA02_DIRECT_IRQ
-
--static atomic_t mask = ATOMIC_INIT(1);
-
--
--static void sdio_ar6000_irq(struct sdio_func *func)
-+static void sdio_ar6000_work(struct work_struct *work)
- {
-- HIF_DEVICE *hif = sdio_get_drvdata(func);
-+ HIF_DEVICE *hif = container_of(work, struct hif_device, work);
-+ struct device *dev = HIFGetOSDevice(hif);
-+ A_STATUS status;
-
-- printk(KERN_DEBUG "sdio_ar6000_irq -> %p\n", htcCallbacks.dsrHandler);
-- BUG();
-+ dev_dbg(dev, "sdio_ar6000_work-> %p\n", htcCallbacks.dsrHandler);
-+
-+ /* absorb the usual initial stray interrupt */
-+ if (!hif->htc_handle) {
-+ HIFAckInterrupt(hif);
-+ return;
-+ }
-+ status = htcCallbacks.dsrHandler(hif->htc_handle);
-+ BUG_ON(status != A_OK);
- }
-
-
--static void sdio_ar6000_poll(void *context)
-+static irqreturn_t sdio_ar6000_irq(int irq, void *arg)
- {
-- HIF_DEVICE *hif = context;
-- A_STATUS status;
-+ HIF_DEVICE *hif = arg;
-+ struct device *dev = HIFGetOSDevice(hif);
-
-- while (1) {
-- yield();
-- if (!gpio_get_value(IRQ_GPIO))
-- continue;
-- if (!atomic_add_unless(&mask, 1, 1))
-- continue;
-- status = htcCallbacks.dsrHandler(hif->htc_handle);
-- BUG_ON(status != A_OK);
-- }
-+ dev_dbg(dev, "sdio_ar6000_irq\n");
-+ disable_irq(hif->irq);
-+ if (!schedule_work(&hif->work))
-+ dev_err(dev, "work already queued");
-+ return IRQ_HANDLED;
- }
-
-
- void HIFAckInterrupt(HIF_DEVICE *hif)
- {
- struct device *dev = HIFGetOSDevice(hif);
-- int ret;
-
-- ret = atomic_dec_return(&mask);
-- BUG_ON(ret < 0);
-- dev_dbg(dev, "HIFAckInterrupt (%d)\n", ret);
-+ dev_dbg(dev, "HIFAckInterrupt)\n");
-+ enable_irq(hif->irq);
- }
-
-
- void HIFUnMaskInterrupt(HIF_DEVICE *hif)
- {
- struct device *dev = HIFGetOSDevice(hif);
-- int ret;
-
-- ret = atomic_dec_return(&mask);
-- BUG_ON(ret < 0);
-- dev_dbg(dev, "HIFUnMaskInterrupt (%d)\n", ret);
-+ dev_dbg(dev, "HIFUnMaskInterrupt)\n");
-+ enable_irq(hif->irq);
- }
-
-
- void HIFMaskInterrupt(HIF_DEVICE *hif)
- {
- struct device *dev = HIFGetOSDevice(hif);
-- int ret;
-
-- ret = atomic_inc_return(&mask);
-- BUG_ON(ret > 1);
-- dev_dbg(dev, "HIFMaskInterrupt (%d)\n", ret);
-+ dev_dbg(dev, "HIFMaskInterrupt\n");
-+ disable_irq(hif->irq);
- }
--#endif
-+
-+#endif /* CONFIG_AR6000_GTA02_DIRECT_IRQ */
-+
-
- /* =========================================================================
*/
-
-@@ -521,11 +540,32 @@
- dev_err(dev, "sdio_set_block_size returns %d\n", ret);
- /* @@@ cleanup */
- }
-+
-+#ifndef CONFIG_AR6000_GTA02_DIRECT_IRQ
- ret = sdio_claim_irq(func, sdio_ar6000_irq);
- if (ret) {
- dev_err(dev, "sdio_claim_irq returns %d\n", ret);
- /* @@@ cleanup */
- }
-+#else /* !CONFIG_AR6000_GTA02_DIRECT_IRQ */
-+ hif_device.irq = IRQ_EINT3;
-+ INIT_WORK(&hif_device.work, sdio_ar6000_work);
-+ ret = request_irq(hif_device.irq, sdio_ar6000_irq,
-+ IRQF_TRIGGER_LOW, "ar6000", &hif_device);
-+ if (ret) {
-+ dev_err(dev, "request_irq returns %d\n", ret);
-+ /* @@@ cleanup */
-+ }
-+ /* driver wants to be in charge of enabling the interrupt */
-+ disable_irq(hif_device.irq);
-+ sdio_f0_writeb(func, 3, SDIO_CCCR_IENx, &ret);
-+ if (ret) {
-+ dev_err(dev, "sdio_f0_writeb(SDIO_CCCR_IENx) returns %d\n",
-+ ret);
-+ /* @@@ cleanup */
-+ }
-+#endif /* CONFIG_AR6000_GTA02_DIRECT_IRQ */
-+
- /* Set SDIO_BUS_CD_DISABLE in SDIO_CCCR_IF ? */
- #if 0
- sdio_f0_writeb(func, SDIO_CCCR_CAP_E4MI, SDIO_CCCR_CAPS, &ret);
-Index: ktrack/drivers/spi/spi_bitbang.c
-===================================================================
---- ktrack.orig/drivers/spi/spi_bitbang.c 2008-10-29 23:48:33.000000000
-0200
-+++ ktrack/drivers/spi/spi_bitbang.c 2008-10-29 23:49:18.000000000 -0200
-@@ -323,6 +323,9 @@
- * selected ...)
- */
- if (cs_change) {
-+ /* @@@ AR6k SPI hack */
-+ bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
-+ ndelay(nsecs);
- bitbang->chipselect(spi, BITBANG_CS_ACTIVE);
- ndelay(nsecs);
- }
-@@ -382,7 +385,8 @@
- * cs_change has hinted that the next message will probably
- * be for this chip too.
- */
-- if (!(status == 0 && cs_change)) {
-+ /* @@@ AR6k SPI hack */
-+ if (0&&!(status == 0 && cs_change)) {
- ndelay(nsecs);
- bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
- ndelay(nsecs);
-Index: ktrack/drivers/ar6000/Kconfig
-===================================================================
---- ktrack.orig/drivers/ar6000/Kconfig 2008-10-29 23:48:33.000000000 -0200
-+++ ktrack/drivers/ar6000/Kconfig 2008-10-29 23:49:18.000000000 -0200
-@@ -5,3 +5,8 @@
- default m
- help
- good luck.
-+
-+config AR6000_GTA02_DIRECT_IRQ
-+ bool "Hack: use direct interrupt on GTA02"
-+ depends on AR6000_WLAN && !AR6K_S3CMCI
-+ default n
Modified: developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
2008-11-02 21:41:59 UTC (rev 4743)
+++ developers/werner/wlan-spi/patches-tracking/hif-linux-sdio.patch
2008-11-03 01:48:41 UTC (rev 4744)
@@ -11,8 +11,8 @@
Index: ktrack/drivers/ar6000/Makefile
===================================================================
---- ktrack.orig/drivers/ar6000/Makefile 2008-11-02 08:01:22.000000000
-0200
-+++ ktrack/drivers/ar6000/Makefile 2008-11-02 08:04:17.000000000 -0200
+--- ktrack.orig/drivers/ar6000/Makefile 2008-11-02 23:09:13.000000000
-0200
++++ ktrack/drivers/ar6000/Makefile 2008-11-02 23:09:15.000000000 -0200
@@ -21,7 +21,7 @@
htc/htc_recv.o \
htc/htc_services.o \
@@ -25,8 +25,8 @@
Index: ktrack/drivers/ar6000/hif/hif2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ ktrack/drivers/ar6000/hif/hif2.c 2008-11-02 12:01:30.000000000 -0200
-@@ -0,0 +1,593 @@
++++ ktrack/drivers/ar6000/hif/hif2.c 2008-11-02 23:46:53.000000000 -0200
+@@ -0,0 +1,598 @@
+/*
+ * hif2.c - HIF layer re-implementation for the Linux SDIO stack
+ *
@@ -50,6 +50,7 @@
+#include <linux/list.h>
+#include <linux/wait.h>
+#include <linux/spinlock.h>
++#include <linux/sched.h>
+#include <linux/mmc/sdio_func.h>
+#include <linux/mmc/sdio.h>
+#include <linux/mmc/sdio_ids.h>
@@ -213,9 +214,13 @@
+static int io(void *data)
+{
+ struct hif_device *hif = data;
++ struct sched_param param = { .sched_priority = 2 };
++ /* one priority level slower than ksdioirqd (which is at 1) */
+ DEFINE_WAIT(wait);
+ struct hif_request *req;
+
++ sched_setscheduler(current, SCHED_FIFO, ¶m);
++
+ while (1) {
+ while (1) {
+ /*
Modified: developers/werner/wlan-spi/patches-tracking/series
===================================================================
--- developers/werner/wlan-spi/patches-tracking/series 2008-11-02 21:41:59 UTC
(rev 4743)
+++ developers/werner/wlan-spi/patches-tracking/series 2008-11-03 01:48:41 UTC
(rev 4744)
@@ -19,15 +19,11 @@
gta02-remove-sdio.patch
sdio-add-atheros-ar6k.patch
hif-linux-sdio.patch
-gta02-mmc-spi-bitbang.patch
gta02-mmc-mci.patch
# dirty experimental stuff follows
-# didn't survive the move to 2.6.27 :-(
-#hack-dont-poll-irq.patch
-#hif-direct-interrupt.patch
#hif-can-do-async.patch
# still needs a bit more love ...
--- End Message ---