diff options
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci.c | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index bd241767caea..e3c7b312287a 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -586,35 +586,18 @@ static void ahci_power_down(void __iomem *port_mmio, u32 cap) | |||
586 | { | 586 | { |
587 | u32 cmd, scontrol; | 587 | u32 cmd, scontrol; |
588 | 588 | ||
589 | cmd = readl(port_mmio + PORT_CMD) & ~PORT_CMD_ICC_MASK; | 589 | if (!(cap & HOST_CAP_SSS)) |
590 | 590 | return; | |
591 | if (cap & HOST_CAP_SSC) { | ||
592 | /* enable transitions to slumber mode */ | ||
593 | scontrol = readl(port_mmio + PORT_SCR_CTL); | ||
594 | if ((scontrol & 0x0f00) > 0x100) { | ||
595 | scontrol &= ~0xf00; | ||
596 | writel(scontrol, port_mmio + PORT_SCR_CTL); | ||
597 | } | ||
598 | |||
599 | /* put device into slumber mode */ | ||
600 | writel(cmd | PORT_CMD_ICC_SLUMBER, port_mmio + PORT_CMD); | ||
601 | |||
602 | /* wait for the transition to complete */ | ||
603 | ata_wait_register(port_mmio + PORT_CMD, PORT_CMD_ICC_SLUMBER, | ||
604 | PORT_CMD_ICC_SLUMBER, 1, 50); | ||
605 | } | ||
606 | 591 | ||
607 | /* put device into listen mode */ | 592 | /* put device into listen mode, first set PxSCTL.DET to 0 */ |
608 | if (cap & HOST_CAP_SSS) { | 593 | scontrol = readl(port_mmio + PORT_SCR_CTL); |
609 | /* first set PxSCTL.DET to 0 */ | 594 | scontrol &= ~0xf; |
610 | scontrol = readl(port_mmio + PORT_SCR_CTL); | 595 | writel(scontrol, port_mmio + PORT_SCR_CTL); |
611 | scontrol &= ~0xf; | ||
612 | writel(scontrol, port_mmio + PORT_SCR_CTL); | ||
613 | 596 | ||
614 | /* then set PxCMD.SUD to 0 */ | 597 | /* then set PxCMD.SUD to 0 */ |
615 | cmd &= ~PORT_CMD_SPIN_UP; | 598 | cmd = readl(port_mmio + PORT_CMD) & ~PORT_CMD_ICC_MASK; |
616 | writel(cmd, port_mmio + PORT_CMD); | 599 | cmd &= ~PORT_CMD_SPIN_UP; |
617 | } | 600 | writel(cmd, port_mmio + PORT_CMD); |
618 | } | 601 | } |
619 | 602 | ||
620 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, | 603 | static void ahci_init_port(void __iomem *port_mmio, u32 cap, |