summaryrefslogtreecommitdiffstats
path: root/master/tpl3040-sdcard-spi
diff options
context:
space:
mode:
Diffstat (limited to 'master/tpl3040-sdcard-spi')
-rw-r--r--master/tpl3040-sdcard-spi119
1 files changed, 119 insertions, 0 deletions
diff --git a/master/tpl3040-sdcard-spi b/master/tpl3040-sdcard-spi
new file mode 100644
index 0000000..9ccce4e
--- /dev/null
+++ b/master/tpl3040-sdcard-spi
@@ -0,0 +1,119 @@
+diff --git a/target/linux/ar71xx/patches-3.8/999-2-sdcard-spi b/target/linux/ar71xx/patches-3.8/999-2-sdcard-spi
+new file mode 100644
+index 0000000..cb31388
+--- /dev/null
++++ b/target/linux/ar71xx/patches-3.8/999-2-sdcard-spi
+@@ -0,0 +1,113 @@
++Index: linux-3.6.10/arch/mips/ath79/mach-tl-mr11u.c
++===================================================================
++--- linux-3.6.10.orig/arch/mips/ath79/mach-tl-mr11u.c
+++++ linux-3.6.10/arch/mips/ath79/mach-tl-mr11u.c
++@@ -12,7 +12,14 @@
++ #include <linux/gpio.h>
++
++ #include <asm/mach-ath79/ath79.h>
+++#include <asm/mach-ath79/ar71xx_regs.h>
+++#include <linux/spi/spi.h>
+++#include <linux/spi/spi_gpio.h>
+++#include <linux/spi/mmc_spi.h>
+++#include <linux/mmc/host.h>
+++#include <linux/platform_device.h>
++
+++#include "common.h"
++ #include "dev-eth.h"
++ #include "dev-gpio-buttons.h"
++ #include "dev-leds-gpio.h"
++@@ -34,6 +41,47 @@
++ #define TL_MR11U_KEYS_POLL_INTERVAL 20 /* msecs */
++ #define TL_MR11U_KEYS_DEBOUNCE_INTERVAL (3 * TL_MR11U_KEYS_POLL_INTERVAL)
++
+++#define TL_MR3040_GPIO_MMC_SCK 15
+++#define TL_MR3040_GPIO_MMC_MOSI 16
+++#define TL_MR3040_GPIO_MMC_MISO 13
+++#define TL_MR3040_GPIO_MMC_CS 1
+++
+++
+++static struct mmc_spi_platform_data tl_mr3040_mmc_data = {
+++ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
+++};
+++
+++static struct spi_board_info tl_mr3040_spi_info[] = {
+++ {
+++ .bus_num = 1,
+++ .chip_select = 0,
+++ .max_speed_hz = 25000000,
+++ .modalias = "mmc_spi",
+++ .mode = SPI_MODE_0,
+++ .controller_data = (void *) TL_MR3040_GPIO_MMC_CS,
+++ .platform_data = &tl_mr3040_mmc_data,
+++ },
+++};
+++
+++static struct spi_gpio_platform_data tl_mr3040_spi_data = {
+++ .sck = TL_MR3040_GPIO_MMC_SCK,
+++ .miso = TL_MR3040_GPIO_MMC_MISO,
+++ .mosi = TL_MR3040_GPIO_MMC_MOSI,
+++ .num_chipselect = 1,
+++};
+++
+++static struct platform_device tl_mr3040_spi_device = {
+++#if 0
+++ .name = "tl_mr3040_spi",
+++#else
+++ .name = "spi_gpio",
+++#endif
+++ .id = 1,
+++ .dev = {
+++ .platform_data = &tl_mr3040_spi_data,
+++ },
+++};
+++
++ static const char *tl_mr11u_part_probes[] = {
++ "tp-link",
++ NULL,
++@@ -119,6 +167,10 @@ MIPS_MACHINE(ATH79_MACH_TL_MR11U, "TL-MR
++
++ static void __init tl_mr3040_setup(void)
++ {
+++ ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+++ AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN|
+++ AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN);
+++
++ common_setup();
++
++ ath79_register_gpio_keys_polled(-1, TL_MR11U_KEYS_POLL_INTERVAL,
++@@ -126,6 +178,10 @@ static void __init tl_mr3040_setup(void)
++ gpio_request_one(TL_MR3040_GPIO_USB_POWER,
++ GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
++ "USB power");
+++
+++
+++ spi_register_board_info(tl_mr3040_spi_info, ARRAY_SIZE(tl_mr3040_spi_info));
+++ platform_device_register(&tl_mr3040_spi_device);
++ }
++
++ MIPS_MACHINE(ATH79_MACH_TL_MR3040, "TL-MR3040", "TP-LINK TL-MR3040",
++Index: linux-3.6.10/drivers/spi/spi-tl_mr3040.c
++===================================================================
++--- /dev/null
+++++ linux-3.6.10/drivers/spi/spi-tl_mr3040.c
++@@ -0,0 +1,7 @@
+++#define DRIVER_NAME "tl_mr3040_spi"
+++#define SPI_MISO_GPIO 13
+++#define SPI_MOSI_GPIO 16
+++#define SPI_SCK_GPIO 15
+++#define SPI_N_CHIPSEL 1
+++#undef NEED_SPIDELAY
+++#include "spi-gpio.c"
++Index: linux-3.6.10/drivers/spi/Makefile
++===================================================================
++--- linux-3.6.10.orig/drivers/spi/Makefile
+++++ linux-3.6.10/drivers/spi/Makefile
++@@ -14,6 +14,7 @@ obj-$(CONFIG_SPI_ALTERA) += spi-altera.
++ obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o
++ obj-$(CONFIG_SPI_AP83) += spi-ap83.o
++ obj-$(CONFIG_SPI_ATH79) += spi-ath79.o
+++obj-$(CONFIG_SPI_ATH79) += spi-tl_mr3040.o
++ obj-$(CONFIG_SPI_AU1550) += spi-au1550.o
++ obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o
++ obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o