31 #include <linux/kernel.h>
32 #include <linux/module.h>
33 #include <linux/pci.h>
41 #define DRV_NAME "pata_cs5535"
42 #define DRV_VERSION "0.2.12"
49 #define MSR_ATAC_BASE 0x51300000
50 #define ATAC_GLD_MSR_CAP (MSR_ATAC_BASE+0)
51 #define ATAC_GLD_MSR_CONFIG (MSR_ATAC_BASE+0x01)
52 #define ATAC_GLD_MSR_SMI (MSR_ATAC_BASE+0x02)
53 #define ATAC_GLD_MSR_ERROR (MSR_ATAC_BASE+0x03)
54 #define ATAC_GLD_MSR_PM (MSR_ATAC_BASE+0x04)
55 #define ATAC_GLD_MSR_DIAG (MSR_ATAC_BASE+0x05)
56 #define ATAC_IO_BAR (MSR_ATAC_BASE+0x08)
57 #define ATAC_RESET (MSR_ATAC_BASE+0x10)
58 #define ATAC_CH0D0_PIO (MSR_ATAC_BASE+0x20)
59 #define ATAC_CH0D0_DMA (MSR_ATAC_BASE+0x21)
60 #define ATAC_CH0D1_PIO (MSR_ATAC_BASE+0x22)
61 #define ATAC_CH0D1_DMA (MSR_ATAC_BASE+0x23)
62 #define ATAC_PCI_ABRTERR (MSR_ATAC_BASE+0x24)
64 #define ATAC_BM0_CMD_PRIM 0x00
65 #define ATAC_BM0_STS_PRIM 0x02
66 #define ATAC_BM0_PRD 0x04
68 #define CS5535_CABLE_DETECT 0x48
78 static int cs5535_cable_detect(
struct ata_port *ap)
100 static const u16 pio_timings[5] = {
101 0xF7F4, 0xF173, 0x8141, 0x5131, 0x1131
103 static const u16 pio_cmd_timings[5] = {
104 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131
115 cmdmode =
min(mode, pairmode);
117 if (cmdmode < pairmode)
119 pio_cmd_timings[cmdmode] << 16 | pio_timings[pairmode], 0);
123 pio_cmd_timings[cmdmode] << 16 | pio_timings[mode], 0);
139 static const u32 udma_timings[5] = {
140 0x7F7436A1, 0x7F733481, 0x7F723261, 0x7F713161, 0x7F703061
142 static const u32 mwdma_timings[3] = {
143 0x7F0FFFF3, 0x7F035352, 0x7F024241
162 .inherits = &ata_bmdma_port_ops,
163 .cable_detect = cs5535_cable_detect,
164 .set_piomode = cs5535_set_piomode,
165 .set_dmamode = cs5535_set_dmamode,
185 .port_ops = &cs5535_port_ops
189 return ata_pci_bmdma_init_one(dev, ppi, &cs5535_sht,
NULL, 0);
199 static struct pci_driver cs5535_pci_driver = {
202 .probe = cs5535_init_one,
203 .remove = ata_pci_remove_one,
205 .suspend = ata_pci_device_suspend,
206 .resume = ata_pci_device_resume,
212 MODULE_AUTHOR(
"Alan Cox, Jens Altmann, Wolfgan Zuleger, Alexander Kiausch");