[U-Boot] [PATCH v5 11/13] imx: imx7d: add timer support for imx7d

Adrian Alonso aalonso at freescale.com
Tue Aug 11 18:19:59 CEST 2015


* Add timer support for imx7d SoC

Signed-off-by: Ye.Li <B37916 at freescale.com>
Signed-off-by: Peng Fan <Peng.Fan at freescale.com>
Signed-off-by: Adrian Alonso <aalonso at freescale.com>
---
Changes for V2: Split from patch imx: imx7d: initial arch level support
Changes for V3: Resend
Changes for V4: Resend
Changes for V5:
- Add Signed-off's
- Rework patch to be applied on top master

 arch/arm/imx-common/timer.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
index 1a88ce6..6099770 100644
--- a/arch/arm/imx-common/timer.c
+++ b/arch/arm/imx-common/timer.c
@@ -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
 }
 static inline unsigned long long tick_to_time(unsigned long long tick)
 {
@@ -108,7 +114,8 @@ 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_MX6UL)) {
+		    is_cpu_type(MXC_CPU_MX6UL) ||
+		    is_cpu_type(MXC_CPU_MX7D)) {
 			i |= GPTCR_24MEN;
 
 			/* Produce 3Mhz clock */
-- 
2.1.4



More information about the U-Boot mailing list