[PATCH] PCI: fix-pci-mmap-on-ppc-and-ppc64.patch
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-ppc / ide.h
blob7d6e6599fac4172e2459161268111ce3951d0605
1 /*
2 * linux/include/asm-ppc/ide.h
4 * Copyright (C) 1994-1996 Linus Torvalds & authors */
6 /*
7 * This file contains the ppc architecture specific IDE code.
8 */
10 #ifndef __ASMPPC_IDE_H
11 #define __ASMPPC_IDE_H
13 #ifdef __KERNEL__
15 #include <linux/sched.h>
16 #include <asm/mpc8xx.h>
18 #ifndef MAX_HWIFS
19 #define MAX_HWIFS 8
20 #endif
22 #include <linux/config.h>
23 #include <linux/hdreg.h>
24 #include <linux/ioport.h>
25 #include <asm/io.h>
27 extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count);
28 extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count);
29 extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count);
30 extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count);
32 struct ide_machdep_calls {
33 int (*default_irq)(unsigned long base);
34 unsigned long (*default_io_base)(int index);
35 void (*ide_init_hwif)(hw_regs_t *hw,
36 unsigned long data_port,
37 unsigned long ctrl_port,
38 int *irq);
41 extern struct ide_machdep_calls ppc_ide_md;
43 #undef SUPPORT_SLOW_DATA_PORTS
44 #define SUPPORT_SLOW_DATA_PORTS 0
46 #define IDE_ARCH_OBSOLETE_DEFAULTS
48 static __inline__ int ide_default_irq(unsigned long base)
50 if (ppc_ide_md.default_irq)
51 return ppc_ide_md.default_irq(base);
52 return 0;
55 static __inline__ unsigned long ide_default_io_base(int index)
57 if (ppc_ide_md.default_io_base)
58 return ppc_ide_md.default_io_base(index);
59 return 0;
62 #define IDE_ARCH_OBSOLETE_INIT
63 #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
65 #ifdef CONFIG_PCI
66 #define ide_init_default_irq(base) (0)
67 #else
68 #define ide_init_default_irq(base) ide_default_irq(base)
69 #endif
71 #if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE )
72 #define IDE_ARCH_ACK_INTR 1
73 #define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
74 #endif
76 #endif /* __KERNEL__ */
78 #endif /* __ASMPPC_IDE_H */