Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Mar 2004 11:42:55 +0100
From:      =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@DeepCore.dk>
To:        FUJITA Kazutoshi <fujita@soum.co.jp>
Cc:        freebsd-current@freebsd.org
Subject:   Re: SiS5591(?) ATA
Message-ID:  <4056DA2F.6050807@DeepCore.dk>
In-Reply-To: <20040316.173025.71134083.fujita@soum.co.jp>
References:  <20030317.013632.74750761.fujita@soum.co.jp> <20040316.151052.41674971.fujita@soum.co.jp>	<4056B91F.8090505@DeepCore.dk> <20040316.173025.71134083.fujita@soum.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070504040901060204060205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

FUJITA Kazutoshi wrote:
> From: Søren Schmidt <sos@DeepCore.dk>
> Subject: Re: SiS5591(?) ATA
> Date: Tue, 16 Mar 2004 09:21:51 +0100
> Message-ID: <4056B91F.8090505@DeepCore.dk>
> 
>>I need a *complete* dmesg and the *complete* output of pciconf -l to 
>>tell what is wrong. 
> ok, attach them.

OK, I see the problem, please try the attached patch and let me know if 
that solves the problem...

-- 
-Søren


--------------070504040901060204060205
Content-Type: text/plain;
 name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diff"

Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.65
diff -u -r1.65 ata-chipset.c
--- ata-chipset.c	15 Mar 2004 12:03:47 -0000	1.65
+++ ata-chipset.c	16 Mar 2004 10:41:10 -0000
@@ -1655,8 +1655,10 @@
 	    ctlr->channels = 4;
 
 	ctlr->allocate = ata_sii_mio_allocate;
-	if (ctlr->chip->max_dma >= ATA_SA150)
+	if (ctlr->chip->max_dma >= ATA_SA150) {
+	    ctlr->locking = ata_serialize;
 	    ctlr->setmode = ata_sata_setmode;
+	}
 	else
 	    ctlr->setmode = ata_sii_setmode;
     }
@@ -1953,26 +1955,36 @@
      { ATA_SIS530,  0x00, SIS66,     0, ATA_UDMA4, "SiS 530" },
 
      { ATA_SIS5513, 0xc2, SIS33,     0, ATA_UDMA2, "SiS 5513" },
-     { ATA_SIS5513, 0x00, SIS33,     1, ATA_WDMA2, "SiS 5513" },
+     { ATA_SIS5513, 0x00, SIS33,     0, ATA_WDMA2, "SiS 5513" },
      { 0, 0, 0, 0, 0, 0 }};
     char buffer[64];
+    int found = 0;
 
     if (!(idx = ata_find_chip(dev, ids, -pci_get_slot(dev)))) 
 	return ENXIO;
 
-    if (idx->cfg2) {
-	pci_write_config(dev, 0x57, pci_read_config(dev, 0x57, 1) & 0x7f, 1);
-	if (pci_read_config(dev, 0x00, 4) == ATA_SIS5518) {
+    if (!found) {
+	u_int8_t reg57 = pci_read_config(dev, 0x57, 1);
+
+	pci_write_config(dev, 0x57, (reg57 & 0x7f), 1);
+	if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == ATA_SIS5518) {
+	    found = 1;
 	    idx->cfg1 = SIS133NEW;
 	    idx->max_dma = ATA_UDMA6;
 	    sprintf(buffer, "SiS 962/963 %s controller",
 		    ata_mode2str(idx->max_dma));
 	}
-	else {
+	pci_write_config(dev, 0x57, reg57, 1);
+    }
+    if (!found) {
+	u_int8_t reg4a = pci_read_config(dev, 0x4a, 1);
+
+	pci_write_config(dev, 0x4a, (reg4a | 0x10), 1);
+	if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == ATA_SIS5517) {
 	    struct ata_chip_id id[] =
-		{{ ATA_SISSOUTH, 0x10, 0, 0, ATA_UDMA6, "SiS 961" },
-		 { 0, 0, 0, 0, 0, 0 }};
+		{{ ATA_SISSOUTH, 0x10, 0, 0, 0, "" }, { 0, 0, 0, 0, 0, 0 }};
 
+	    found = 1;
 	    if (ata_find_chip(dev, id, pci_get_slot(dev))) {
 		idx->cfg1 = SIS133OLD;
 		idx->max_dma = ATA_UDMA6;
@@ -1983,10 +1995,11 @@
 	    }
 	    sprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma));
 	}
-	pci_write_config(dev, 0x57, pci_read_config(dev, 0x57, 1) | 0x80, 1);
+	pci_write_config(dev, 0x4a, reg4a, 1);
     }
-    else
+    if (!found)
 	sprintf(buffer,"%s %s controller",idx->text,ata_mode2str(idx->max_dma));
+
     device_set_desc_copy(dev, buffer);
     ctlr->chip = idx;
     ctlr->chipinit = ata_sis_chipinit;
Index: ata-pci.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.h,v
retrieving revision 1.27
diff -u -r1.27 ata-pci.h
--- ata-pci.h	15 Mar 2004 12:03:47 -0000	1.27
+++ ata-pci.h	16 Mar 2004 10:39:58 -0000
@@ -176,6 +176,7 @@
 #define ATA_SISSOUTH		0x00081039
 #define ATA_SIS5511		0x55111039
 #define ATA_SIS5513		0x55131039
+#define ATA_SIS5517		0x55171039
 #define ATA_SIS5518		0x55181039
 #define ATA_SIS5571		0x55711039
 #define ATA_SIS5591		0x55911039

--------------070504040901060204060205--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4056DA2F.6050807>