Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jan 2014 22:55:21 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r260353 - stable/10/sys/dev/ahci
Message-ID:  <201401052255.s05MtLlX019188@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Jan  5 22:55:21 2014
New Revision: 260353
URL: http://svnweb.freebsd.org/changeset/base/260353

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

Modified:
  stable/10/sys/dev/ahci/ahci.c
  stable/10/sys/dev/ahci/ahci.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/ahci/ahci.c
==============================================================================
--- stable/10/sys/dev/ahci/ahci.c	Sun Jan  5 22:53:55 2014	(r260352)
+++ stable/10/sys/dev/ahci/ahci.c	Sun Jan  5 22:55:21 2014	(r260353)
@@ -1087,13 +1087,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: stable/10/sys/dev/ahci/ahci.h
==============================================================================
--- stable/10/sys/dev/ahci/ahci.h	Sun Jan  5 22:53:55 2014	(r260352)
+++ stable/10/sys/dev/ahci/ahci.h	Sun Jan  5 22:55:21 2014	(r260353)
@@ -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?201401052255.s05MtLlX019188>