From owner-freebsd-stable@FreeBSD.ORG Sun Jan 20 19:43:05 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 3DC9716A417 for ; Sun, 20 Jan 2008 19:43:05 +0000 (UTC) (envelope-from jakob@dev.citybikes.cz) Received: from dev.citybikes.cz (r5o136.net.upc.cz [86.49.14.136]) by mx1.freebsd.org (Postfix) with ESMTP id C296B13C4CC for ; Sun, 20 Jan 2008 19:43:04 +0000 (UTC) (envelope-from jakob@dev.citybikes.cz) Received: from dev.citybikes.cz (localhost [127.0.0.1]) by dev.citybikes.cz (8.14.2/8.14.2) with ESMTP id m0KJh0Pm003912 for ; Sun, 20 Jan 2008 20:43:00 +0100 (CET) (envelope-from jakob@dev.citybikes.cz) Received: (from jakob@localhost) by dev.citybikes.cz (8.14.2/8.14.2/Submit) id m0KJh0sB003911; Sun, 20 Jan 2008 20:43:00 +0100 (CET) (envelope-from jakob) Date: Sun, 20 Jan 2008 20:43:00 +0100 From: Jakub Siroky To: freebsd-stable@freebsd.org Message-ID: <20080120204300.305e3343@dev> In-Reply-To: <47937CD0.8080205@vwsoft.com> References: <4792BC5E.4030703@vwsoft.com> <20080120112736.5fe697c7@dev> <47937CD0.8080205@vwsoft.com> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: 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 19:43:05 -0000 Yes, maybe this is the same patch you've mentioned. In RELENG_7_0 I had to manually update concerned files - look up the lines and add the information at proper place. I don't understand the meaning of functions besides chipset static definitions, but it has been working on 6.2-STABLE and RELENG_7_0 without problems. On Sun, 20 Jan 2008 17:54:40 +0100 Volker wrote: > 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 > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to > "freebsd-stable-unsubscribe@freebsd.org"