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 Index: korig/arch/arm/mach-s3c2440/Kconfig =================================================================== --- korig.orig/arch/arm/mach-s3c2440/Kconfig 2008-09-27 11:04:05.000000000 -0300 +++ korig/arch/arm/mach-s3c2440/Kconfig 2008-09-27 11:04:05.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-27 11:04:05.000000000 -0300 +++ korig/arch/arm/mach-s3c2440/mach-gta02.c 2008-09-27 21:31:57.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,45 @@ 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 */ + + /* 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_device_register(&s3c_device_spi_acc); platform_device_register(>a02_button_dev); platform_device_register(>a02_pm_gsm_dev);