summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Liu <r63238@freescale.com>2008-06-03 17:38:19 +0800
committerWolfgang Denk <wd@denx.de>2008-06-30 22:13:47 +0200
commit9810263afec5ac5f38f92963bb3b6d799e4331d0 (patch)
treea7ae97193158e5a9d916141ac11ef1a3f9e5f1f9
parent8b616edb118e37d05f6401389eaee1c636b22828 (diff)
downloadu-boot-imx-9810263afec5ac5f38f92963bb3b6d799e4331d0.zip
u-boot-imx-9810263afec5ac5f38f92963bb3b6d799e4331d0.tar.gz
u-boot-imx-9810263afec5ac5f38f92963bb3b6d799e4331d0.tar.bz2
sata: wait for device updating signature to host
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>
-rw-r--r--drivers/block/fsl_sata.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
index d14f5bc..d441a30 100644
--- a/drivers/block/fsl_sata.c
+++ b/drivers/block/fsl_sata.c
@@ -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);