diff options
author | Shane Huang <shane.huang@amd.com> | 2012-09-07 10:40:01 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2012-09-13 01:08:53 -0400 |
commit | 65fe1f0f66a57380229a4ced844188103135f37b (patch) | |
tree | eb96e6c8de3bf8c4697618c8ee1dce4bd6d6a9ea /drivers/ata/ahci.h | |
parent | 583661a89ed2e484bd295e7b4606099340478c38 (diff) |
ahci: implement aggressive SATA device sleep support
Device Sleep is a feature as described in AHCI 1.3.1 Technical Proposal.
This feature enables an HBA and SATA storage device to enter the DevSleep
interface state, enabling lower power SATA-based systems.
Aggressive Device Sleep enables the HBA to assert the DEVSLP signal as
soon as there are no commands outstanding to the device and the port
specific Device Sleep idle timer has expired. This enables autonomous
entry into the DevSleep interface state without waiting for software
in power sensitive systems.
This patch enables Aggressive Device Sleep only if both host controller
and device support it.
Tested on AMD reference board together with Device Sleep supported device
sample.
Signed-off-by: Shane Huang <shane.huang@amd.com>
Reviewed-by: Aaron Lu <aaron.lwe@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/ahci.h')
-rw-r--r-- | drivers/ata/ahci.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 57eb1c212a4c..6441cbecfa1d 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
@@ -115,6 +115,9 @@ enum { | |||
115 | HOST_CAP2_BOH = (1 << 0), /* BIOS/OS handoff supported */ | 115 | HOST_CAP2_BOH = (1 << 0), /* BIOS/OS handoff supported */ |
116 | HOST_CAP2_NVMHCI = (1 << 1), /* NVMHCI supported */ | 116 | HOST_CAP2_NVMHCI = (1 << 1), /* NVMHCI supported */ |
117 | HOST_CAP2_APST = (1 << 2), /* Automatic partial to slumber */ | 117 | HOST_CAP2_APST = (1 << 2), /* Automatic partial to slumber */ |
118 | HOST_CAP2_SDS = (1 << 3), /* Support device sleep */ | ||
119 | HOST_CAP2_SADM = (1 << 4), /* Support aggressive DevSlp */ | ||
120 | HOST_CAP2_DESO = (1 << 5), /* DevSlp from slumber only */ | ||
118 | 121 | ||
119 | /* registers for each SATA port */ | 122 | /* registers for each SATA port */ |
120 | PORT_LST_ADDR = 0x00, /* command list DMA addr */ | 123 | PORT_LST_ADDR = 0x00, /* command list DMA addr */ |
@@ -133,6 +136,7 @@ enum { | |||
133 | PORT_SCR_ACT = 0x34, /* SATA phy register: SActive */ | 136 | PORT_SCR_ACT = 0x34, /* SATA phy register: SActive */ |
134 | PORT_SCR_NTF = 0x3c, /* SATA phy register: SNotification */ | 137 | PORT_SCR_NTF = 0x3c, /* SATA phy register: SNotification */ |
135 | PORT_FBS = 0x40, /* FIS-based Switching */ | 138 | PORT_FBS = 0x40, /* FIS-based Switching */ |
139 | PORT_DEVSLP = 0x44, /* device sleep */ | ||
136 | 140 | ||
137 | /* PORT_IRQ_{STAT,MASK} bits */ | 141 | /* PORT_IRQ_{STAT,MASK} bits */ |
138 | PORT_IRQ_COLD_PRES = (1 << 31), /* cold presence detect */ | 142 | PORT_IRQ_COLD_PRES = (1 << 31), /* cold presence detect */ |
@@ -186,6 +190,7 @@ enum { | |||
186 | PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */ | 190 | PORT_CMD_ICC_PARTIAL = (0x2 << 28), /* Put i/f in partial state */ |
187 | PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */ | 191 | PORT_CMD_ICC_SLUMBER = (0x6 << 28), /* Put i/f in slumber state */ |
188 | 192 | ||
193 | /* PORT_FBS bits */ | ||
189 | PORT_FBS_DWE_OFFSET = 16, /* FBS device with error offset */ | 194 | PORT_FBS_DWE_OFFSET = 16, /* FBS device with error offset */ |
190 | PORT_FBS_ADO_OFFSET = 12, /* FBS active dev optimization offset */ | 195 | PORT_FBS_ADO_OFFSET = 12, /* FBS active dev optimization offset */ |
191 | PORT_FBS_DEV_OFFSET = 8, /* FBS device to issue offset */ | 196 | PORT_FBS_DEV_OFFSET = 8, /* FBS device to issue offset */ |
@@ -194,6 +199,15 @@ enum { | |||
194 | PORT_FBS_DEC = (1 << 1), /* FBS device error clear */ | 199 | PORT_FBS_DEC = (1 << 1), /* FBS device error clear */ |
195 | PORT_FBS_EN = (1 << 0), /* Enable FBS */ | 200 | PORT_FBS_EN = (1 << 0), /* Enable FBS */ |
196 | 201 | ||
202 | /* PORT_DEVSLP bits */ | ||
203 | PORT_DEVSLP_DM_OFFSET = 25, /* DITO multiplier offset */ | ||
204 | PORT_DEVSLP_DM_MASK = (0xf << 25), /* DITO multiplier mask */ | ||
205 | PORT_DEVSLP_DITO_OFFSET = 15, /* DITO offset */ | ||
206 | PORT_DEVSLP_MDAT_OFFSET = 10, /* Minimum assertion time */ | ||
207 | PORT_DEVSLP_DETO_OFFSET = 2, /* DevSlp exit timeout */ | ||
208 | PORT_DEVSLP_DSP = (1 << 1), /* DevSlp present */ | ||
209 | PORT_DEVSLP_ADSE = (1 << 0), /* Aggressive DevSlp enable */ | ||
210 | |||
197 | /* hpriv->flags bits */ | 211 | /* hpriv->flags bits */ |
198 | 212 | ||
199 | #define AHCI_HFLAGS(flags) .private_data = (void *)(flags) | 213 | #define AHCI_HFLAGS(flags) .private_data = (void *)(flags) |