From owner-freebsd-stable@FreeBSD.ORG Sun Jan 20 16:55:02 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01B2016A41A for ; Sun, 20 Jan 2008 16:55:02 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from frontmail.ipactive.de (frontmail.maindns.de [85.214.95.103]) by mx1.freebsd.org (Postfix) with ESMTP id 8A20013C46A for ; Sun, 20 Jan 2008 16:55:01 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from mail.vtec.ipme.de (Q7cf2.q.ppp-pool.de [89.53.124.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by frontmail.ipactive.de (Postfix) with ESMTP id B7AF012883F for ; Sun, 20 Jan 2008 17:54:53 +0100 (CET) Received: from cesar.sz.vwsoft.com (unknown [192.168.18.33]) by mail.vtec.ipme.de (Postfix) with ESMTP id 522643F43B; Sun, 20 Jan 2008 17:53:35 +0100 (CET) Message-ID: <47937CD0.8080205@vwsoft.com> Date: Sun, 20 Jan 2008 17:54:40 +0100 From: Volker User-Agent: Thunderbird 2.0.0.9 (X11/20080113) MIME-Version: 1.0 To: Jakub Siroky References: <4792BC5E.4030703@vwsoft.com> <20080120112736.5fe697c7@dev> In-Reply-To: <20080120112736.5fe697c7@dev> X-Enigmail-Version: 0.95.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit MailScanner-NULL-Check: 1201452819.46475@lD/VsUBnXAObCjTaQKX6YQ X-VWSoft-MailScanner: Found to be clean X-MailScanner-From: volker@vwsoft.com X-ipactive-MailScanner-Information: Please contact the ISP for more information X-ipactive-MailScanner: Found to be clean X-ipactive-MailScanner-From: volker@vwsoft.com Cc: freebsd-stable@freebsd.org Subject: Re: Re: patch for review: ATI SB600 SATA AHCI X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2008 16:55:02 -0000 On 12/23/-58 20:59, Jakub Siroky wrote: > Hello, > > I've been using these patches for some time with success. Although > slight correction to patches is needed - code placement changed a bit > (in case of line wrapping, see the attachments). > > --- ata-chipset.c.orig Mon Oct 9 23:01:35 2006 > +++ ata-chipset.c Wed Sep 5 22:08:02 2007 > @@ -1239,12 +1239,16 @@ > struct ata_pci_controller *ctlr = device_get_softc(dev); > struct ata_chip_id *idx; > static struct ata_chip_id ids[] = > - {{ ATA_ATI_IXP200, 0x00, 0, 0, ATA_UDMA5, "IXP200" }, > - { ATA_ATI_IXP300, 0x00, 0, 0, ATA_UDMA6, "IXP300" }, > - { ATA_ATI_IXP400, 0x00, 0, 0, ATA_UDMA6, "IXP400" }, > - { ATA_ATI_IXP300_S1, 0x00, SIIMEMIO, 0, ATA_SA150, "IXP300" }, > - { ATA_ATI_IXP400_S1, 0x00, SIIMEMIO, 0, ATA_SA150, "IXP400" }, > - { ATA_ATI_IXP400_S2, 0x00, SIIMEMIO, 0, ATA_SA150, "IXP400" }, > + {{ ATA_ATI_IXP200, 0x00, 0, 0, ATA_UDMA5, > "IXP200" }, > + { ATA_ATI_IXP300, 0x00, 0, 0, ATA_UDMA6, > "IXP300" }, > + { ATA_ATI_IXP400, 0x00, 0, 0, ATA_UDMA6, > "IXP400" }, > + { ATA_ATI_IXP600, 0x00, 0, ATISINGLE, ATA_UDMA6, > "IXP600" }, > + { ATA_ATI_IXP700, 0x00, 0, ATISINGLE, ATA_UDMA6, > "IXP700" }, > + { ATA_ATI_IXP300_S1, 0x00, SIIMEMIO, 0, ATA_SA150, > "IXP300" }, > + { ATA_ATI_IXP400_S1, 0x00, SIIMEMIO, 0, ATA_SA150, > "IXP400" }, > + { ATA_ATI_IXP400_S2, 0x00, SIIMEMIO, 0, ATA_SA150, > "IXP400" }, > + { ATA_ATI_IXP600_S1, 0x00, 0, AHCI, ATA_SA300, > "IXP600" }, > + { ATA_ATI_IXP700_S1, 0x00, 0, AHCI, ATA_SA300, > "IXP700" }, { 0, 0, 0, 0, 0, 0}}; > char buffer[64]; > > @@ -1271,6 +1275,18 @@ > > if (ata_setup_interrupt(dev)) > return ENXIO; > + > + if (ctlr->chip->cfg2 & AHCI) { > + ctlr->r_rid2 = PCIR_BAR(5); > + ctlr->r_type2 = SYS_RES_MEMORY; > + if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, > + &ctlr->r_rid2, > + RF_ACTIVE))) > + return ata_ahci_chipinit(dev); > + } > + > + if (ctlr->chip->cfg2 & ATISINGLE) > + ctlr->channels = 1; > > ctlr->setmode = ata_ati_setmode; > return 0; > > -- ata-pci.h.orig Sat Sep 30 21:51:49 2006 > +++ ata-pci.h Wed Sep 5 22:00:21 2007 > @@ -102,6 +102,10 @@ > #define ATA_ATI_IXP300_S1 0x436e1002 > #define ATA_ATI_IXP400_S1 0x43791002 > #define ATA_ATI_IXP400_S2 0x437a1002 > +#define ATA_ATI_IXP600_S1 0x43801002 > +#define ATA_ATI_IXP600 0x438c1002 > +#define ATA_ATI_IXP700_S1 0x43901002 > +#define ATA_ATI_IXP700 0x439c1002 > > #define ATA_CENATEK_ID 0x16ca > #define ATA_CENATEK_ROCKET 0x000116ca > @@ -415,6 +419,7 @@ > #define VIABUG 0x0200 > #define VIABAR 0x0400 > #define VIAAHCI 0x0800 > +#define ATISINGLE 0x1000 Jakub, I think your patch is against old code before the ATA code has been restructured. I've tried a similar patch (provided by Coleman Kane) against recent RELENG_7 but applying the patch failed. That has been the reason for me to write a new patch (at least for the chipset my notebook is using, as I don't know much about other chipsets). I've just been unsure whether or not calling ata_ahci_init is everything what is required for proper chip initialization or not but from what I was reading out of the current code, other functions don't do much more. I may include other chipset changes (from your patch) and send a new patch if my patch does not miss anything for proper operation. At least the codes changes work here for me (or I haven't noticed anything bad). @sos: can you comment on this? Volker