ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[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 static inline int ide_default_irq_hp600(unsigned long base)
26 {
27         switch (base) {
28                 case 0x01f0: return 93;
29                 case 0x0170: return 94;
30                 default:
31                         return 0;
32         }
33 }
34
35 static inline int ide_default_irq(unsigned long base)
36 {
37         if (MACH_HP600) {
38                 return ide_default_irq_hp600(base);
39         }
40         switch (base) {
41                 case 0x01f0: return 14;
42                 case 0x0170: return 15;
43                 default:
44                         return 0;
45         }
46 }
47
48 static inline unsigned long ide_default_io_base_hp600(int index)
49 {
50         switch (index) {
51                 case 0: 
52                         return 0x01f0;
53                 case 1: 
54                         return 0x0170;
55                 default:
56                         return 0;
57         }
58 }
59
60 static inline unsigned long ide_default_io_base(int index)
61 {
62         if (MACH_HP600) {
63                 return ide_default_io_base_hp600(index);
64         }
65         switch (index) {
66                 case 0: 
67                         return 0x1f0;
68                 case 1: 
69                         return 0x170;
70                 default:
71                         return 0;
72         }
73 }
74
75 #ifdef CONFIG_PCI
76 #define ide_init_default_irq(base)      (0)
77 #else
78 #define ide_init_default_irq(base)      ide_default_irq(base)
79 #endif
80
81 #include <asm-generic/ide_iops.h>
82
83 #endif /* __KERNEL__ */
84
85 #endif /* __ASM_SH_IDE_H */