]> git.sur5r.net Git - u-boot/commitdiff
sata: wait for device updating signature to host
authorDave Liu <r63238@freescale.com>
Tue, 3 Jun 2008 09:38:19 +0000 (17:38 +0800)
committerWolfgang Denk <wd@denx.de>
Mon, 30 Jun 2008 20:13:47 +0000 (22:13 +0200)
The driver need wait for the device updating signature to host.
If we don't wait for it, the driver can not detect the device(disk)
when the system powers up.

Signed-off-by: Dave Liu <daveliu@freescale.com>
drivers/block/fsl_sata.c

index d14f5bc6bf8e5de12f78cbe38df1159147d37e7d..d441a30ed511b184f5019905c419456623f24c1a 100644 (file)
@@ -248,6 +248,10 @@ int init_sata(int dev)
        else
                printf("       %s ", sata->name);
 
+       /* Wait PHY RDY signal changed for 500ms */
+       ata_wait_register(&reg->hstatus, HSTATUS_PHY_RDY,
+                         HSTATUS_PHY_RDY, 500);
+
        /* Check PHYRDY */
        val32 = in_le32(&reg->hstatus);
        if (val32 & HSTATUS_PHY_RDY) {
@@ -258,6 +262,10 @@ int init_sata(int dev)
                return -1;
        }
 
+       /* Wait for signature updated, which is 1st D2H */
+       ata_wait_register(&reg->hstatus, HSTATUS_SIGNATURE,
+                         HSTATUS_SIGNATURE, 10000);
+
        if (val32 & HSTATUS_SIGNATURE) {
                sig = in_le32(&reg->sig);
                debug("Signature updated, the sig =%08x\n\r", sig);