summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-03-09 10:22:41 +0800
committerYe Li <ye.li@nxp.com>2016-03-25 16:15:14 +0800
commit708898fe547bd3d56f0abf7e40f1af91cf4271cf (patch)
tree2b51a3d70a1c8547cdbd8cf6d3f71a0b4f2946a8 /arch
parentc5a44a2a0b2218221cb12645b10f0b34ecc6f79b (diff)
downloadu-boot-imx-708898fe547bd3d56f0abf7e40f1af91cf4271cf.zip
u-boot-imx-708898fe547bd3d56f0abf7e40f1af91cf4271cf.tar.gz
u-boot-imx-708898fe547bd3d56f0abf7e40f1af91cf4271cf.tar.bz2
MLK-10176-6 imx: mx7: Modify GPT timer driver for mx7
Modify the GPT common platform driver for mx7 which only use 24Mhz OSC as clock source. Note: at default, the mx7d will use system counter as timer. The GPT is disabled. Signed-off-by: Ye.Li <B37916@freescale.com> (cherry picked from commit 6e250796d6a07d84093eeae96e5a6e4c593cdb0b) Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/imx-common/timer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
index 92c7218..a965d17 100644
--- a/arch/arm/imx-common/timer.c
+++ b/arch/arm/imx-common/timer.c
@@ -2,7 +2,7 @@
* (C) Copyright 2007
* Sascha Hauer, Pengutronix
*
- * (C) Copyright 2009 Freescale Semiconductor, Inc.
+ * (C) Copyright 2009-2016 Freescale Semiconductor, Inc.
*
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -50,6 +50,8 @@ static inline int gpt_has_clk_source_osc(void)
return 1;
return 0;
+#elif defined(CONFIG_MX7)
+ return 1;
#else
return 0;
#endif
@@ -57,6 +59,9 @@ static inline int gpt_has_clk_source_osc(void)
static inline ulong gpt_get_clk(void)
{
+#if defined(CONFIG_MX7)
+ return MXC_HCLK >> 3;
+#else
#ifdef CONFIG_MXC_GPT_HCLK
if (gpt_has_clk_source_osc())
return MXC_HCLK >> 3;
@@ -65,6 +70,7 @@ static inline ulong gpt_get_clk(void)
#else
return MXC_CLK32;
#endif
+#endif
}
int timer_init(void)
@@ -89,6 +95,7 @@ int timer_init(void)
if (is_cpu_type(MXC_CPU_MX6DL) ||
is_cpu_type(MXC_CPU_MX6SOLO) ||
is_cpu_type(MXC_CPU_MX6SX) ||
+ is_cpu_type(MXC_CPU_MX7D) ||
is_cpu_type(MXC_CPU_MX6UL)) {
i |= GPTCR_24MEN;