From owner-p4-projects@FreeBSD.ORG Sat Aug 22 17:07:01 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9DAC01065690; Sat, 22 Aug 2009 17:07:01 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 617AF106568B for ; Sat, 22 Aug 2009 17:07:01 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 373F58FC08 for ; Sat, 22 Aug 2009 17:07:01 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7MH70AI012820 for ; Sat, 22 Aug 2009 17:07:00 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7MH70Yp012818 for perforce@freebsd.org; Sat, 22 Aug 2009 17:07:00 GMT (envelope-from mav@freebsd.org) Date: Sat, 22 Aug 2009 17:07:00 GMT Message-Id: <200908221707.n7MH70Yp012818@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Cc: Subject: PERFORCE change 167616 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2009 17:07:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=167616 Change 167616 by mav@mav_mavbook on 2009/08/22 17:06:53 Report extended capabilities register content from AHCI 1.2. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#48 edit .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.h#17 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#48 (text+ko) ==== @@ -121,7 +121,7 @@ struct ahci_controller *ctlr = device_get_softc(dev); device_t child; int error, unit, speed; - u_int32_t version, caps; + u_int32_t version, caps, caps2; ctlr->dev = dev; /* if we have a memory BAR(5) we are likely on an AHCI part */ @@ -161,6 +161,7 @@ /* Announce HW capabilities. */ version = ATA_INL(ctlr->r_mem, AHCI_VS); caps = ATA_INL(ctlr->r_mem, AHCI_CAP); + caps2 = ATA_INL(ctlr->r_mem, AHCI_CAP2); speed = (caps & AHCI_CAP_ISS) >> AHCI_CAP_ISS_SHIFT; device_printf(dev, "AHCI v%x.%02x with %d %sGbps ports, Port Multiplier %s\n", @@ -195,6 +196,10 @@ (caps & AHCI_CAP_EMS) ? " EM":"", (caps & AHCI_CAP_SXS) ? " eSATA":"", (caps & AHCI_CAP_NPMASK) + 1); + device_printf(dev, "Caps2:%s%s%s\n", + (caps2 & AHCI_CAP2_APST) ? " APST":"", + (caps2 & AHCI_CAP2_NVMP) ? " NVMP":"", + (caps2 & AHCI_CAP2_BOH) ? " BOH":""); } /* Attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { @@ -524,6 +529,7 @@ ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); ch->caps = ATA_INL(ctlr->r_mem, AHCI_CAP); + ch->caps2 = ATA_INL(ctlr->r_mem, AHCI_CAP2); ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1, resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.h#17 (text+ko) ==== @@ -176,6 +176,11 @@ #define AHCI_PI 0x0c #define AHCI_VS 0x10 +#define AHCI_CAP2 0x24 +#define AHCI_CAP2_BOH 0x00000001 +#define AHCI_CAP2_NVMP 0x00000002 +#define AHCI_CAP2_APST 0x00000004 + #define AHCI_OFFSET 0x100 #define AHCI_STEP 0x80 @@ -336,6 +341,7 @@ struct cam_sim *sim; struct cam_path *path; uint32_t caps; /* Controller capabilities */ + uint32_t caps2; /* Controller capabilities */ int numslots; /* Number of present slots */ int pm_level; /* power management level */ int sata_rev; /* Maximum allowed SATA generation */