r4636 - developers/werner/wlan-spi/patches
werner at docs.openmoko.org
werner at docs.openmoko.org
Mon Sep 8 13:18:24 CEST 2008
Author: werner
Date: 2008-09-08 13:18:24 +0200 (Mon, 08 Sep 2008)
New Revision: 4636
Added:
developers/werner/wlan-spi/patches/gta02-mmc-spi.patch
developers/werner/wlan-spi/patches/s3c-spi-api-update.patch
Modified:
developers/werner/wlan-spi/patches/gta02-mmc-spi-bitbang.patch
developers/werner/wlan-spi/patches/series
Log:
On-going work on supporting MMC-SPI also with the S3C SPI driver.
Modified: developers/werner/wlan-spi/patches/gta02-mmc-spi-bitbang.patch
===================================================================
--- developers/werner/wlan-spi/patches/gta02-mmc-spi-bitbang.patch 2008-09-08 10:22:54 UTC (rev 4635)
+++ developers/werner/wlan-spi/patches/gta02-mmc-spi-bitbang.patch 2008-09-08 11:18:24 UTC (rev 4636)
@@ -14,7 +14,7 @@
Index: korig/arch/arm/mach-s3c2440/Kconfig
===================================================================
--- korig.orig/arch/arm/mach-s3c2440/Kconfig 2008-09-04 05:07:56.000000000 -0300
-+++ korig/arch/arm/mach-s3c2440/Kconfig 2008-09-04 05:08:00.000000000 -0300
++++ korig/arch/arm/mach-s3c2440/Kconfig 2008-09-04 06:10:26.000000000 -0300
@@ -98,6 +98,20 @@
Say Y here if you are using an early hardware revision
of the FIC/Openmoko Neo1973 GTA02 GSM Phone.
@@ -39,7 +39,7 @@
Index: korig/arch/arm/mach-s3c2440/mach-gta02.c
===================================================================
--- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c 2008-09-04 05:08:00.000000000 -0300
-+++ korig/arch/arm/mach-s3c2440/mach-gta02.c 2008-09-04 05:09:03.000000000 -0300
++++ korig/arch/arm/mach-s3c2440/mach-gta02.c 2008-09-04 06:13:44.000000000 -0300
@@ -37,6 +37,7 @@
#include <linux/spi/spi.h>
#include <linux/spi/glamo.h>
@@ -63,7 +63,7 @@
+static struct spi_board_info gta02_spi_mmc_bdinfo = {
+ .modalias = "mmc_spi",
+ .irq = IRQ_EINT3, /* unused ? */
-+ .max_speed_hz = 1 * 1000 * 1000,
++ .max_speed_hz = 25 * 1000 * 1000,
+ .bus_num = 0,
+ .chip_select = 0,
+ .mode = SPI_MODE_0,
Added: developers/werner/wlan-spi/patches/gta02-mmc-spi.patch
===================================================================
--- developers/werner/wlan-spi/patches/gta02-mmc-spi.patch (rev 0)
+++ developers/werner/wlan-spi/patches/gta02-mmc-spi.patch 2008-09-08 11:18:24 UTC (rev 4636)
@@ -0,0 +1,98 @@
+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: korig/arch/arm/mach-s3c2440/Kconfig
+===================================================================
+--- korig.orig/arch/arm/mach-s3c2440/Kconfig 2008-09-04 11:31:41.000000000 -0300
++++ korig/arch/arm/mach-s3c2440/Kconfig 2008-09-04 11:31:44.000000000 -0300
+@@ -110,6 +110,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: korig/arch/arm/mach-s3c2440/mach-gta02.c
+===================================================================
+--- korig.orig/arch/arm/mach-s3c2440/mach-gta02.c 2008-09-04 11:31:41.000000000 -0300
++++ korig/arch/arm/mach-s3c2440/mach-gta02.c 2008-09-04 11:58:15.000000000 -0300
+@@ -1234,9 +1234,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 = {
+ .modalias = "mmc_spi",
+@@ -1247,7 +1245,18 @@
+ .mode = SPI_MODE_0,
+ };
+
+-#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,
++ .board_size = 1,
++ .board_info = >a02_spi_mmc_bdinfo,
++};
++
++#endif /* CONFIG_AR6K_SPI_S3C24XX */
+
+
+ #ifdef CONFIG_AR6K_SPI_S3C24XX_GPIO
+@@ -1689,6 +1698,30 @@
+ platform_device_register(>a02_spi_wlan);
+ #endif /* CONFIG_AR6K_SPI_S3C24XX_GPIO */
+
++#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 */
++
++ s3c_device_spi0.dev.platform_data = &spi_wlan_cfg,
++ platform_device_register(&s3c_device_spi0);
++
++#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); /* SS */
++
++#endif /* !CONFIG_AR6K_SPI_S3C24XX */
++
+ // platform_device_register(&s3c_device_spi_acc);
+ platform_device_register(>a02_button_dev);
+ platform_device_register(>a02_pm_gsm_dev);
Added: developers/werner/wlan-spi/patches/s3c-spi-api-update.patch
===================================================================
--- developers/werner/wlan-spi/patches/s3c-spi-api-update.patch (rev 0)
+++ developers/werner/wlan-spi/patches/s3c-spi-api-update.patch 2008-09-08 11:18:24 UTC (rev 4636)
@@ -0,0 +1,21 @@
+The S3C SPI driver in 2.6.24 lags behind on some changes in the driver
+API. This patch backports these changes.
+
+Not-Yet-Signed-off-by: Werner Almesberger <werner at openmoko.org>
+
+Index: korig/drivers/spi/spi_s3c24xx.c
+===================================================================
+--- korig.orig/drivers/spi/spi_s3c24xx.c 2008-09-04 17:32:37.000000000 -0300
++++ korig/drivers/spi/spi_s3c24xx.c 2008-09-04 17:33:06.000000000 -0300
+@@ -273,6 +273,11 @@
+ hw->bitbang.txrx_bufs = s3c24xx_spi_txrx;
+ hw->bitbang.master->setup = s3c24xx_spi_setup;
+
++ /* backported from 2.6.27, but without all the other small stack
++ changes */
++ master->num_chipselect = 1; /* hw->pdata->num_cs; */
++ master->bus_num = 0; /* hw->pdata->bus_num; */
++
+ dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);
+
+ /* find and map our resources */
Modified: developers/werner/wlan-spi/patches/series
===================================================================
--- developers/werner/wlan-spi/patches/series 2008-09-08 10:22:54 UTC (rev 4635)
+++ developers/werner/wlan-spi/patches/series 2008-09-08 11:18:24 UTC (rev 4636)
@@ -17,4 +17,6 @@
sdio-f0-unrestrict.patch
gta02-remove-sdio.patch
gta02-mmc-spi-bitbang.patch
+gta02-mmc-spi.patch
+s3c-spi-api-update.patch
config-ar6k-mmc-spi-bitbang.patch
More information about the commitlog
mailing list