diff options
author | Richard Zhu <r65037@freescale.com> | 2013-11-28 14:40:42 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-06-03 23:01:53 -0500 |
commit | 71f7ba405931566f80ba6de29e4a25647e96f810 (patch) | |
tree | 0a9b168c222becac3a73bd093261d63638fa7c09 | |
parent | 4153caebff3e3ba0e66ab33997dbb569c04dc88b (diff) |
ENGR00291110 sata: can not link up after suspend resume
issue:
sata phy link down after suspend resume on imx6q TO1.3.
solution:
sata phy ref clock should be gated off/on in suspend/resume
Signed-off-by: Richard Zhu <r65037@freescale.com>
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_arm2.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_sabreauto.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_sabrelite.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_sabresd.c | 23 |
4 files changed, 92 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_arm2.c b/arch/arm/mach-mx6/board-mx6q_arm2.c index 828080565cd3..5ca47f934681 100644 --- a/arch/arm/mach-mx6/board-mx6q_arm2.c +++ b/arch/arm/mach-mx6/board-mx6q_arm2.c @@ -1357,9 +1357,32 @@ static void mx6_arm2_sata_exit(struct device *dev) } +static int imx_ahci_suspend(struct device *dev) +{ + writel((readl(IOMUXC_GPR13) & ~0x2), IOMUXC_GPR13); + clk_disable(sata_clk); + + return 0; +} + +static int imx_ahci_resume(struct device *dev) +{ + int ret; + + ret = clk_enable(sata_clk); + if (ret) + dev_err(dev, "can't enable sata clock.\n"); + + writel(((readl(IOMUXC_GPR13) & ~0x2) | 0x2), IOMUXC_GPR13); + + return 0; +} + static struct ahci_platform_data mx6_arm2_sata_data = { .init = mx6_arm2_sata_init, .exit = mx6_arm2_sata_exit, + .suspend = imx_ahci_suspend, + .resume = imx_ahci_resume, }; #endif diff --git a/arch/arm/mach-mx6/board-mx6q_sabreauto.c b/arch/arm/mach-mx6/board-mx6q_sabreauto.c index 7c1fadaf1d47..fb4fdcd41d48 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabreauto.c +++ b/arch/arm/mach-mx6/board-mx6q_sabreauto.c @@ -953,9 +953,32 @@ static void mx6q_sabreauto_sata_exit(struct device *dev) } +static int imx_ahci_suspend(struct device *dev) +{ + writel((readl(IOMUXC_GPR13) & ~0x2), IOMUXC_GPR13); + clk_disable(sata_clk); + + return 0; +} + +static int imx_ahci_resume(struct device *dev) +{ + int ret; + + ret = clk_enable(sata_clk); + if (ret) + dev_err(dev, "can't enable sata clock.\n"); + + writel(((readl(IOMUXC_GPR13) & ~0x2) | 0x2), IOMUXC_GPR13); + + return 0; +} + static struct ahci_platform_data mx6q_sabreauto_sata_data = { .init = mx6q_sabreauto_sata_init, .exit = mx6q_sabreauto_sata_exit, + .suspend = imx_ahci_suspend, + .resume = imx_ahci_resume, }; #endif diff --git a/arch/arm/mach-mx6/board-mx6q_sabrelite.c b/arch/arm/mach-mx6/board-mx6q_sabrelite.c index 1fe0f7b1c084..c4757fbda4b7 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabrelite.c +++ b/arch/arm/mach-mx6/board-mx6q_sabrelite.c @@ -757,9 +757,32 @@ static void mx6q_sabrelite_sata_exit(struct device *dev) clk_put(sata_clk); } +static int imx_ahci_suspend(struct device *dev) +{ + writel((readl(IOMUXC_GPR13) & ~0x2), IOMUXC_GPR13); + clk_disable(sata_clk); + + return 0; +} + +static int imx_ahci_resume(struct device *dev) +{ + int ret; + + ret = clk_enable(sata_clk); + if (ret) + dev_err(dev, "can't enable sata clock.\n"); + + writel(((readl(IOMUXC_GPR13) & ~0x2) | 0x2), IOMUXC_GPR13); + + return 0; +} + static struct ahci_platform_data mx6q_sabrelite_sata_data = { .init = mx6q_sabrelite_sata_init, .exit = mx6q_sabrelite_sata_exit, + .suspend = imx_ahci_suspend, + .resume = imx_ahci_resume, }; #endif diff --git a/arch/arm/mach-mx6/board-mx6q_sabresd.c b/arch/arm/mach-mx6/board-mx6q_sabresd.c index 3f9a845f3b68..b7b9babff034 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabresd.c +++ b/arch/arm/mach-mx6/board-mx6q_sabresd.c @@ -1220,9 +1220,32 @@ static void mx6q_sabresd_sata_exit(struct device *dev) clk_put(sata_clk); } +static int imx_ahci_suspend(struct device *dev) +{ + writel((readl(IOMUXC_GPR13) & ~0x2), IOMUXC_GPR13); + clk_disable(sata_clk); + + return 0; +} + +static int imx_ahci_resume(struct device *dev) +{ + int ret; + + ret = clk_enable(sata_clk); + if (ret) + dev_err(dev, "can't enable sata clock.\n"); + + writel(((readl(IOMUXC_GPR13) & ~0x2) | 0x2), IOMUXC_GPR13); + + return 0; +} + static struct ahci_platform_data mx6q_sabresd_sata_data = { .init = mx6q_sabresd_sata_init, .exit = mx6q_sabresd_sata_exit, + .suspend = imx_ahci_suspend, + .resume = imx_ahci_resume, }; #endif |