From owner-freebsd-current@FreeBSD.ORG Tue Mar 16 02:43:18 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B432C16A4CE for ; Tue, 16 Mar 2004 02:43:18 -0800 (PST) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 486C343D5C for ; Tue, 16 Mar 2004 02:43:17 -0800 (PST) (envelope-from sos@DeepCore.dk) Received: from DeepCore.dk (csc-gw1.novi.dk [130.225.63.24]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i2GAgwgb003586; Tue, 16 Mar 2004 11:43:14 +0100 (CET) (envelope-from sos@DeepCore.dk) Message-ID: <4056DA2F.6050807@DeepCore.dk> Date: Tue, 16 Mar 2004 11:42:55 +0100 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6b) Gecko/20040126 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: FUJITA Kazutoshi 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> In-Reply-To: <20040316.173025.71134083.fujita@soum.co.jp> Content-Type: multipart/mixed; boundary="------------070504040901060204060205" X-mail-scanned: by DeepCore Virus & Spam killer v1.4 cc: freebsd-current@freebsd.org Subject: Re: SiS5591(?) ATA X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2004 10:43:18 -0000 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 > 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--