make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / drivers / ide / pci / siimage.h
1 #ifndef SIIMAGE_H
2 #define SIIMAGE_H
3
4 #include <linux/config.h>
5 #include <linux/pci.h>
6 #include <linux/ide.h>
7
8 #include <asm/io.h>
9
10 #define DISPLAY_SIIMAGE_TIMINGS
11
12 #define CONFIG_TRY_MMIO_SIIMAGE
13 //#undef CONFIG_TRY_MMIO_SIIMAGE
14 #undef SIIMAGE_VIRTUAL_DMAPIO
15 #undef SIIMAGE_BUFFERED_TASKFILE
16 #undef SIIMAGE_LARGE_DMA
17
18 #if 0
19 typedef struct ide_io_ops_s siimage_iops {
20
21 }
22 #endif
23
24 #define SII_DEBUG 0
25
26 #if SII_DEBUG
27 #define siiprintk(x...) printk(x)
28 #else
29 #define siiprintk(x...)
30 #endif
31
32 #define ADJREG(B,R)     ((B)|(R)|((hwif->channel)<<(4+(2*(hwif->mmio)))))
33 #define SELREG(R)       ADJREG((0xA0),(R))
34 #define SELADDR(R)      ((((unsigned long)hwif->hwif_data)*(hwif->mmio))|SELREG((R)))
35 #define HWIFADDR(R)     ((((unsigned long)hwif->hwif_data)*(hwif->mmio))|(R))
36 #define DEVADDR(R)      (((unsigned long) pci_get_drvdata(dev))|(R))
37
38
39 inline u8 sii_inb (unsigned long port)
40 {
41         return (u8) readb(port);
42 }
43
44 inline u16 sii_inw (unsigned long port)
45 {
46         return (u16) readw(port);
47 }
48
49 inline void sii_insw (unsigned long port, void *addr, u32 count)
50 {
51         __ide_mm_insw(port, addr, count);
52 }
53
54 inline u32 sii_inl (unsigned long port)
55 {
56         return (u32) readl(port);
57 }
58
59 inline void sii_insl (unsigned long port, void *addr, u32 count)
60 {
61         __ide_mm_insw(port, addr, (count)<<1);
62 }
63
64 inline void sii_outb (u8 value, unsigned long port)
65 {
66         writeb(value, port);
67 }
68
69 inline void sii_outw (u16 value, unsigned long port)
70 {
71         writew(value, port);
72 }
73
74 inline void sii_outsw (unsigned long port, void *addr, u32 count)
75 {
76         __ide_mm_outsw(port, addr, count);
77 }
78
79 inline void sii_outl (u32 value, unsigned long port)
80 {
81         writel(value, port);
82 }
83
84 inline void sii_outsl (unsigned long port, void *addr, u32 count)
85 {
86         __ide_mm_outsw(port, addr, (count)<<1);
87 }
88
89 #if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS)
90 #include <linux/stat.h>
91 #include <linux/proc_fs.h>
92
93 static char * print_siimage_get_info(char *, struct pci_dev *, int);
94 static int siimage_get_info(char *, char **, off_t, int);
95
96 static u8 siimage_proc;
97
98 static ide_pci_host_proc_t siimage_procs[] __initdata = {
99         {
100                 .name           = "siimage",
101                 .set            = 1,
102                 .get_info       = siimage_get_info,
103                 .parent         = NULL,
104         },
105 };
106 #endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */  
107
108 static unsigned int init_chipset_siimage(struct pci_dev *, const char *);
109 static void init_iops_siimage(ide_hwif_t *);
110 static void init_hwif_siimage(ide_hwif_t *);
111 static void init_dma_siimage(ide_hwif_t *, unsigned long);
112
113 static ide_pci_device_t siimage_chipsets[] __devinitdata = {
114         {       /* 0 */
115                 .vendor         = PCI_VENDOR_ID_CMD,
116                 .device         = PCI_DEVICE_ID_SII_680,
117                 .name           = "SiI680",
118                 .init_chipset   = init_chipset_siimage,
119                 .init_iops      = init_iops_siimage,
120                 .init_hwif      = init_hwif_siimage,
121                 .init_dma       = init_dma_siimage,
122                 .channels       = 2,
123                 .autodma        = AUTODMA,
124                 .enablebits     = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
125                 .bootable       = ON_BOARD,
126                 .extra          = 0,
127         },{     /* 1 */
128                 .vendor         = PCI_VENDOR_ID_CMD,
129                 .device         = PCI_DEVICE_ID_SII_3112,
130                 .name           = "SiI3112 Serial ATA",
131                 .init_chipset   = init_chipset_siimage,
132                 .init_iops      = init_iops_siimage,
133                 .init_hwif      = init_hwif_siimage,
134                 .init_dma       = init_dma_siimage,
135                 .channels       = 2,
136                 .autodma        = AUTODMA,
137                 .enablebits     = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
138                 .bootable       = ON_BOARD,
139                 .extra          = 0,
140         },{
141                 .vendor         = 0,
142                 .device         = 0,
143                 .channels       = 0,
144                 .bootable       = EOL,
145         }
146 };
147
148 #endif /* SIIMAGE_H */