summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRichard Zhu <r65037@freescale.com>2011-11-30 15:28:52 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 21:08:37 +0800
commitb06e528e7221bdd845cdd194bf010d001dc52112 (patch)
treef9e6243505827711112539ba53dcc9070502d54c /arch
parente038633a7998616457eafac7f65c6fff36981f8e (diff)
ENGR00163510 MX6Q: AHCI: One brand 1T HDD can't pwr up properly
More time is required by one brand 1T HDD, change the delay mechanism to fix it. Signed-off-by: Richard Zhu <r65037@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx6/board-mx6q_arm2.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_arm2.c b/arch/arm/mach-mx6/board-mx6q_arm2.c
index 8adf623e74eb..c80699995b21 100644
--- a/arch/arm/mach-mx6/board-mx6q_arm2.c
+++ b/arch/arm/mach-mx6/board-mx6q_arm2.c
@@ -816,7 +816,7 @@ static struct viv_gpu_platform_data imx6q_gpu_pdata __initdata = {
static int mx6q_arm2_sata_init(struct device *dev, void __iomem *addr)
{
u32 tmpdata;
- int ret = 0;
+ int ret = 0, iterations = 20;
struct clk *clk;
/* Enable SATA PWR CTRL_0 of MAX7310 */
@@ -868,12 +868,18 @@ static int mx6q_arm2_sata_init(struct device *dev, void __iomem *addr)
sata_init(addr, tmpdata);
/* Release resources when there is no device on the port */
- msleep(200);
- if ((readl(addr + PORT_SATA_SR) & 0xF) == 0) {
- dev_info(dev, "NO sata disk.\n");
- ret = -ENODEV;
- goto release_sata_clk;
- }
+ do {
+ if ((readl(addr + PORT_SATA_SR) & 0xF) == 0)
+ msleep(25);
+ else
+ break;
+
+ if (iterations == 0) {
+ dev_info(dev, "NO sata disk.\n");
+ ret = -ENODEV;
+ goto release_sata_clk;
+ }
+ } while (iterations-- > 0);
return ret;