[V9,2/7] phy: Add drivers for PCIe and SATA phy on SPEAr13xx

Message ID CAKohpo=jRq7GaO7t7_=e-y4XFP=MaNY_GhNSGXnnkFubTMbucA@mail.gmail.com
State New
Headers show

Commit Message

Viresh Kumar July 14, 2014, 5:34 a.m.
On 14 July 2014 10:54, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> These makes sense. Will add them.

Kishon, here is how the diff looks like now:

        return 0;
@@ -121,10 +124,12 @@ static int spear1340_miphy_sata_exit(struct
spear1340_miphy_priv *priv)
        regmap_update_bits(priv->misc, SPEAR1340_PERIP1_SW_RST,
                           SPEAR1340_PERIP1_SW_RSATA,
                           SPEAR1340_PERIP1_SW_RSATA);
+       /* Wait for SATA power domain off */
        msleep(20);
        /* Switch off sata power domain */
        regmap_update_bits(priv->misc, SPEAR1340_PCM_CFG,
                           SPEAR1340_PCM_CFG_SATA_POWER_EN, 0);
+       /* Wait for SATA reset assert completion */
        msleep(20);

        return 0;

Patch

diff --git a/drivers/phy/phy-spear1340-miphy.c
b/drivers/phy/phy-spear1340-miphy.c
index 5e39231..8de98ad 100644
--- a/drivers/phy/phy-spear1340-miphy.c
+++ b/drivers/phy/phy-spear1340-miphy.c
@@ -101,10 +101,13 @@  static int spear1340_miphy_sata_init(struct
spear1340_miphy_priv *priv)
        regmap_update_bits(priv->misc, SPEAR1340_PCM_CFG,
                           SPEAR1340_PCM_CFG_SATA_POWER_EN,
                           SPEAR1340_PCM_CFG_SATA_POWER_EN);
+       /* Wait for SATA power domain on */
        msleep(20);
+
        /* Disable PCIE SATA Controller reset */
        regmap_update_bits(priv->misc, SPEAR1340_PERIP1_SW_RST,
                           SPEAR1340_PERIP1_SW_RSATA, 0);
+       /* Wait for SATA reset de-assert completion */
        msleep(20);