update atp870u driver to 0.78 from D-Link source
[linux-2.4.git] / drivers / ide / pci / cmd64x.h
1 #ifndef CMD64X_H
2 #define CMD64X_H
3
4 #include <linux/config.h>
5 #include <linux/pci.h>
6 #include <linux/ide.h>
7
8 #define DISPLAY_CMD64X_TIMINGS
9
10 #define CMD_DEBUG 0
11
12 #if CMD_DEBUG
13 #define cmdprintk(x...) printk(x)
14 #else
15 #define cmdprintk(x...)
16 #endif
17
18 #ifndef SPLIT_BYTE
19 #define SPLIT_BYTE(B,H,L)       ((H)=(B>>4), (L)=(B-((B>>4)<<4)))
20 #endif
21
22 /*
23  * CMD64x specific registers definition.
24  */
25 #define CFR             0x50
26 #define   CFR_INTR_CH0          0x02
27 #define CNTRL           0x51
28 #define   CNTRL_DIS_RA0         0x40
29 #define   CNTRL_DIS_RA1         0x80
30 #define   CNTRL_ENA_2ND         0x08
31
32 #define CMDTIM          0x52
33 #define ARTTIM0         0x53
34 #define DRWTIM0         0x54
35 #define ARTTIM1         0x55
36 #define DRWTIM1         0x56
37 #define ARTTIM23        0x57
38 #define   ARTTIM23_DIS_RA2      0x04
39 #define   ARTTIM23_DIS_RA3      0x08
40 #define   ARTTIM23_INTR_CH1     0x10
41 #define ARTTIM2         0x57
42 #define ARTTIM3         0x57
43 #define DRWTIM23        0x58
44 #define DRWTIM2         0x58
45 #define BRST            0x59
46 #define DRWTIM3         0x5b
47
48 #define BMIDECR0        0x70
49 #define MRDMODE         0x71
50 #define   MRDMODE_INTR_CH0      0x04
51 #define   MRDMODE_INTR_CH1      0x08
52 #define   MRDMODE_BLK_CH0       0x10
53 #define   MRDMODE_BLK_CH1       0x20
54 #define BMIDESR0        0x72
55 #define UDIDETCR0       0x73
56 #define DTPR0           0x74
57 #define BMIDECR1        0x78
58 #define BMIDECSR        0x79
59 #define BMIDESR1        0x7A
60 #define UDIDETCR1       0x7B
61 #define DTPR1           0x7C
62
63 #if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS)
64 #include <linux/stat.h>
65 #include <linux/proc_fs.h>
66
67 static u8 cmd64x_proc;
68
69 static char * print_cmd64x_get_info(char *, struct pci_dev *, int);
70 static int cmd64x_get_info(char *, char **, off_t, int);
71
72 static ide_pci_host_proc_t cmd64x_procs[] __initdata = {
73         {
74                 .name           = "cmd64x",
75                 .set            = 1,
76                 .get_info       = cmd64x_get_info,
77                 .parent         = NULL,
78         },
79 };
80 #endif  /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
81
82 static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *);
83 static void init_hwif_cmd64x(ide_hwif_t *);
84 static void init_dma_cmd64x(ide_hwif_t *, unsigned long);
85
86 static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
87         {       /* 0 */
88                 .vendor         = PCI_VENDOR_ID_CMD,
89                 .device         = PCI_DEVICE_ID_CMD_643,
90                 .name           = "CMD643",
91                 .init_chipset   = init_chipset_cmd64x,
92                 .init_iops      = NULL,
93                 .init_hwif      = init_hwif_cmd64x,
94                 .init_dma       = init_dma_cmd64x,
95                 .channels       = 2,
96                 .autodma        = AUTODMA,
97                 .enablebits     = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
98                 .bootable       = ON_BOARD,
99                 .extra          = 0,
100         },{     /* 1 */
101                 .vendor         = PCI_VENDOR_ID_CMD,
102                 .device         = PCI_DEVICE_ID_CMD_646,
103                 .name           = "CMD646",
104                 .init_chipset   = init_chipset_cmd64x,
105                 .init_iops      = NULL,
106                 .init_hwif      = init_hwif_cmd64x,
107                 .init_dma       = init_dma_cmd64x,
108                 .channels       = 2,
109                 .autodma        = AUTODMA,
110                 .enablebits     = {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
111                 .bootable       = ON_BOARD,
112                 .extra          = 0,
113         },{     /* 2 */
114                 .vendor         = PCI_VENDOR_ID_CMD,
115                 .device = PCI_DEVICE_ID_CMD_648,
116                 .name           = "CMD648",
117                 .init_chipset   = init_chipset_cmd64x,
118                 .init_iops      = NULL,
119                 .init_hwif      = init_hwif_cmd64x,
120                 .init_dma       = init_dma_cmd64x,
121                 .channels       = 2,
122                 .autodma        = AUTODMA,
123                 .enablebits     = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
124                 .bootable       = ON_BOARD,
125                 .extra          = 0,
126         },{
127                 .vendor         = PCI_VENDOR_ID_CMD,
128                 .device         = PCI_DEVICE_ID_CMD_649,
129                 .name           = "CMD649",
130                 .init_chipset   = init_chipset_cmd64x,
131                 .init_iops      = NULL,
132                 .init_hwif      = init_hwif_cmd64x,
133                 .init_dma       = init_dma_cmd64x,
134                 .channels       = 2,
135                 .autodma        = AUTODMA,
136                 .enablebits     = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
137                 .bootable       = ON_BOARD,
138                 .extra          = 0,
139         },{
140                 .vendor         = 0,
141                 .device         = 0,
142                 .channels       = 2,
143                 .bootable       = EOL,
144         }
145 };
146
147 #endif /* CMD64X_H */