aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2007-12-04 15:44:32 -0500
committerOlof Johansson <olof@lixom.net>2008-01-15 11:26:45 -0500
commit9cd55be4d22376893d2818ce3c0e5706a3d74121 (patch)
treea835f728185c09b1dd98b7da44baea3442af7b61 /arch/powerpc
parent61f7162117d4767875825abf2f6ed1eeebbcceed (diff)
[POWERPC] pasemi: Move electra-ide to pata_of_platform
Move electra-ide glue over to the new pata_of_platform framework, and add the quirks needed to that driver. Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/configs/pasemi_defconfig4
-rw-r--r--arch/powerpc/platforms/pasemi/Kconfig9
-rw-r--r--arch/powerpc/platforms/pasemi/Makefile1
-rw-r--r--arch/powerpc/platforms/pasemi/electra_ide.c96
4 files changed, 2 insertions, 108 deletions
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index 9d21b083ae12..797f0dfebde2 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc6 3# Linux kernel version: 2.6.24-rc6
4# Fri Dec 28 11:01:53 2007 4# Tue Jan 15 10:26:10 2008
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7 7
@@ -152,7 +152,6 @@ CONFIG_PPC_PASEMI=y
152CONFIG_PPC_PASEMI_IOMMU=y 152CONFIG_PPC_PASEMI_IOMMU=y
153# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set 153# CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
154CONFIG_PPC_PASEMI_MDIO=y 154CONFIG_PPC_PASEMI_MDIO=y
155CONFIG_ELECTRA_IDE=y
156# CONFIG_PPC_CELLEB is not set 155# CONFIG_PPC_CELLEB is not set
157# CONFIG_PPC_PS3 is not set 156# CONFIG_PPC_PS3 is not set
158# CONFIG_PPC_CELL is not set 157# CONFIG_PPC_CELL is not set
@@ -663,6 +662,7 @@ CONFIG_PATA_PCMCIA=y
663# CONFIG_PATA_VIA is not set 662# CONFIG_PATA_VIA is not set
664# CONFIG_PATA_WINBOND is not set 663# CONFIG_PATA_WINBOND is not set
665CONFIG_PATA_PLATFORM=y 664CONFIG_PATA_PLATFORM=y
665CONFIG_PATA_OF_PLATFORM=y
666CONFIG_MD=y 666CONFIG_MD=y
667CONFIG_BLK_DEV_MD=y 667CONFIG_BLK_DEV_MD=y
668CONFIG_MD_LINEAR=y 668CONFIG_MD_LINEAR=y
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index b3458a181a15..348e0619e3e5 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -37,13 +37,4 @@ config PPC_PASEMI_MDIO
37 help 37 help
38 Driver for MDIO via GPIO on PWRficient platforms 38 Driver for MDIO via GPIO on PWRficient platforms
39 39
40config ELECTRA_IDE
41 tristate "Electra IDE driver"
42 default y
43 depends on PPC_PASEMI && ATA
44 select PATA_PLATFORM
45 help
46 This includes driver support for the Electra on-board IDE
47 interface.
48
49endmenu 40endmenu
diff --git a/arch/powerpc/platforms/pasemi/Makefile b/arch/powerpc/platforms/pasemi/Makefile
index f47fcac7e581..2cd2a4f26a48 100644
--- a/arch/powerpc/platforms/pasemi/Makefile
+++ b/arch/powerpc/platforms/pasemi/Makefile
@@ -1,4 +1,3 @@
1obj-y += setup.o pci.o time.o idle.o powersave.o iommu.o 1obj-y += setup.o pci.o time.o idle.o powersave.o iommu.o
2obj-$(CONFIG_PPC_PASEMI_MDIO) += gpio_mdio.o 2obj-$(CONFIG_PPC_PASEMI_MDIO) += gpio_mdio.o
3obj-$(CONFIG_ELECTRA_IDE) += electra_ide.o
4obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o 3obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o
diff --git a/arch/powerpc/platforms/pasemi/electra_ide.c b/arch/powerpc/platforms/pasemi/electra_ide.c
deleted file mode 100644
index 12fb0c949263..000000000000
--- a/arch/powerpc/platforms/pasemi/electra_ide.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 * Copyright (C) 2007 PA Semi, Inc
3 *
4 * Maintained by: Olof Johansson <olof@lixom.net>
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 version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include <linux/platform_device.h>
21
22#include <asm/prom.h>
23#include <asm/system.h>
24
25/* The electra IDE interface is incredibly simple: Just a device on the localbus
26 * with interrupts hooked up to one of the GPIOs. The device tree contains the
27 * address window and interrupt mappings already, and the pata_platform driver handles
28 * the rest. We just need to hook the two up.
29 */
30
31#define MAX_IFS 4 /* really, we have only one */
32
33static struct platform_device *pdevs[MAX_IFS];
34
35static int __devinit electra_ide_init(void)
36{
37 struct device_node *np;
38 struct resource r[3];
39 int ret = 0;
40 int i;
41
42 np = of_find_compatible_node(NULL, "ide", "electra-ide");
43 i = 0;
44
45 while (np && i < MAX_IFS) {
46 memset(r, 0, sizeof(r));
47
48 /* pata_platform wants two address ranges: one for the base registers,
49 * another for the control (altstatus). It's located at offset 0x3f6 in
50 * the window, but the device tree only has one large register window
51 * that covers both ranges. So we need to split it up by hand here:
52 */
53
54 ret = of_address_to_resource(np, 0, &r[0]);
55 if (ret)
56 goto out;
57 ret = of_address_to_resource(np, 0, &r[1]);
58 if (ret)
59 goto out;
60
61 r[1].start += 0x3f6;
62 r[0].end = r[1].start-1;
63
64 r[2].start = irq_of_parse_and_map(np, 0);
65 r[2].end = irq_of_parse_and_map(np, 0);
66 r[2].flags = IORESOURCE_IRQ;
67
68 pr_debug("registering platform device at 0x%lx/0x%lx, irq is %ld\n",
69 r[0].start, r[1].start, r[2].start);
70 pdevs[i] = platform_device_register_simple("pata_platform", i, r, 3);
71 if (IS_ERR(pdevs[i])) {
72 ret = PTR_ERR(pdevs[i]);
73 pdevs[i] = NULL;
74 goto out;
75 }
76 np = of_find_compatible_node(np, "ide", "electra-ide");
77 }
78out:
79 return ret;
80}
81module_init(electra_ide_init);
82
83static void __devexit electra_ide_exit(void)
84{
85 int i;
86
87 for (i = 0; i < MAX_IFS; i++)
88 if (pdevs[i])
89 platform_device_unregister(pdevs[i]);
90}
91module_exit(electra_ide_exit);
92
93
94MODULE_LICENSE("GPL");
95MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
96MODULE_DESCRIPTION("PA Semi Electra IDE driver");