ide: define MAX_HWIFS in <linux/ide.h>
[linux-2.6-microblaze.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 #define __ide_mm_insw(p, a, c)  readsw((void __iomem *)(p), (a), (c))
18 #define __ide_mm_insl(p, a, c)  readsl((void __iomem *)(p), (a), (c))
19 #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c))
20 #define __ide_mm_outsl(p, a, c) writesl((void __iomem *)(p), (a), (c))
21
22 #ifndef  __powerpc64__
23 #include <linux/hdreg.h>
24 #include <linux/ioport.h>
25
26 /* FIXME: use ide_platform host driver */
27 static __inline__ int ide_default_irq(unsigned long base)
28 {
29 #ifdef CONFIG_PPLUS
30         switch (base) {
31         case 0x1f0:     return 14;
32         case 0x170:     return 15;
33         }
34 #endif
35 #ifdef CONFIG_PPC_PREP
36         switch (base) {
37         case 0x1f0:     return 13;
38         case 0x170:     return 13;
39         case 0x1e8:     return 11;
40         case 0x168:     return 10;
41         case 0xfff0:    return 14;      /* MCP(N)750 ide0 */
42         case 0xffe0:    return 15;      /* MCP(N)750 ide1 */
43         }
44 #endif
45         return 0;
46 }
47
48 /* FIXME: use ide_platform host driver */
49 static __inline__ unsigned long ide_default_io_base(int index)
50 {
51 #ifdef CONFIG_PPLUS
52         switch (index) {
53         case 0:         return 0x1f0;
54         case 1:         return 0x170;
55         }
56 #endif
57 #ifdef CONFIG_PPC_PREP
58         switch (index) {
59         case 0:         return 0x1f0;
60         case 1:         return 0x170;
61         case 2:         return 0x1e8;
62         case 3:         return 0x168;
63         }
64 #endif
65         return 0;
66 }
67
68 #ifdef CONFIG_BLK_DEV_MPC8xx_IDE
69 #define IDE_ARCH_ACK_INTR  1
70 #define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
71 #endif
72
73 #endif /* __powerpc64__ */
74
75 #endif /* __KERNEL__ */
76
77 #endif /* _ASM_POWERPC_IDE_H */