aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:32 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:32 -0400
commit1d850bd0b291efd1740b8d87ce025363436eb6dc (patch)
treee0bfb32a27b58074206ec02a455272054c899ca2
parent5d682e4407d8364c286650baafcccae54d4b7c89 (diff)
ppc: remove ppc_ide_md
* Add special cases for pplus and prep to ide_default_{irq,io_base}() (+ FIXMEs about the need to use IDE platform host driver instead). * Remove no longer needed ppc_ide_md and struct ide_machdep_calls. * Then remove <linux/ide.h> include from: - arch/powerpc/kernel/setup_32.c - arch/ppc/kernel/ppc_ksyms.c - arch/ppc/kernel/setup.c - arch/ppc/platforms/pplus.c - arch/ppc/platforms/prep_setup.c There should be no functional changes caused by this patch. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--arch/powerpc/kernel/setup_32.c8
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c5
-rw-r--r--arch/ppc/kernel/setup.c2
-rw-r--r--arch/ppc/platforms/pplus.c35
-rw-r--r--arch/ppc/platforms/prep_setup.c38
-rw-r--r--drivers/ide/ide.c4
-rw-r--r--include/asm-powerpc/ide.h47
7 files changed, 32 insertions, 107 deletions
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index cd870a823d18..06d918d94dd1 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -10,9 +10,6 @@
10#include <linux/reboot.h> 10#include <linux/reboot.h>
11#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/initrd.h> 12#include <linux/initrd.h>
13#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
14#include <linux/ide.h>
15#endif
16#include <linux/tty.h> 13#include <linux/tty.h>
17#include <linux/bootmem.h> 14#include <linux/bootmem.h>
18#include <linux/seq_file.h> 15#include <linux/seq_file.h>
@@ -51,11 +48,6 @@
51 48
52extern void bootx_init(unsigned long r4, unsigned long phys); 49extern void bootx_init(unsigned long r4, unsigned long phys);
53 50
54#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
55struct ide_machdep_calls ppc_ide_md;
56EXPORT_SYMBOL(ppc_ide_md);
57#endif
58
59int boot_cpuid; 51int boot_cpuid;
60EXPORT_SYMBOL_GPL(boot_cpuid); 52EXPORT_SYMBOL_GPL(boot_cpuid);
61int boot_cpuid_phys; 53int boot_cpuid_phys;
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index c35350250cfc..2ba659f401be 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -12,7 +12,6 @@
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/ide.h>
16#include <linux/pm.h> 15#include <linux/pm.h>
17#include <linux/bitops.h> 16#include <linux/bitops.h>
18 17
@@ -124,10 +123,6 @@ EXPORT_SYMBOL(__ioremap);
124EXPORT_SYMBOL(iounmap); 123EXPORT_SYMBOL(iounmap);
125EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */ 124EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */
126 125
127#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
128EXPORT_SYMBOL(ppc_ide_md);
129#endif
130
131#ifdef CONFIG_PCI 126#ifdef CONFIG_PCI
132EXPORT_SYMBOL(isa_io_base); 127EXPORT_SYMBOL(isa_io_base);
133EXPORT_SYMBOL(isa_mem_base); 128EXPORT_SYMBOL(isa_mem_base);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 294055902f0c..bfddfdee0b65 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -10,7 +10,6 @@
10#include <linux/reboot.h> 10#include <linux/reboot.h>
11#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/initrd.h> 12#include <linux/initrd.h>
13#include <linux/ide.h>
14#include <linux/screen_info.h> 13#include <linux/screen_info.h>
15#include <linux/bootmem.h> 14#include <linux/bootmem.h>
16#include <linux/seq_file.h> 15#include <linux/seq_file.h>
@@ -57,7 +56,6 @@ extern void ppc6xx_idle(void);
57extern void power4_idle(void); 56extern void power4_idle(void);
58 57
59extern boot_infos_t *boot_infos; 58extern boot_infos_t *boot_infos;
60struct ide_machdep_calls ppc_ide_md;
61 59
62/* Used with the BI_MEMSIZE bootinfo parameter to store the memory 60/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
63 size value reported by the boot loader. */ 61 size value reported by the boot loader. */
diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c
index 384cdfea70fa..cbcac85c7a78 100644
--- a/arch/ppc/platforms/pplus.c
+++ b/arch/ppc/platforms/pplus.c
@@ -19,7 +19,6 @@
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/console.h> 20#include <linux/console.h>
21#include <linux/pci.h> 21#include <linux/pci.h>
22#include <linux/ide.h>
23#include <linux/seq_file.h> 22#include <linux/seq_file.h>
24#include <linux/root_dev.h> 23#include <linux/root_dev.h>
25 24
@@ -668,35 +667,6 @@ static void __init pplus_init_IRQ(void)
668 ppc_md.progress("init_irq: exit", 0); 667 ppc_md.progress("init_irq: exit", 0);
669} 668}
670 669
671#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
672/*
673 * IDE stuff.
674 */
675static int pplus_ide_default_irq(unsigned long base)
676{
677 switch (base) {
678 case 0x1f0:
679 return 14;
680 case 0x170:
681 return 15;
682 default:
683 return 0;
684 }
685}
686
687static unsigned long pplus_ide_default_io_base(int index)
688{
689 switch (index) {
690 case 0:
691 return 0x1f0;
692 case 1:
693 return 0x170;
694 default:
695 return 0;
696 }
697}
698#endif
699
700#ifdef CONFIG_SMP 670#ifdef CONFIG_SMP
701/* PowerPlus (MTX) support */ 671/* PowerPlus (MTX) support */
702static int __init smp_pplus_probe(void) 672static int __init smp_pplus_probe(void)
@@ -862,11 +832,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
862 ppc_md.find_end_of_memory = pplus_find_end_of_memory; 832 ppc_md.find_end_of_memory = pplus_find_end_of_memory;
863 ppc_md.setup_io_mappings = pplus_map_io; 833 ppc_md.setup_io_mappings = pplus_map_io;
864 834
865#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
866 ppc_ide_md.default_irq = pplus_ide_default_irq;
867 ppc_ide_md.default_io_base = pplus_ide_default_io_base;
868#endif
869
870#ifdef CONFIG_SERIAL_TEXT_DEBUG 835#ifdef CONFIG_SERIAL_TEXT_DEBUG
871 ppc_md.progress = gen550_progress; 836 ppc_md.progress = gen550_progress;
872#endif /* CONFIG_SERIAL_TEXT_DEBUG */ 837#endif /* CONFIG_SERIAL_TEXT_DEBUG */
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
index 38449855d5ff..465b658c927d 100644
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -33,7 +33,6 @@
33#include <linux/console.h> 33#include <linux/console.h>
34#include <linux/timex.h> 34#include <linux/timex.h>
35#include <linux/pci.h> 35#include <linux/pci.h>
36#include <linux/ide.h>
37#include <linux/seq_file.h> 36#include <linux/seq_file.h>
38#include <linux/root_dev.h> 37#include <linux/root_dev.h>
39 38
@@ -894,38 +893,6 @@ prep_init_IRQ(void)
894 i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR, 0); 893 i8259_init(MPC10X_MAPA_PCI_INTACK_ADDR, 0);
895} 894}
896 895
897#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
898/*
899 * IDE stuff.
900 */
901static int
902prep_ide_default_irq(unsigned long base)
903{
904 switch (base) {
905 case 0x1f0: return 13;
906 case 0x170: return 13;
907 case 0x1e8: return 11;
908 case 0x168: return 10;
909 case 0xfff0: return 14; /* MCP(N)750 ide0 */
910 case 0xffe0: return 15; /* MCP(N)750 ide1 */
911 default: return 0;
912 }
913}
914
915static unsigned long
916prep_ide_default_io_base(int index)
917{
918 switch (index) {
919 case 0: return 0x1f0;
920 case 1: return 0x170;
921 case 2: return 0x1e8;
922 case 3: return 0x168;
923 default:
924 return 0;
925 }
926}
927#endif
928
929#ifdef CONFIG_SMP 896#ifdef CONFIG_SMP
930/* PReP (MTX) support */ 897/* PReP (MTX) support */
931static int __init 898static int __init
@@ -1070,11 +1037,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
1070 1037
1071 ppc_md.setup_io_mappings = prep_map_io; 1038 ppc_md.setup_io_mappings = prep_map_io;
1072 1039
1073#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
1074 ppc_ide_md.default_irq = prep_ide_default_irq;
1075 ppc_ide_md.default_io_base = prep_ide_default_io_base;
1076#endif
1077
1078#ifdef CONFIG_SMP 1040#ifdef CONFIG_SMP
1079 smp_ops = &prep_smp_ops; 1041 smp_ops = &prep_smp_ops;
1080#endif /* CONFIG_SMP */ 1042#endif /* CONFIG_SMP */
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 7e6418fe3a84..c2fb5c964a51 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -205,10 +205,6 @@ static void __init init_ide_data (void)
205#ifdef CONFIG_IDE_ARCH_OBSOLETE_INIT 205#ifdef CONFIG_IDE_ARCH_OBSOLETE_INIT
206 memset(&hw, 0, sizeof(hw)); 206 memset(&hw, 0, sizeof(hw));
207 ide_std_init_ports(&hw, io_addr, ctl_addr); 207 ide_std_init_ports(&hw, io_addr, ctl_addr);
208# ifdef CONFIG_PPC32
209 if (ppc_ide_md.ide_init_hwif)
210 ppc_ide_md.ide_init_hwif(&hw, io_addr, 0, &hwif->irq);
211# endif
212 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); 208 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports));
213#endif 209#endif
214 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 210 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index 6d50310ecaea..06549456c953 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -31,30 +31,47 @@
31#include <linux/hdreg.h> 31#include <linux/hdreg.h>
32#include <linux/ioport.h> 32#include <linux/ioport.h>
33 33
34struct ide_machdep_calls {
35 int (*default_irq)(unsigned long base);
36 unsigned long (*default_io_base)(int index);
37 void (*ide_init_hwif)(hw_regs_t *hw,
38 unsigned long data_port,
39 unsigned long ctrl_port,
40 int *irq);
41};
42
43extern struct ide_machdep_calls ppc_ide_md;
44
45#define IDE_ARCH_OBSOLETE_DEFAULTS 34#define IDE_ARCH_OBSOLETE_DEFAULTS
46 35
36/* FIXME: use ide_platform host driver */
47static __inline__ int ide_default_irq(unsigned long base) 37static __inline__ int ide_default_irq(unsigned long base)
48{ 38{
49 if (ppc_ide_md.default_irq) 39#ifdef CONFIG_PPLUS
50 return ppc_ide_md.default_irq(base); 40 switch (base) {
41 case 0x1f0: return 14;
42 case 0x170: return 15;
43 }
44#endif
45#ifdef CONFIG_PPC_PREP
46 switch (base) {
47 case 0x1f0: return 13;
48 case 0x170: return 13;
49 case 0x1e8: return 11;
50 case 0x168: return 10;
51 case 0xfff0: return 14; /* MCP(N)750 ide0 */
52 case 0xffe0: return 15; /* MCP(N)750 ide1 */
53 }
54#endif
51 return 0; 55 return 0;
52} 56}
53 57
58/* FIXME: use ide_platform host driver */
54static __inline__ unsigned long ide_default_io_base(int index) 59static __inline__ unsigned long ide_default_io_base(int index)
55{ 60{
56 if (ppc_ide_md.default_io_base) 61#ifdef CONFIG_PPLUS
57 return ppc_ide_md.default_io_base(index); 62 switch (index) {
63 case 0: return 0x1f0;
64 case 1: return 0x170;
65 }
66#endif
67#ifdef CONFIG_PPC_PREP
68 switch (index) {
69 case 0: return 0x1f0;
70 case 1: return 0x170;
71 case 2: return 0x1e8;
72 case 3: return 0x168;
73 }
74#endif
58 return 0; 75 return 0;
59} 76}
60 77