Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2013 15:14:07 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r258173 - head/sys/dev/ahci
Message-ID:  <201311151514.rAFFE7Np058319@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Nov 15 15:14:07 2013
New Revision: 258173
URL: http://svnweb.freebsd.org/changeset/base/258173

Log:
  Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal.

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Fri Nov 15 15:08:58 2013	(r258172)
+++ head/sys/dev/ahci/ahci.c	Fri Nov 15 15:14:07 2013	(r258173)
@@ -1113,13 +1113,16 @@ ahci_ch_attach(device_t dev)
 	version = ATA_INL(ctlr->r_mem, AHCI_VS);
 	if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS))
 		ch->chcaps |= AHCI_P_CMD_FBSCP;
+	if (ch->caps2 & AHCI_CAP2_SDS)
+		ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP);
 	if (bootverbose) {
-		device_printf(dev, "Caps:%s%s%s%s%s\n",
+		device_printf(dev, "Caps:%s%s%s%s%s%s\n",
 		    (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"",
 		    (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"",
 		    (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"",
 		    (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"",
-		    (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"");
+		    (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"",
+		    (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":"");
 	}
 	/* Create the device queue for our SIM. */
 	devq = cam_simq_alloc(ch->numslots);

Modified: head/sys/dev/ahci/ahci.h
==============================================================================
--- head/sys/dev/ahci/ahci.h	Fri Nov 15 15:08:58 2013	(r258172)
+++ head/sys/dev/ahci/ahci.h	Fri Nov 15 15:14:07 2013	(r258173)
@@ -137,6 +137,7 @@
 #define         ATA_SC_IPM_NONE         0x00000000
 #define         ATA_SC_IPM_DIS_PARTIAL  0x00000100
 #define         ATA_SC_IPM_DIS_SLUMBER  0x00000200
+#define         ATA_SC_IPM_DIS_DEVSLEEP 0x00000400
 
 #define ATA_SACTIVE                     16
 
@@ -286,6 +287,17 @@
 #define 	AHCI_P_FBS_ADO_SHIFT 12
 #define 	AHCI_P_FBS_DWE      0x000f0000
 #define 	AHCI_P_FBS_DWE_SHIFT 16
+#define AHCI_P_DEVSLP               0x44
+#define 	AHCI_P_DEVSLP_ADSE  0x00000001
+#define 	AHCI_P_DEVSLP_DSP   0x00000002
+#define 	AHCI_P_DEVSLP_DETO  0x000003fc
+#define 	AHCI_P_DEVSLP_DETO_SHIFT 2
+#define 	AHCI_P_DEVSLP_MDAT  0x00007c00
+#define 	AHCI_P_DEVSLP_MDAT_SHIFT 10
+#define 	AHCI_P_DEVSLP_DITO  0x01ff8000
+#define 	AHCI_P_DEVSLP_DITO_SHIFT 15
+#define 	AHCI_P_DEVSLP_DM    0x0e000000
+#define 	AHCI_P_DEVSLP_DM_SHIFT 25
 
 /* Just to be sure, if building as module. */
 #if MAXPHYS < 512 * 1024
@@ -402,6 +414,7 @@ struct ahci_channel {
 	uint32_t		caps;		/* Controller capabilities */
 	uint32_t		caps2;		/* Controller capabilities */
 	uint32_t		chcaps;		/* Channel capabilities */
+	uint32_t		chscaps;	/* Channel sleep capabilities */
 	int			quirks;
 	int			numslots;	/* Number of present slots */
 	int			pm_level;	/* power management level */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311151514.rAFFE7Np058319>