Re: [PATCH] adaptec 1210sa

From: Jeff Garzik
Date: Tue Dec 30 2003 - 19:21:55 EST


Mickael Marchand wrote:
reading linux-scsi I found a suggestion by Justin to make adaptec's 1210 sa working. I made the corresponding patch for libata, and it actually works :)

it needs some redesign to only apply to aar1210 (as standard sil3112 does not need it) and I guess some testing before inclusion.


Here is the patch I'm applying. Please test and let me know how it goes.

Also, someone please send me a patch for the PCI ids :)

Jeff


===== drivers/scsi/sata_sil.c 1.3 vs edited =====
--- 1.3/drivers/scsi/sata_sil.c Tue Dec 16 19:16:55 2003
+++ edited/drivers/scsi/sata_sil.c Tue Dec 30 19:11:02 2003
@@ -40,6 +40,10 @@
enum {
sil_3112 = 0,

+ SIL_SYSCFG = 0x48,
+ SIL_MASK_IDE0_INT = (1 << 22),
+ SIL_MASK_IDE1_INT = (1 << 23),
+
SIL_IDE0_TF = 0x80,
SIL_IDE0_CTL = 0x8A,
SIL_IDE0_BMDMA = 0x00,
@@ -236,6 +240,7 @@
unsigned long base;
void *mmio_base;
int rc;
+ u32 tmp;

if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
@@ -295,6 +300,14 @@
probe_ent->port[1].bmdma_addr = base + SIL_IDE1_BMDMA;
probe_ent->port[1].scr_addr = base + SIL_IDE1_SCR;
ata_std_ports(&probe_ent->port[1]);
+
+ /* make sure IDE0/1 interrupts are not masked */
+ tmp = readl(mmio_base + SIL_SYSCFG);
+ if (tmp & (SIL_MASK_IDE0_INT | SIL_MASK_IDE1_INT)) {
+ tmp &= ~(SIL_MASK_IDE0_INT | SIL_MASK_IDE1_INT);
+ writel(tmp, mmio_base + SIL_SYSCFG);
+ readl(mmio_base + SIL_SYSCFG); /* flush */
+ }

pci_set_master(pdev);