aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Tripathi <stripathi@apm.com>2014-08-28 05:21:21 -0400
committerTejun Heo <tj@kernel.org>2014-09-05 22:27:14 -0400
commit0bed13bebd6c99d097796d2ca6c4f10fb5b2eabc (patch)
tree461e7ed7cfc5e7d32c5c76f6fad5218cdc01fd3f
parentc5edfff9db6f4d2c35c802acb4abe0df178becee (diff)
ahci_xgene: Skip the PHY and clock initialization if already configured by the firmware.
This patch implements the feature to skip the PHY and clock initialization if it is already configured by the firmware. Signed-off-by: Loc Ho <lho@apm.com> Signed-off-by: Suman Tripathi <stripathi@apm.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/ahci_xgene.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index c6962300b93c..37501fd0973d 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -145,6 +145,14 @@ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
145 return rc; 145 return rc;
146} 146}
147 147
148static bool xgene_ahci_is_memram_inited(struct xgene_ahci_context *ctx)
149{
150 void __iomem *diagcsr = ctx->csr_diag;
151
152 return (readl(diagcsr + CFG_MEM_RAM_SHUTDOWN) == 0 &&
153 readl(diagcsr + BLOCK_MEM_RDY) == 0xFFFFFFFF);
154}
155
148/** 156/**
149 * xgene_ahci_read_id - Read ID data from the specified device 157 * xgene_ahci_read_id - Read ID data from the specified device
150 * @dev: device 158 * @dev: device
@@ -467,6 +475,11 @@ static int xgene_ahci_probe(struct platform_device *pdev)
467 return -ENODEV; 475 return -ENODEV;
468 } 476 }
469 477
478 if (xgene_ahci_is_memram_inited(ctx)) {
479 dev_info(dev, "skip clock and PHY initialization\n");
480 goto skip_clk_phy;
481 }
482
470 /* Due to errata, HW requires full toggle transition */ 483 /* Due to errata, HW requires full toggle transition */
471 rc = ahci_platform_enable_clks(hpriv); 484 rc = ahci_platform_enable_clks(hpriv);
472 if (rc) 485 if (rc)
@@ -479,7 +492,7 @@ static int xgene_ahci_probe(struct platform_device *pdev)
479 492
480 /* Configure the host controller */ 493 /* Configure the host controller */
481 xgene_ahci_hw_init(hpriv); 494 xgene_ahci_hw_init(hpriv);
482 495skip_clk_phy:
483 hpriv->flags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_NCQ; 496 hpriv->flags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_NCQ;
484 497
485 rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info); 498 rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info);