From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 19 13:27:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59B11065670; Tue, 19 Jan 2010 13:27:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB7188FC16; Tue, 19 Jan 2010 13:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JDRsPk002254; Tue, 19 Jan 2010 13:27:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JDRsNA002252; Tue, 19 Jan 2010 13:27:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001191327.o0JDRsNA002252@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Jan 2010 13:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202622 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 13:27:54 -0000 Author: mav Date: Tue Jan 19 13:27:54 2010 New Revision: 202622 URL: http://svn.freebsd.org/changeset/base/202622 Log: MFC r201993: Report which of IXP700 legacy ATA channels are SATA. Modified: stable/8/sys/dev/ata/chipsets/ata-ati.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ati.c Tue Jan 19 13:26:45 2010 (r202621) +++ stable/8/sys/dev/ata/chipsets/ata-ati.c Tue Jan 19 13:27:54 2010 (r202622) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ati_chipinit(device_t dev); +static int ata_ati_ixp700_ch_attach(device_t dev); static int ata_ati_setmode(device_t dev, int target, int mode); /* misc defines */ @@ -121,7 +122,7 @@ ata_ati_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); device_t smbdev; - int satacfg; + uint8_t satacfg; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; @@ -145,13 +146,16 @@ ata_ati_chipinit(device_t dev) (satacfg & 0x01) == 0 ? "disabled" : "enabled", (satacfg & 0x08) == 0 ? "" : "combined mode, ", (satacfg & 0x10) == 0 ? "primary" : "secondary"); - + ctlr->chipset_data = (void *)(uintptr_t)satacfg; /* * If SATA controller is enabled but combined mode is disabled, * we have only one PATA channel. Ignore a non-existent channel. */ if ((satacfg & 0x09) == 0x01) ctlr->ichannels &= ~(1 << ((satacfg & 0x10) >> 4)); + else { + ctlr->ch_attach = ata_ati_ixp700_ch_attach; + } } break; } @@ -161,6 +165,23 @@ ata_ati_chipinit(device_t dev) } static int +ata_ati_ixp700_ch_attach(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + uint8_t satacfg = (uint8_t)(uintptr_t)ctlr->chipset_data; + + /* Setup the usual register normal pci style. */ + if (ata_pci_ch_attach(dev)) + return ENXIO; + + /* One of channels is PATA, another is SATA. */ + if (ch->unit == ((satacfg & 0x10) >> 4)) + ch->flags |= ATA_SATA; + return (0); +} + +static int ata_ati_setmode(device_t dev, int target, int mode) { device_t parent = device_get_parent(dev);