diff options
| -rw-r--r-- | drivers/ata/ahci_xgene.c | 15 |
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 | ||
| 148 | static 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 | 495 | skip_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); |
