patch-2_6_7-vs1_9_1_12
[linux-2.6.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 static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *);
64 static void init_hwif_cmd64x(ide_hwif_t *);
65
66 static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
67         {       /* 0 */
68                 .name           = "CMD643",
69                 .init_chipset   = init_chipset_cmd64x,
70                 .init_hwif      = init_hwif_cmd64x,
71                 .channels       = 2,
72                 .autodma        = AUTODMA,
73                 .bootable       = ON_BOARD,
74         },{     /* 1 */
75                 .name           = "CMD646",
76                 .init_chipset   = init_chipset_cmd64x,
77                 .init_hwif      = init_hwif_cmd64x,
78                 .channels       = 2,
79                 .autodma        = AUTODMA,
80                 .enablebits     = {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
81                 .bootable       = ON_BOARD,
82         },{     /* 2 */
83                 .name           = "CMD648",
84                 .init_chipset   = init_chipset_cmd64x,
85                 .init_hwif      = init_hwif_cmd64x,
86                 .channels       = 2,
87                 .autodma        = AUTODMA,
88                 .bootable       = ON_BOARD,
89         },{
90                 .name           = "CMD649",
91                 .init_chipset   = init_chipset_cmd64x,
92                 .init_hwif      = init_hwif_cmd64x,
93                 .channels       = 2,
94                 .autodma        = AUTODMA,
95                 .bootable       = ON_BOARD,
96         }
97 };
98
99 #endif /* CMD64X_H */