patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / asm-sh / ide.h
1 /*
2  *  linux/include/asm-sh/ide.h
3  *
4  *  Copyright (C) 1994-1996  Linus Torvalds & authors
5  */
6
7 /*
8  *  This file contains the i386 architecture specific IDE code.
9  *  In future, SuperH code.
10  */
11
12 #ifndef __ASM_SH_IDE_H
13 #define __ASM_SH_IDE_H
14
15 #ifdef __KERNEL__
16
17 #include <linux/config.h>
18 #include <asm/machvec.h>
19
20 #ifndef MAX_HWIFS
21 /* Should never have less than 2, ide-pci.c(ide_match_hwif) requires it */
22 #define MAX_HWIFS       2
23 #endif
24
25 #define IDE_ARCH_OBSOLETE_DEFAULTS
26
27 static inline int ide_default_irq_hp600(unsigned long base)
28 {
29         switch (base) {
30                 case 0x01f0: return 93;
31                 case 0x0170: return 94;
32                 default:
33                         return 0;
34         }
35 }
36
37 static inline int ide_default_irq(unsigned long base)
38 {
39         if (MACH_HP600) {
40                 return ide_default_irq_hp600(base);
41         }
42         switch (base) {
43                 case 0x01f0: return 14;
44                 case 0x0170: return 15;
45                 default:
46                         return 0;
47         }
48 }
49
50 static inline unsigned long ide_default_io_base_hp600(int index)
51 {
52         switch (index) {
53                 case 0: 
54                         return 0x01f0;
55                 case 1: 
56                         return 0x0170;
57                 default:
58                         return 0;
59         }
60 }
61
62 static inline unsigned long ide_default_io_base(int index)
63 {
64         if (MACH_HP600) {
65                 return ide_default_io_base_hp600(index);
66         }
67         switch (index) {
68                 case 0: 
69                         return 0x1f0;
70                 case 1: 
71                         return 0x170;
72                 default:
73                         return 0;
74         }
75 }
76
77 #define IDE_ARCH_OBSOLETE_INIT
78 #define ide_default_io_ctl(base)        ((base) + 0x206) /* obsolete */
79
80 #ifdef CONFIG_PCI
81 #define ide_init_default_irq(base)      (0)
82 #else
83 #define ide_init_default_irq(base)      ide_default_irq(base)
84 #endif
85
86 #include <asm-generic/ide_iops.h>
87
88 #endif /* __KERNEL__ */
89
90 #endif /* __ASM_SH_IDE_H */