[PATCH] docs: small kbuild cleanup
[pv_ops_mirror.git] / include / asm-powerpc / ide.h
blobc8390f9485de9dd6ee6c9cfc13dab1a218c7e00a
1 /*
2 * Copyright (C) 1994-1996 Linus Torvalds & authors
4 * This file contains the powerpc architecture specific IDE code.
5 */
6 #ifndef _ASM_POWERPC_IDE_H
7 #define _ASM_POWERPC_IDE_H
9 #ifdef __KERNEL__
11 #ifndef __powerpc64__
12 #include <linux/sched.h>
13 #include <asm/mpc8xx.h>
14 #endif
15 #include <asm/io.h>
17 #ifndef MAX_HWIFS
18 #ifdef __powerpc64__
19 #define MAX_HWIFS 10
20 #else
21 #define MAX_HWIFS 8
22 #endif
23 #endif
25 #define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c))
26 #define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c))
27 #define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c))
28 #define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c))
30 #ifndef __powerpc64__
31 #include <linux/hdreg.h>
32 #include <linux/ioport.h>
34 struct 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);
43 extern struct ide_machdep_calls ppc_ide_md;
45 #undef SUPPORT_SLOW_DATA_PORTS
46 #define SUPPORT_SLOW_DATA_PORTS 0
48 #define IDE_ARCH_OBSOLETE_DEFAULTS
50 static __inline__ int ide_default_irq(unsigned long base)
52 if (ppc_ide_md.default_irq)
53 return ppc_ide_md.default_irq(base);
54 return 0;
57 static __inline__ unsigned long ide_default_io_base(int index)
59 if (ppc_ide_md.default_io_base)
60 return ppc_ide_md.default_io_base(index);
61 return 0;
64 #ifdef CONFIG_PCI
65 #define ide_init_default_irq(base) (0)
66 #else
67 #define ide_init_default_irq(base) ide_default_irq(base)
68 #endif
70 #if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE )
71 #define IDE_ARCH_ACK_INTR 1
72 #define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
73 #endif
75 #endif /* __powerpc64__ */
77 #define IDE_ARCH_OBSOLETE_INIT
78 #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */
80 #endif /* __KERNEL__ */
82 #endif /* _ASM_POWERPC_IDE_H */