diff options
-rw-r--r-- | drivers/scsi/sata_sil.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index 5cdcb9db3e71..81bdc10a6e95 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c | |||
@@ -56,15 +56,6 @@ enum { | |||
56 | sil_3512 = 1, | 56 | sil_3512 = 1, |
57 | sil_3114 = 2, | 57 | sil_3114 = 2, |
58 | 58 | ||
59 | SIL_FIFO_R0 = 0x40, | ||
60 | SIL_FIFO_W0 = 0x41, | ||
61 | SIL_FIFO_R1 = 0x44, | ||
62 | SIL_FIFO_W1 = 0x45, | ||
63 | SIL_FIFO_R2 = 0x240, | ||
64 | SIL_FIFO_W2 = 0x241, | ||
65 | SIL_FIFO_R3 = 0x244, | ||
66 | SIL_FIFO_W3 = 0x245, | ||
67 | |||
68 | SIL_SYSCFG = 0x48, | 59 | SIL_SYSCFG = 0x48, |
69 | SIL_MASK_IDE0_INT = (1 << 22), | 60 | SIL_MASK_IDE0_INT = (1 << 22), |
70 | SIL_MASK_IDE1_INT = (1 << 23), | 61 | SIL_MASK_IDE1_INT = (1 << 23), |
@@ -74,8 +65,6 @@ enum { | |||
74 | SIL_MASK_4PORT = SIL_MASK_2PORT | | 65 | SIL_MASK_4PORT = SIL_MASK_2PORT | |
75 | SIL_MASK_IDE2_INT | SIL_MASK_IDE3_INT, | 66 | SIL_MASK_IDE2_INT | SIL_MASK_IDE3_INT, |
76 | 67 | ||
77 | SIL_IDE2_BMDMA = 0x200, | ||
78 | |||
79 | SIL_INTR_STEERING = (1 << 1), | 68 | SIL_INTR_STEERING = (1 << 1), |
80 | SIL_QUIRK_MOD15WRITE = (1 << 0), | 69 | SIL_QUIRK_MOD15WRITE = (1 << 0), |
81 | SIL_QUIRK_UDMA5MAX = (1 << 1), | 70 | SIL_QUIRK_UDMA5MAX = (1 << 1), |
@@ -217,16 +206,17 @@ static const struct { | |||
217 | unsigned long tf; /* ATA taskfile register block */ | 206 | unsigned long tf; /* ATA taskfile register block */ |
218 | unsigned long ctl; /* ATA control/altstatus register block */ | 207 | unsigned long ctl; /* ATA control/altstatus register block */ |
219 | unsigned long bmdma; /* DMA register block */ | 208 | unsigned long bmdma; /* DMA register block */ |
209 | unsigned long fifo_cfg; /* FIFO Valid Byte Count and Control */ | ||
220 | unsigned long scr; /* SATA control register block */ | 210 | unsigned long scr; /* SATA control register block */ |
221 | unsigned long sien; /* SATA Interrupt Enable register */ | 211 | unsigned long sien; /* SATA Interrupt Enable register */ |
222 | unsigned long xfer_mode;/* data transfer mode register */ | 212 | unsigned long xfer_mode;/* data transfer mode register */ |
223 | unsigned long sfis_cfg; /* SATA FIS reception config register */ | 213 | unsigned long sfis_cfg; /* SATA FIS reception config register */ |
224 | } sil_port[] = { | 214 | } sil_port[] = { |
225 | /* port 0 ... */ | 215 | /* port 0 ... */ |
226 | { 0x80, 0x8A, 0x00, 0x100, 0x148, 0xb4, 0x14c }, | 216 | { 0x80, 0x8A, 0x00, 0x40, 0x100, 0x148, 0xb4, 0x14c }, |
227 | { 0xC0, 0xCA, 0x08, 0x180, 0x1c8, 0xf4, 0x1cc }, | 217 | { 0xC0, 0xCA, 0x08, 0x44, 0x180, 0x1c8, 0xf4, 0x1cc }, |
228 | { 0x280, 0x28A, 0x200, 0x300, 0x348, 0x2b4, 0x34c }, | 218 | { 0x280, 0x28A, 0x200, 0x240, 0x300, 0x348, 0x2b4, 0x34c }, |
229 | { 0x2C0, 0x2CA, 0x208, 0x380, 0x3c8, 0x2f4, 0x3cc }, | 219 | { 0x2C0, 0x2CA, 0x208, 0x244, 0x380, 0x3c8, 0x2f4, 0x3cc }, |
230 | /* ... port 3 */ | 220 | /* ... port 3 */ |
231 | }; | 221 | }; |
232 | 222 | ||
@@ -449,19 +439,12 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
449 | if (cls) { | 439 | if (cls) { |
450 | cls >>= 3; | 440 | cls >>= 3; |
451 | cls++; /* cls = (line_size/8)+1 */ | 441 | cls++; /* cls = (line_size/8)+1 */ |
452 | writeb(cls, mmio_base + SIL_FIFO_R0); | 442 | for (i = 0; i < probe_ent->n_ports; i++) |
453 | writeb(cls, mmio_base + SIL_FIFO_W0); | 443 | writew(cls << 8 | cls, |
454 | writeb(cls, mmio_base + SIL_FIFO_R1); | 444 | mmio_base + sil_port[i].fifo_cfg); |
455 | writeb(cls, mmio_base + SIL_FIFO_W1); | ||
456 | if (ent->driver_data == sil_3114) { | ||
457 | writeb(cls, mmio_base + SIL_FIFO_R2); | ||
458 | writeb(cls, mmio_base + SIL_FIFO_W2); | ||
459 | writeb(cls, mmio_base + SIL_FIFO_R3); | ||
460 | writeb(cls, mmio_base + SIL_FIFO_W3); | ||
461 | } | ||
462 | } else | 445 | } else |
463 | dev_printk(KERN_WARNING, &pdev->dev, | 446 | dev_printk(KERN_WARNING, &pdev->dev, |
464 | "cache line size not set. Driver may not function\n"); | 447 | "cache line size not set. Driver may not function\n"); |
465 | 448 | ||
466 | /* Apply R_ERR on DMA activate FIS errata workaround */ | 449 | /* Apply R_ERR on DMA activate FIS errata workaround */ |
467 | if (probe_ent->host_flags & SIL_FLAG_RERR_ON_DMA_ACT) { | 450 | if (probe_ent->host_flags & SIL_FLAG_RERR_ON_DMA_ACT) { |
@@ -484,10 +467,10 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
484 | irq_mask = SIL_MASK_4PORT; | 467 | irq_mask = SIL_MASK_4PORT; |
485 | 468 | ||
486 | /* flip the magic "make 4 ports work" bit */ | 469 | /* flip the magic "make 4 ports work" bit */ |
487 | tmp = readl(mmio_base + SIL_IDE2_BMDMA); | 470 | tmp = readl(mmio_base + sil_port[2].bmdma); |
488 | if ((tmp & SIL_INTR_STEERING) == 0) | 471 | if ((tmp & SIL_INTR_STEERING) == 0) |
489 | writel(tmp | SIL_INTR_STEERING, | 472 | writel(tmp | SIL_INTR_STEERING, |
490 | mmio_base + SIL_IDE2_BMDMA); | 473 | mmio_base + sil_port[2].bmdma); |
491 | 474 | ||
492 | } else { | 475 | } else { |
493 | irq_mask = SIL_MASK_2PORT; | 476 | irq_mask = SIL_MASK_2PORT; |