]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-powerpc/ide.h
ppc: remove ppc_ide_md
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / ide.h
1 /*
2  *  Copyright (C) 1994-1996 Linus Torvalds & authors
3  *
4  *  This file contains the powerpc architecture specific IDE code.
5  */
6 #ifndef _ASM_POWERPC_IDE_H
7 #define _ASM_POWERPC_IDE_H
8
9 #ifdef __KERNEL__
10
11 #ifndef __powerpc64__
12 #include <linux/sched.h>
13 #include <asm/mpc8xx.h>
14 #endif
15 #include <asm/io.h>
16
17 #ifndef MAX_HWIFS
18 #ifdef __powerpc64__
19 #define MAX_HWIFS       10
20 #else
21 #define MAX_HWIFS       8
22 #endif
23 #endif
24
25 #define __ide_mm_insw(p, a, c)  readsw((void __iomem *)(p), (a), (c))
26 #define __ide_mm_insl(p, a, c)  readsl((void __iomem *)(p), (a), (c))
27 #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c))
28 #define __ide_mm_outsl(p, a, c) writesl((void __iomem *)(p), (a), (c))
29
30 #ifndef  __powerpc64__
31 #include <linux/hdreg.h>
32 #include <linux/ioport.h>
33
34 #define IDE_ARCH_OBSOLETE_DEFAULTS
35
36 /* FIXME: use ide_platform host driver */
37 static __inline__ int ide_default_irq(unsigned long base)
38 {
39 #ifdef CONFIG_PPLUS
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
55         return 0;
56 }
57
58 /* FIXME: use ide_platform host driver */
59 static __inline__ unsigned long ide_default_io_base(int index)
60 {
61 #ifdef CONFIG_PPLUS
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
75         return 0;
76 }
77
78 #ifdef CONFIG_PCI
79 #define ide_init_default_irq(base)      (0)
80 #else
81 #define ide_init_default_irq(base)      ide_default_irq(base)
82 #endif
83
84 #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
85 #define IDE_ARCH_ACK_INTR  1
86 #define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
87 #endif
88
89 #endif /* __powerpc64__ */
90
91 #define ide_default_io_ctl(base)        ((base) + 0x206) /* obsolete */
92
93 #endif /* __KERNEL__ */
94
95 #endif /* _ASM_POWERPC_IDE_H */