From 4b8cd55c465fb231ad64d4df704510d8eb8b6863 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Mon, 9 Mar 2015 10:22:41 +0800 Subject: 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 (cherry picked from commit 6e250796d6a07d84093eeae96e5a6e4c593cdb0b) Signed-off-by: Peng Fan (cherry picked from commit 708898fe547bd3d56f0abf7e40f1af91cf4271cf) --- arch/arm/imx-common/timer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c index ee6eff2..8b5e193 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+ */ @@ -49,6 +49,8 @@ static inline int gpt_has_clk_source_osc(void) return 1; return 0; +#elif defined(CONFIG_MX7) + return 1; #else return 0; #endif @@ -56,6 +58,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; @@ -64,6 +69,7 @@ static inline ulong gpt_get_clk(void) #else return MXC_CLK32; #endif +#endif } int timer_init(void) @@ -89,7 +95,7 @@ int timer_init(void) * Enable bit and prescaler */ if (is_mx6sdl() || is_mx6sx() || is_mx6ul() || is_mx6ull() || - is_mx6sll()) { + is_mx6sll() || is_mx7()) { i |= GPTCR_24MEN; /* Produce 3Mhz clock */ -- cgit v1.1