Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2003 11:50:30 +0100 (CET)
From:      Soeren Schmidt <sos@spider.deepcore.dk>
To:        der_julian@web.de
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: SiS5591(?) ATA
Message-ID:  <200303161050.h2GAoVor048801@spider.deepcore.dk>
In-Reply-To: <XFMail.20030315212945.der_julian@web.de>

next in thread | previous in thread | raw e-mail | index | archive | help
It seems der_julian@web.de wrote:
> On 15-Mar-2003 Soeren Schmidt wrote:
> >> atapci0: <SiS 961 UDMA100 controller> port 0xff00-0xff0f at device 2.5 on
> >> pci0
> >> ata0: at 0x1f0 irq 14 on atapci0
> >> ata1: at 0x170 irq 15 on atapci0
> >> ad0: DMA limited to UDMA33, non-ATA66 cable or device
> >> ad0: 78533MB <IC35L080AVVA07-0> [159560/16/63] at ata0-master UDMA33
> >> ad1: DMA limited to UDMA33, non-ATA66 cable or device
> >> ad1: 39266MB <IC35L040AVER07-0> [79780/16/63] at ata0-slave UDMA33
> >> ata1-master: DMA limited to UDMA33, non-ATA66 cable or device
> >> acd0: DVD-R <MATSHITADVD-RAM SW-9571> at ata1-master UDMA33
> 
> ata0: at 0x1f0 irq 14 on atapci0
> ata1: at 0x170 irq 15 on atapci0
> ad0: DMA limited to UDMA33, non-ATA66 cable or device
> ad0: 38166MB <ST340823A> [77545/16/63] at ata0-master UDMA33

Could I have you both try this patch and mail me the entire output og
dmesg with it applied ? (patch against a clean -current)

Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.14
diff -u -r1.14 ata-chipset.c
--- ata-chipset.c	12 Mar 2003 15:45:52 -0000	1.14
+++ ata-chipset.c	16 Mar 2003 10:49:02 -0000
@@ -95,8 +95,8 @@
 static void ata_sis_setmode(struct ata_device *, int);
 static int ata_mode2idx(int);
 static int ata_check_80pin(struct ata_device *, int);
-static int ata_find_dev(device_t, u_int32_t, u_int32_t);
-static struct ata_chip_id *ata_match_chip(device_t, struct ata_chip_id *);
+static int ata_find_dev(device_t, u_int32_t, u_int32_t, int);
+static struct ata_chip_id *ata_match_chip(device_t, struct ata_chip_id *, int);
 static int ata_default_interrupt(device_t);
 static void ata_pci_serialize(struct ata_channel *, int);
 
@@ -171,7 +171,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64]; 
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -321,7 +321,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64]; 
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -428,7 +428,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64]; 
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -601,7 +601,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -768,7 +768,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64]; 
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -887,7 +887,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -944,7 +944,7 @@
     char *desc, buffer[64];
     uintptr_t devid = 0;
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     /* if we are on a SuperTrak SX6000 dont attach */
@@ -1188,7 +1188,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -1276,7 +1276,7 @@
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -1489,9 +1489,9 @@
      { ATA_SIS646, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 645DX" },/* ext south */
      { ATA_SIS645, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 645" },	/* ext south */
      { ATA_SIS640, 0x00, SIS_SOUTH, 0, ATA_UDMA4, "SiS 640" },	/* ext south */
-     { ATA_SIS635, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 635" },	/* unknown */
+     { ATA_SIS635, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 635" },	/* 1chip */
      { ATA_SIS633, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 633" },	/* unknown */
-     { ATA_SIS630, 0x30, SIS100NEW, 0, ATA_UDMA5, "SiS 630S" }, /* 1chip */
+     { ATA_SIS630, 0x30, SIS100OLD, 0, ATA_UDMA5, "SiS 630S" }, /* 1chip */
      { ATA_SIS630, 0x00, SIS66,	    0, ATA_UDMA4, "SiS 630" },	/* 1chip */
      { ATA_SIS620, 0x00, SIS66,	    0, ATA_UDMA4, "SiS 620" },	/* 1chip */
 
@@ -1501,7 +1501,7 @@
      { 0, 0, 0, 0, 0, 0 }};
     char buffer[64];
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, -1))) 
 	return ENXIO;
 
     if (idx->cfg1 == SIS_SOUTH) {
@@ -1511,7 +1511,7 @@
 	    sprintf(buffer, "SiS 96X %s controller",ata_mode2str(idx->max_dma));
 	}
 	else {
-	    if (ata_find_dev(dev, ATA_SISSOUTH, 0x10))
+	    if (ata_find_dev(dev, ATA_SISSOUTH, 0x10, pci_get_slot(dev)))
 		idx->cfg1 = SIS133OLD;
 	    else {
 		idx->max_dma = ATA_UDMA5;
@@ -1544,6 +1544,7 @@
 	break;
     case SIS100NEW:
     case SIS133OLD:
+printf("0 reg 0x48=%02x\n", pci_read_config(dev, 0x48, 1));
 	pci_write_config(dev, 0x49, pci_read_config(dev, 0x49, 1) | 0x01, 1);
 	break;
     case SIS133NEW:
@@ -1576,6 +1577,7 @@
 	}
     }
     else {
+printf("1 reg 0x48=%02x\n", pci_read_config(dev, 0x48, 1));
 	if (mode > ATA_UDMA2 &&
 	    pci_read_config(parent, 0x48, 1) & atadev->channel->unit?0x20:0x10){
 		ata_prtdev(atadev,
@@ -1659,7 +1661,7 @@
      { 0, 0, 0, 0, 0, 0 }};
     char buffer[64];
 
-    if (!(idx = ata_match_chip(dev, ids))) 
+    if (!(idx = ata_match_chip(dev, ids, pci_get_slot(dev)))) 
 	return ENXIO;
 
     sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma));
@@ -1808,16 +1810,16 @@
 }
 
 static int
-ata_find_dev(device_t dev, u_int32_t devid, u_int32_t revid)
+ata_find_dev(device_t dev, u_int32_t devid, u_int32_t revid, int slot)
 {
     device_t *children;
-    int nchildren, i, slot = pci_get_slot(dev);
+    int nchildren, i;
 
     if (device_get_children(device_get_parent(dev), &children, &nchildren))
 	return 0;
 
     for (i = 0; i < nchildren; i++) {
-	if (pci_get_slot(children[i]) == slot &&
+	if (((slot >= 0 && pci_get_slot(children[i]) == slot) || slot < 0) &&
 	    pci_get_devid(children[i]) == devid &&
 	    pci_get_revid(children[i]) >= revid) {
 	    free(children, M_TEMP);
@@ -1829,10 +1831,10 @@
 }
 
 static struct ata_chip_id *
-ata_match_chip(device_t dev, struct ata_chip_id *index)
+ata_match_chip(device_t dev, struct ata_chip_id *index, int slot)
 {
     while (index->chiptype != 0) {
-	if (ata_find_dev(dev, index->chiptype, index->chiprev))
+	if (ata_find_dev(dev, index->chiptype, index->chiprev, slot))
 	    return index;
 	index++;
     }
-Søren

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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