summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-esdhc.h
diff options
context:
space:
mode:
authoryangbo lu <yangbo.lu@nxp.com>2016-12-26 17:46:30 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2017-02-13 13:20:15 +0100
commite87d2db2a2b534dad7ac0000c597b561c160880d (patch)
treec9734f8a622d35cb2b4758779fafe56cb8a6a702 /drivers/mmc/host/sdhci-esdhc.h
parentc31165d7400bb1ec12291170c9c4d072d5b0ba45 (diff)
downloadop-kernel-dev-e87d2db2a2b534dad7ac0000c597b561c160880d.zip
op-kernel-dev-e87d2db2a2b534dad7ac0000c597b561c160880d.tar.gz
mmc: sdhci-of-esdhc: avoid clock glitch when frequency is changing
The eSDHC_PRSSTAT[SDSTB] bit indicates whether the internal card clock is stable. This bit is for the host driver to poll clock status when changing the clock frequency. It is recommended to clear eSDHC_SYSCTL[SDCLKEN] to remove glitch on the card clock when the frequency is changing. This patch is to disable SDCLKEN bit before changing frequency and enable it after SDSTB bit is set. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-esdhc.h')
-rw-r--r--drivers/mmc/host/sdhci-esdhc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h
index 8cd8449..ece8b37 100644
--- a/drivers/mmc/host/sdhci-esdhc.h
+++ b/drivers/mmc/host/sdhci-esdhc.h
@@ -31,6 +31,10 @@
* eSDHC register definition
*/
+/* Present State Register */
+#define ESDHC_PRSSTAT 0x24
+#define ESDHC_CLOCK_STABLE 0x00000008
+
/* Protocol Control Register */
#define ESDHC_PROCTL 0x28
#define ESDHC_CTRL_4BITBUS (0x1 << 1)
@@ -43,6 +47,7 @@
#define ESDHC_CLOCK_MASK 0x0000fff0
#define ESDHC_PREDIV_SHIFT 8
#define ESDHC_DIVIDER_SHIFT 4
+#define ESDHC_CLOCK_SDCLKEN 0x00000008
#define ESDHC_CLOCK_PEREN 0x00000004
#define ESDHC_CLOCK_HCKEN 0x00000002
#define ESDHC_CLOCK_IPGEN 0x00000001
OpenPOWER on IntegriCloud