From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 5 16:00:10 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16A6516A469 for ; Wed, 5 Sep 2007 16:00:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E58EB13C483 for ; Wed, 5 Sep 2007 16:00:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l85G09ik087793 for ; Wed, 5 Sep 2007 16:00:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l85G091g087761; Wed, 5 Sep 2007 16:00:09 GMT (envelope-from gnats) Resent-Date: Wed, 5 Sep 2007 16:00:09 GMT Resent-Message-Id: <200709051600.l85G091g087761@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pavel Gubin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62CBF16A418 for ; Wed, 5 Sep 2007 15:57:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 4FDB513C457 for ; Wed, 5 Sep 2007 15:57:29 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l85FvSwt081399 for ; Wed, 5 Sep 2007 15:57:28 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l85FvSHG081398; Wed, 5 Sep 2007 15:57:28 GMT (envelope-from nobody) Message-Id: <200709051557.l85FvSHG081398@www.freebsd.org> Date: Wed, 5 Sep 2007 15:57:28 GMT From: Pavel Gubin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/116125: ata(4) driver: support for ATi IXP600/700 PATA/SATA added X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2007 16:00:10 -0000 >Number: 116125 >Category: kern >Synopsis: ata(4) driver: support for ATi IXP600/700 PATA/SATA added >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Sep 05 16:00:09 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Pavel Gubin >Release: 6.2 (patch also apllies to -current) >Organization: TUSUR >Environment: FreeBSD hammer.2lazy.ru 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #3: Wed Sep 5 22:09:15 TSD 2007 pg@hammer.2lazy.ru:/var/data/obj/var/data/6s/src/sys/Hammer i386 >Description: The current code of ata(4) does not know about new ATi southbridges SB600/700 (IXP600/700), so this patch adds support for them. Tested on Gigabyte GA-MA69VM-S2 m/b (SB600) and 6.2R and found working. Also tested that this patch correctly applies (with some offset) to ata code from current. >How-To-Repeat: >Fix: Apply the patch attached. Patch attached with submission follows: --- 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 /* global prototypes ata-pci.c */ --- 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; >Release-Note: >Audit-Trail: >Unformatted: