From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 19 18:30:10 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C01516A41F for ; Thu, 19 Jan 2006 18:30:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DE5843D5E for ; Thu, 19 Jan 2006 18:30:06 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0JIU5iO016199 for ; Thu, 19 Jan 2006 18:30:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0JIU5I3016197; Thu, 19 Jan 2006 18:30:05 GMT (envelope-from gnats) Resent-Date: Thu, 19 Jan 2006 18:30:05 GMT Resent-Message-Id: <200601191830.k0JIU5I3016197@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, Dominic pageau Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B22316A41F for ; Thu, 19 Jan 2006 18:28:50 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3C1843D70 for ; Thu, 19 Jan 2006 18:28:49 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k0JISnw8057737 for ; Thu, 19 Jan 2006 18:28:49 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k0JISnRb057736; Thu, 19 Jan 2006 18:28:49 GMT (envelope-from nobody) Message-Id: <200601191828.k0JISnRb057736@www.freebsd.org> Date: Thu, 19 Jan 2006 18:28:49 GMT From: Dominic pageau To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: kern/92016: SATA Disk not detected on Dell PowerEdge 850 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: Thu, 19 Jan 2006 18:30:10 -0000 >Number: 92016 >Category: kern >Synopsis: SATA Disk not detected on Dell PowerEdge 850 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 19 18:30:05 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Dominic pageau >Release: FreeBSD 6 RELEASE >Organization: >Environment: >Description: Just filling a PR to make sure PATCH or FIX will be commited to CURRENT. See discussion on freebsd-current list "Problems Installing to PowerEdge 850 with SATA Drive" and pfsense-support "Trouble installing to Dell PowerEdge 850" Lynn A. Roth writes: I have two new Dell Poweredge 850 machines. They have an Intel ICH7 chipset. When I boot FreeBSD 6 RC1, the controller is identified, but any drives connected to the SATA ports are not detected. The drive that is included with the system is a Seagate 7200.7 drive. I also tried a Maxtor. >How-To-Repeat: Try to Install 6-RELEASE on Dell PowerEdge 850 >Fix: Doug Ambrisko post a patch on Freebsd-current list Here's a hack to make it work on PE850: Index: ata-chipset.c =================================================================== RCS file: /usr/local/cvsroot/freebsd/src/sys/dev/ata/ata-chipset.c,v retrieving revision 1.136 diff -u -p -r1.136 ata-chipset.c --- ata-chipset.c 12 Oct 2005 20:00:26 -0000 1.136 +++ ata-chipset.c 7 Nov 2005 18:30:22 -0000 @@ -236,15 +236,35 @@ ata_sata_setmode(device_t dev, int mode) static int ata_sata_connect(struct ata_channel *ch) { - u_int32_t status; - int timeout; + u_int32_t status, error; + int timeout, device; + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(ch->dev)); + int something_there = 0; + + if (ctlr->chip->chipid == ATA_I82801GB_S1) { + status = ATA_IDX_INL(ch, ATA_SSTATUS); + error = ATA_IDX_INL(ch, ATA_SERROR); + if (status == (ATA_SS_DET_DEV_PRESENT | ATA_SS_DET_PHY_OFFLINE) || + status == (ATA_SS_DET_PHY_ONLINE | ATA_SS_SPD_GEN1 | ATA_SS_IPM_ACTIVE)) { + /* reset port */ + device = 1 << (ch->unit + 1); + pci_write_config(ch->dev, 0x92, + pci_read_config(ch->dev, 0x92, 2) & ~device, 2); + pci_write_config(ch->dev, 0x92, + pci_read_config(ch->dev, 0x92, 2) & ~device, 2); + } + } /* wait up to 1 second for "connect well" */ for (timeout = 0; timeout < 100 ; timeout++) { status = ATA_IDX_INL(ch, ATA_SSTATUS); + error = ATA_IDX_INL(ch, ATA_SERROR); + ATA_IDX_OUTL(ch, ATA_SERROR, error); if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1 || - (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) - break; + (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) { + something_there = 1; + break; + } ata_udelay(10000); } if (timeout >= 100) { @@ -267,7 +287,7 @@ ata_sata_connect(struct ata_channel *ch) } if (bootverbose) device_printf(ch->dev, "SATA connect ready time=%dms\n", timeout * 10); - if (timeout < 1000) { + if (something_there || timeout < 1000) { if ((ATA_IDX_INB(ch, ATA_CYL_LSB) == ATAPI_MAGIC_LSB) && (ATA_IDX_INB(ch, ATA_CYL_MSB) == ATAPI_MAGIC_MSB)) ch->devices = ATA_ATAPI_MASTER; @@ -1657,6 +1677,12 @@ ata_intel_chipinit(device_t dev) /* force all ports active "the legacy way" */ pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0f,2); + if (ctlr->chip->chipid == ATA_I82801GB_S1) { + /* enable AHCI register compat mode */ + pci_write_config(dev, 0x94, pci_read_config(dev, 0x94, 4) | 1 << 9, 4); + ATA_OUTL(ctlr->r_res2, 0x0C, ATA_INL(ctlr->r_res2, 0x0C) | 0xf); + } + /* enable AHCI mode */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC, ATA_AHCI_GHC_AE); @@ -1845,10 +1871,13 @@ ata_intel_reset(device_t dev) struct ata_channel *ch = device_get_softc(dev); int mask, timeout; - /* ICH6 has 4 SATA ports as master/slave on 2 channels so deal with pairs */ + /* ICH6/7 has 4 SATA ports as master/slave on 2 channels so deal with pairs */ if (ctlr->chip->chipid == ATA_I82801FB_S1 || ctlr->chip->chipid == ATA_I82801FB_R1 || - ctlr->chip->chipid == ATA_I82801FB_M) { + ctlr->chip->chipid == ATA_I82801FB_M || + ctlr->chip->chipid == ATA_I82801GB_S1 || + ctlr->chip->chipid == ATA_I82801GB_R1 || + ctlr->chip->chipid == ATA_I82801GB_M) { mask = (0x0005 << ch->unit); } else { >Release-Note: >Audit-Trail: >Unformatted: