diff options
| author | Manuel Lauss <manuel.lauss@googlemail.com> | 2009-10-04 08:55:29 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2010-02-27 06:52:51 -0500 |
| commit | 0273b4efccd3bc2b2ef5ea9778e71d8efbbb7ac7 (patch) | |
| tree | c67c6fb5ff0aa4a0201676374b252ea60475235c | |
| parent | 27dd65ac9afabc8e67ab73f7c2f575eddbb47167 (diff) | |
MIPS: Alchemy: XXS1500 PCMCIA driver rewrite
Rewritten XXS1500 PCMCIA socket driver, standalone (doesn't depend on
au1000_generic.c) and added carddetect IRQ support.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Linux-PCMCIA <linux-pcmcia@lists.infradead.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| -rw-r--r-- | arch/mips/alchemy/xxs1500/Makefile | 2 | ||||
| -rw-r--r-- | arch/mips/alchemy/xxs1500/board_setup.c | 16 | ||||
| -rw-r--r-- | arch/mips/alchemy/xxs1500/platform.c | 63 | ||||
| -rw-r--r-- | drivers/pcmcia/Kconfig | 10 | ||||
| -rw-r--r-- | drivers/pcmcia/Makefile | 3 | ||||
| -rw-r--r-- | drivers/pcmcia/au1000_xxs1500.c | 188 | ||||
| -rw-r--r-- | drivers/pcmcia/xxs1500_ss.c | 357 |
7 files changed, 433 insertions, 206 deletions
diff --git a/arch/mips/alchemy/xxs1500/Makefile b/arch/mips/alchemy/xxs1500/Makefile index 545d8f5496e5..68671c2f372c 100644 --- a/arch/mips/alchemy/xxs1500/Makefile +++ b/arch/mips/alchemy/xxs1500/Makefile | |||
| @@ -5,4 +5,4 @@ | |||
| 5 | # Makefile for MyCable XXS1500 board. | 5 | # Makefile for MyCable XXS1500 board. |
| 6 | # | 6 | # |
| 7 | 7 | ||
| 8 | lib-y := init.o board_setup.o | 8 | lib-y := init.o board_setup.o platform.o |
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c index cad14f8a7c2a..eb31350d9772 100644 --- a/arch/mips/alchemy/xxs1500/board_setup.c +++ b/arch/mips/alchemy/xxs1500/board_setup.c | |||
| @@ -69,22 +69,6 @@ void __init board_setup(void) | |||
| 69 | /* Enable DTR = USB power up */ | 69 | /* Enable DTR = USB power up */ |
| 70 | au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ | 70 | au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ |
| 71 | 71 | ||
| 72 | #ifdef CONFIG_PCMCIA_XXS1500 | ||
| 73 | /* GPIO 0, 1, and 4 are inputs */ | ||
| 74 | alchemy_gpio_direction_input(0); | ||
| 75 | alchemy_gpio_direction_input(1); | ||
| 76 | alchemy_gpio_direction_input(4); | ||
| 77 | |||
| 78 | /* GPIO2 208/9/10/11 are inputs */ | ||
| 79 | alchemy_gpio_direction_input(208); | ||
| 80 | alchemy_gpio_direction_input(209); | ||
| 81 | alchemy_gpio_direction_input(210); | ||
| 82 | alchemy_gpio_direction_input(211); | ||
| 83 | |||
| 84 | /* Turn off power */ | ||
| 85 | alchemy_gpio_direction_output(214, 0); | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #ifdef CONFIG_PCI | 72 | #ifdef CONFIG_PCI |
| 89 | #if defined(__MIPSEB__) | 73 | #if defined(__MIPSEB__) |
| 90 | au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG); | 74 | au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG); |
diff --git a/arch/mips/alchemy/xxs1500/platform.c b/arch/mips/alchemy/xxs1500/platform.c new file mode 100644 index 000000000000..c14dcaa95311 --- /dev/null +++ b/arch/mips/alchemy/xxs1500/platform.c | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * XXS1500 board platform device registration | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Manuel Lauss | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <linux/init.h> | ||
| 22 | #include <linux/platform_device.h> | ||
| 23 | |||
| 24 | #include <asm/mach-au1x00/au1000.h> | ||
| 25 | |||
| 26 | static struct resource xxs1500_pcmcia_res[] = { | ||
| 27 | { | ||
| 28 | .name = "pseudo-io", | ||
| 29 | .flags = IORESOURCE_MEM, | ||
| 30 | .start = PCMCIA_IO_PSEUDO_PHYS, | ||
| 31 | .end = PCMCIA_IO_PSEUDO_PHYS + 0x00040000 - 1, | ||
| 32 | }, | ||
| 33 | { | ||
| 34 | .name = "pseudo-attr", | ||
| 35 | .flags = IORESOURCE_MEM, | ||
| 36 | .start = PCMCIA_ATTR_PSEUDO_PHYS, | ||
| 37 | .end = PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1, | ||
| 38 | }, | ||
| 39 | { | ||
| 40 | .name = "pseudo-mem", | ||
| 41 | .flags = IORESOURCE_MEM, | ||
| 42 | .start = PCMCIA_IO_PSEUDO_PHYS, | ||
| 43 | .end = PCMCIA_IO_PSEUDO_PHYS + 0x00040000 - 1, | ||
| 44 | }, | ||
| 45 | }; | ||
| 46 | |||
| 47 | static struct platform_device xxs1500_pcmcia_dev = { | ||
| 48 | .name = "xxs1500_pcmcia", | ||
| 49 | .id = -1, | ||
| 50 | .num_resources = ARRAY_SIZE(xxs1500_pcmcia_res), | ||
| 51 | .resource = xxs1500_pcmcia_res, | ||
| 52 | }; | ||
| 53 | |||
| 54 | static struct platform_device *xxs1500_devs[] __initdata = { | ||
| 55 | &xxs1500_pcmcia_dev, | ||
| 56 | }; | ||
| 57 | |||
| 58 | static int __init xxs1500_dev_init(void) | ||
| 59 | { | ||
| 60 | return platform_add_devices(xxs1500_devs, | ||
| 61 | ARRAY_SIZE(xxs1500_devs)); | ||
| 62 | } | ||
| 63 | device_initcall(xxs1500_dev_init); | ||
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index 7c16d35679a6..1e01578a0a77 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig | |||
| @@ -185,6 +185,16 @@ config PCMCIA_ALCHEMY_DEVBOARD | |||
| 185 | 185 | ||
| 186 | This driver is also available as a module called db1xxx_ss.ko | 186 | This driver is also available as a module called db1xxx_ss.ko |
| 187 | 187 | ||
| 188 | config PCMCIA_XXS1500 | ||
| 189 | tristate "MyCable XXS1500 PCMCIA socket support" | ||
| 190 | depends on PCMCIA && MIPS_XXS1500 | ||
| 191 | select 64BIT_PHYS_ADDR | ||
| 192 | help | ||
| 193 | Support for the PCMCIA/CF socket interface on MyCable XXS1500 | ||
| 194 | systems. | ||
| 195 | |||
| 196 | This driver is also available as a module called xxs1500_ss.ko | ||
| 197 | |||
| 188 | config PCMCIA_BCM63XX | 198 | config PCMCIA_BCM63XX |
| 189 | tristate "bcm63xx pcmcia support" | 199 | tristate "bcm63xx pcmcia support" |
| 190 | depends on BCM63XX && PCMCIA | 200 | depends on BCM63XX && PCMCIA |
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index f128d71c74c2..21ee96448b1e 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
| @@ -39,7 +39,6 @@ obj-$(CONFIG_PCMCIA_ALCHEMY_DEVBOARD) += db1xxx_ss.o | |||
| 39 | 39 | ||
| 40 | au1x00_ss-y += au1000_generic.o | 40 | au1x00_ss-y += au1000_generic.o |
| 41 | au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o | 41 | au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o |
| 42 | au1x00_ss-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o | ||
| 43 | 42 | ||
| 44 | sa1111_cs-y += sa1111_generic.o | 43 | sa1111_cs-y += sa1111_generic.o |
| 45 | sa1111_cs-$(CONFIG_ASSABET_NEPONSET) += sa1100_neponset.o | 44 | sa1111_cs-$(CONFIG_ASSABET_NEPONSET) += sa1100_neponset.o |
| @@ -69,3 +68,5 @@ pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o | |||
| 69 | pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o | 68 | pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o |
| 70 | 69 | ||
| 71 | obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) | 70 | obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) |
| 71 | |||
| 72 | obj-$(CONFIG_PCMCIA_XXS1500) += xxs1500_ss.o | ||
diff --git a/drivers/pcmcia/au1000_xxs1500.c b/drivers/pcmcia/au1000_xxs1500.c deleted file mode 100644 index b43d47b50819..000000000000 --- a/drivers/pcmcia/au1000_xxs1500.c +++ /dev/null | |||
| @@ -1,188 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * MyCable board specific pcmcia routines. | ||
| 4 | * | ||
| 5 | * Copyright 2003 MontaVista Software Inc. | ||
| 6 | * Author: Pete Popov, MontaVista Software, Inc. | ||
| 7 | * ppopov@mvista.com or source@mvista.com | ||
| 8 | * | ||
| 9 | * ######################################################################## | ||
| 10 | * | ||
| 11 | * This program is free software; you can distribute it and/or modify it | ||
| 12 | * under the terms of the GNU General Public License (Version 2) as | ||
| 13 | * published by the Free Software Foundation. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 18 | * for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License along | ||
| 21 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 22 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
| 23 | * | ||
| 24 | * ######################################################################## | ||
| 25 | * | ||
| 26 | * | ||
| 27 | */ | ||
| 28 | #include <linux/module.h> | ||
| 29 | #include <linux/init.h> | ||
| 30 | #include <linux/delay.h> | ||
| 31 | #include <linux/ioport.h> | ||
| 32 | #include <linux/kernel.h> | ||
| 33 | #include <linux/timer.h> | ||
| 34 | #include <linux/mm.h> | ||
| 35 | #include <linux/proc_fs.h> | ||
| 36 | #include <linux/types.h> | ||
| 37 | |||
| 38 | #include <pcmcia/cs_types.h> | ||
| 39 | #include <pcmcia/cs.h> | ||
