Re: [PATCH] adaptec 1210sa

Mickael Marchand
2003-12-31T11:26:00Z

[-- Attachment #1: Type: Text/Plain, Size: 1003 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I can't test atm, I will test it in a few days.

here is the patch I used (the previous one was incomplete - diffed against the
wrong file-), it includes the PCI ids you need.

Cheers,
Mik

Le Wednesday 31 December 2003 01:20, vous avez écrit :
> 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/8rI2yOYzc4nQ8j0RAkLnAJ9PuvWKuQNTszOEajMBOKrDiR1WiwCaA2Wl
ASO6sogwJ696le2lvrwZyhI=
=bLBK
-----END PGP SIGNATURE-----

[-- Attachment #2: aar1210sa.diff --]
[-- Type: text/x-diff, Size: 1278 bytes --]

--- linux-2.4.23/drivers/scsi/sata_sil.c 2003-12-31 12:22:36.000000000 +0100
+++ linux-2.4.23.moria/drivers/scsi/sata_sil.c 2003-12-22 12:03:57.000000000 +0100
@@ -39,6 +39,7 @@

enum {
sil_3112 = 0,
+ aar1210sa = 1,

SIL_IDE0_TF = 0x80,
SIL_IDE0_CTL = 0x8A,
@@ -62,6 +63,7 @@

static struct pci_device_id sil_pci_tbl[] = {
{ 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
+ { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, aar1210sa },
{ } /* terminate list */
};

@@ -122,6 +124,15 @@
.udma_mask = 0x7f, /* udma0-6; FIXME */
.port_ops = &sil_ops,
},
+ /* aar1210sa */
+ {
+ .sht = &sil_sht,
+ .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_SRST | ATA_FLAG_MMIO,
+ .pio_mask = 0x03, /* pio3-4 */
+ .udma_mask = 0x7f, /* udma0-6; FIXME */
+ .port_ops = &sil_ops,
+ },
};

MODULE_AUTHOR("Jeff Garzik");
@@ -263,6 +274,15 @@
goto err_out_regions;
}

+ u8 v;
+ pci_read_config_byte(pdev, 0x8a, &v);
+ int mask = 0x3f; //clear 6 and 7 bits
+ if (v & ~mask) {
+ printk("Reenabling interrupts because Adaptec's BIOS disables them\n" );
+ v &= mask;
+ pci_write_config_byte(pdev, 0x8a, v);
+ }
+
memset(probe_ent, 0, sizeof(*probe_ent));
INIT_LIST_HEAD(&probe_ent->node);
probe_ent->pdev = pdev;