aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/ide.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/ide.h')
-rw-r--r--include/asm-powerpc/ide.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index 6d50310ecaea..3d90bf7d3d73 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -31,39 +31,48 @@
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 { 34/* FIXME: use ide_platform host driver */
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
46
47static __inline__ int ide_default_irq(unsigned long base) 35static __inline__ int ide_default_irq(unsigned long base)
48{ 36{
49 if (ppc_ide_md.default_irq) 37#ifdef CONFIG_PPLUS
50 return ppc_ide_md.default_irq(base); 38 switch (base) {
39 case 0x1f0: return 14;
40 case 0x170: return 15;
41 }
42#endif
43#ifdef CONFIG_PPC_PREP
44 switch (base) {
45 case 0x1f0: return 13;
46 case 0x170: return 13;
47 case 0x1e8: return 11;
48 case 0x168: return 10;
49 case 0xfff0: return 14; /* MCP(N)750 ide0 */
50 case 0xffe0: return 15; /* MCP(N)750 ide1 */
51 }
52#endif
51 return 0; 53 return 0;
52} 54}
53 55
56/* FIXME: use ide_platform host driver */
54static __inline__ unsigned long ide_default_io_base(int index) 57static __inline__ unsigned long ide_default_io_base(int index)
55{ 58{
56 if (ppc_ide_md.default_io_base) 59#ifdef CONFIG_PPLUS
57 return ppc_ide_md.default_io_base(index); 60 switch (index) {
61 case 0: return 0x1f0;
62 case 1: return 0x170;
63 }
64#endif
65#ifdef CONFIG_PPC_PREP
66 switch (index) {
67 case 0: return 0x1f0;
68 case 1: return 0x170;
69 case 2: return 0x1e8;
70 case 3: return 0x168;
71 }
72#endif
58 return 0; 73 return 0;
59} 74}
60 75
61#ifdef CONFIG_PCI
62#define ide_init_default_irq(base) (0)
63#else
64#define ide_init_default_irq(base) ide_default_irq(base)
65#endif
66
67#ifdef CONFIG_BLK_DEV_MPC8xx_IDE 76#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
68#define IDE_ARCH_ACK_INTR 1 77#define IDE_ARCH_ACK_INTR 1
69#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1) 78#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1)
@@ -71,8 +80,6 @@ static __inline__ unsigned long ide_default_io_base(int index)
71 80
72#endif /* __powerpc64__ */ 81#endif /* __powerpc64__ */
73 82
74#define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
75
76#endif /* __KERNEL__ */ 83#endif /* __KERNEL__ */
77 84
78#endif /* _ASM_POWERPC_IDE_H */ 85#endif /* _ASM_POWERPC_IDE_H */