Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
b354cab0 | 2 | * Copyright (C) 1994-1996 Linus Torvalds & authors |
1da177e4 | 3 | * |
b354cab0 | 4 | * This file contains the powerpc architecture specific IDE code. |
1da177e4 | 5 | */ |
b354cab0 SR |
6 | #ifndef _ASM_POWERPC_IDE_H |
7 | #define _ASM_POWERPC_IDE_H | |
1da177e4 LT |
8 | |
9 | #ifdef __KERNEL__ | |
10 | ||
b354cab0 | 11 | #ifndef __powerpc64__ |
1da177e4 LT |
12 | #include <linux/sched.h> |
13 | #include <asm/mpc8xx.h> | |
b354cab0 | 14 | #endif |
1da177e4 LT |
15 | |
16 | #ifndef MAX_HWIFS | |
b354cab0 SR |
17 | #ifdef __powerpc64__ |
18 | #define MAX_HWIFS 10 | |
19 | #else | |
1da177e4 LT |
20 | #define MAX_HWIFS 8 |
21 | #endif | |
b354cab0 | 22 | #endif |
1da177e4 | 23 | |
b354cab0 | 24 | #ifndef __powerpc64__ |
1da177e4 LT |
25 | #include <linux/config.h> |
26 | #include <linux/hdreg.h> | |
27 | #include <linux/ioport.h> | |
28 | #include <asm/io.h> | |
29 | ||
30 | extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count); | |
31 | extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count); | |
32 | extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count); | |
33 | extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count); | |
34 | ||
35 | struct ide_machdep_calls { | |
36 | int (*default_irq)(unsigned long base); | |
37 | unsigned long (*default_io_base)(int index); | |
38 | void (*ide_init_hwif)(hw_regs_t *hw, | |
39 | unsigned long data_port, | |
40 | unsigned long ctrl_port, | |
41 | int *irq); | |
42 | }; | |
43 | ||
44 | extern struct ide_machdep_calls ppc_ide_md; | |
45 | ||
46 | #undef SUPPORT_SLOW_DATA_PORTS | |
47 | #define SUPPORT_SLOW_DATA_PORTS 0 | |
48 | ||
49 | #define IDE_ARCH_OBSOLETE_DEFAULTS | |
50 | ||
51 | static __inline__ int ide_default_irq(unsigned long base) | |
52 | { | |
53 | if (ppc_ide_md.default_irq) | |
54 | return ppc_ide_md.default_irq(base); | |
55 | return 0; | |
56 | } | |
57 | ||
58 | static __inline__ unsigned long ide_default_io_base(int index) | |
59 | { | |
60 | if (ppc_ide_md.default_io_base) | |
61 | return ppc_ide_md.default_io_base(index); | |
62 | return 0; | |
63 | } | |
64 | ||
1da177e4 LT |
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 | |
70 | ||
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 | |
75 | ||
b354cab0 SR |
76 | #endif /* __powerpc64__ */ |
77 | ||
78 | #define IDE_ARCH_OBSOLETE_INIT | |
79 | #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ | |
80 | ||
1da177e4 LT |
81 | #endif /* __KERNEL__ */ |
82 | ||
b354cab0 | 83 | #endif /* _ASM_POWERPC_IDE_H */ |