[PATCH] Silicon image 3114 SATA link (really basic support)

From: Mickael Marchand
Date: Fri Dec 05 2003 - 13:08:39 EST


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

here it is ;) (for 2.6.0-test11)
it includes patches in siimage.c but it did not work IIRC (lost interrupt).
(don't compile siimage inside the kernel, it would not boot)

enjoy,

cheers,
Mik

Le Friday 05 December 2003 18:47, Jeff Garzik a écrit :
> Mickael Marchand wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi,
> >
> > as I was too impatient, I wrote a quick hack for it.
> > Now I can see my drives on the 3114 controller.
> > RAID does not seem to work but I can access my SATA drives in normal
> > mode.
> >
> > hdparm gives a 57 Mb/s output.
> > I had no error/crash/corruption, it appears to work correctly.
> >
> > It works on 2.4.23 and 2.6.0-test11 with libata.
> > basically, you just need to add the PCI id for 3114 just like 3112 in
> > sata_sil.c, load the module and enjoy.
> > I presume 3112 and 3114 chips are mostly identical.
> >
> > I have tested this on 2 Tyan motherboards with Sil 3114 inside
> >
> > I can generate a patch in a few moments if you want it.
>
> Yes, a tested patch would be great, thanks!
>
> Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/0MlPyOYzc4nQ8j0RAtFpAJ4hemZoIMnFcBjBXYjGD/uCXJ3d/QCfbjT6
KigiRN0fY1PPveJIiJyKCdE=
=KemZ
-----END PGP SIGNATURE-----
diff -ru linux-2.6.0-test11.orig/drivers/ide/pci/siimage.c linux-2.6.0-test11/drivers/ide/pci/siimage.c
--- linux-2.6.0-test11.orig/drivers/ide/pci/siimage.c 2003-11-26 20:43:35.000000000 +0000
+++ linux-2.6.0-test11/drivers/ide/pci/siimage.c 2003-12-05 15:44:28.000000000 +0000
@@ -55,6 +55,7 @@
switch(pdev->device)
{
case PCI_DEVICE_ID_SII_3112:
+ case PCI_DEVICE_ID_SII_3114:
case PCI_DEVICE_ID_SII_1210SA:
return 1;
case PCI_DEVICE_ID_SII_680:
@@ -1178,6 +1179,7 @@
static struct pci_device_id siimage_pci_tbl[] = {
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+ { PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_1210SA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ 0, },
};
diff -ru linux-2.6.0-test11.orig/drivers/ide/pci/siimage.h linux-2.6.0-test11/drivers/ide/pci/siimage.h
--- linux-2.6.0-test11.orig/drivers/ide/pci/siimage.h 2003-11-26 20:44:17.000000000 +0000
+++ linux-2.6.0-test11/drivers/ide/pci/siimage.h 2003-12-05 15:46:50.000000000 +0000
@@ -13,7 +13,7 @@
#undef SIIMAGE_BUFFERED_TASKFILE
#undef SIIMAGE_LARGE_DMA

-#define SII_DEBUG 0
+#define SII_DEBUG 1

#if SII_DEBUG
#define siiprintk(x...) printk(x)
@@ -72,6 +72,18 @@
.extra = 0,
},{ /* 2 */
.vendor = PCI_VENDOR_ID_CMD,
+ .device = PCI_DEVICE_ID_SII_3114,
+ .name = "SiI3114 Serial ATA",
+ .init_chipset = init_chipset_siimage,
+ .init_iops = init_iops_siimage,
+ .init_hwif = init_hwif_siimage,
+ .channels = 2,
+ .autodma = AUTODMA,
+ .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
+ .bootable = ON_BOARD,
+ .extra = 0,
+ },{ /* 3 */
+ .vendor = PCI_VENDOR_ID_CMD,
.device = PCI_DEVICE_ID_SII_1210SA,
.name = "Adaptec AAR-1210SA",
.init_chipset = init_chipset_siimage,
diff -ru linux-2.6.0-test11.orig/drivers/scsi/Kconfig linux-2.6.0-test11/drivers/scsi/Kconfig
--- linux-2.6.0-test11.orig/drivers/scsi/Kconfig 2003-11-26 20:45:32.000000000 +0000
+++ linux-2.6.0-test11/drivers/scsi/Kconfig 2003-12-05 15:54:20.000000000 +0000
@@ -441,7 +441,7 @@

config SCSI_SATA_SIL
tristate "Silicon Image SATA support"
- depends on SCSI_SATA && PCI && BROKEN
+ depends on SCSI_SATA && PCI
help
This option enables support for Silicon Image Serial ATA.

diff -ru linux-2.6.0-test11.orig/drivers/scsi/sata_sil.c linux-2.6.0-test11/drivers/scsi/sata_sil.c
--- linux-2.6.0-test11.orig/drivers/scsi/sata_sil.c 2003-11-26 20:42:46.000000000 +0000
+++ linux-2.6.0-test11/drivers/scsi/sata_sil.c 2003-12-05 15:50:32.000000000 +0000
@@ -39,6 +39,7 @@

enum {
sil_3112 = 0,
+ sil_3114 = 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, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 },
{ } /* terminate list */
};

@@ -119,6 +121,14 @@
.pio_mask = 0x03, /* pio3-4 */
.udma_mask = 0x7f, /* udma0-6; FIXME */
.port_ops = &sil_ops,
+ }, /* sil_3114 */
+ {
+ .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,
},
};

diff -ru linux-2.6.0-test11.orig/include/linux/pci_ids.h linux-2.6.0-test11/include/linux/pci_ids.h
--- linux-2.6.0-test11.orig/include/linux/pci_ids.h 2003-11-26 20:43:39.000000000 +0000
+++ linux-2.6.0-test11/include/linux/pci_ids.h 2003-12-05 15:48:28.000000000 +0000
@@ -882,6 +882,7 @@

#define PCI_DEVICE_ID_SII_680 0x0680
#define PCI_DEVICE_ID_SII_3112 0x3112
+#define PCI_DEVICE_ID_SII_3114 0x3114
#define PCI_DEVICE_ID_SII_1210SA 0x0240

#define PCI_VENDOR_ID_VISION 0x1098