summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2015-05-04 17:15:29 +0800
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:29 +0100
commit0a36bb6fc95536cd48d7ed189412b1f69474e6af (patch)
tree38d119cfc15e79857e45a9adc5ae6ef5e4fe5316 /arch
parent4dcefa352b1d3b2d5bf01fe8fccead560a017470 (diff)
MLK-10808-4 imx: Move system counter driver to imx-common
Since the system counter driver will also be used by mx6ul, move this timer driver to imx-common and rename it as syscounter.c For mx6ul and mx7, configurations are used for choose the GPT timer or system counter timer (default). GPT timer: CONFIG_GPT_TIMER System counter timer: CONFIG_SYSCOUNTER_TIMER Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/mx7/Makefile2
-rw-r--r--arch/arm/imx-common/Makefile11
-rw-r--r--arch/arm/imx-common/syscounter.c (renamed from arch/arm/cpu/armv7/mx7/timer.c)2
-rw-r--r--arch/arm/imx-common/timer.c8
-rw-r--r--arch/arm/include/asm/imx-common/syscounter.h (renamed from arch/arm/include/asm/arch-mx7/timer.h)4
5 files changed, 18 insertions, 9 deletions
diff --git a/arch/arm/cpu/armv7/mx7/Makefile b/arch/arm/cpu/armv7/mx7/Makefile
index 2b09f5b081..6c1764fa9f 100644
--- a/arch/arm/cpu/armv7/mx7/Makefile
+++ b/arch/arm/cpu/armv7/mx7/Makefile
@@ -5,5 +5,5 @@
#
#
-obj-y := soc.o clock.o clock_slice.o timer.o
+obj-y := soc.o clock.o clock_slice.o
obj-$(CONFIG_SECURE_BOOT) += hab.o
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 0e9988357b..f77fcd5899 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -2,7 +2,7 @@
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
-# (C) Copyright 2011 Freescale Semiconductor, Inc.
+# (C) Copyright 2011-2015 Freescale Semiconductor, Inc.
#
# SPDX-License-Identifier: GPL-2.0+
#
@@ -11,12 +11,17 @@ ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 vf610))
obj-y = iomux-v3.o
endif
ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
-obj-y += timer.o cpu.o speed.o
+obj-y += cpu.o speed.o
obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
endif
+ifeq ($(SOC),$(filter $(SOC),mx5))
+obj-y += timer.o
+endif
ifeq ($(SOC),$(filter $(SOC),mx7))
obj-y += cpu.o
obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
+obj-$(CONFIG_GPT_TIMER) += timer.o
+obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
endif
ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs))
obj-y += misc.o
@@ -26,6 +31,8 @@ ifeq ($(SOC),$(filter $(SOC),mx6))
obj-$(CONFIG_CMD_SATA) += sata.o
obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
obj-$(CONFIG_MXC_RDC) += rdc-sema.o
+obj-$(CONFIG_GPT_TIMER) += timer.o
+obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
endif
ifeq ($(SOC),$(filter $(SOC),vf610))
obj-y += ddrmc-vf610.o
diff --git a/arch/arm/cpu/armv7/mx7/timer.c b/arch/arm/imx-common/syscounter.c
index fdbf1e835d..f5e5cdcec1 100644
--- a/arch/arm/cpu/armv7/mx7/timer.c
+++ b/arch/arm/imx-common/syscounter.c
@@ -11,7 +11,7 @@
#include <div64.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/sys_proto.h>
-#include <asm/arch/timer.h>
+#include <asm/imx-common/syscounter.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/arm/imx-common/timer.c b/arch/arm/imx-common/timer.c
index c9eb530c96..6fea6fed8a 100644
--- a/arch/arm/imx-common/timer.c
+++ b/arch/arm/imx-common/timer.c
@@ -45,7 +45,8 @@ static inline int gpt_has_clk_source_osc(void)
#if defined(CONFIG_MX6)
if (((is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) &&
(is_soc_rev(CHIP_REV_1_0) > 0)) || is_cpu_type(MXC_CPU_MX6DL) ||
- is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX))
+ is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX) ||
+ is_cpu_type(MXC_CPU_MX6UL))
return 1;
return 0;
@@ -109,11 +110,12 @@ int timer_init(void)
if (gpt_has_clk_source_osc()) {
i |= GPTCR_CLKSOURCE_OSC | GPTCR_TEN;
- /* For DL/S, SX, set 24Mhz OSC Enable bit and prescaler */
+ /* For DL/S, SX, UL, set 24Mhz OSC Enable bit and prescaler */
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_MX7D) ||
+ is_cpu_type(MXC_CPU_MX6UL)) {
i |= GPTCR_24MEN;
/* Produce 3Mhz clock */
diff --git a/arch/arm/include/asm/arch-mx7/timer.h b/arch/arm/include/asm/imx-common/syscounter.h
index 0bb2ebe582..ddb412eba5 100644
--- a/arch/arm/include/asm/arch-mx7/timer.h
+++ b/arch/arm/include/asm/imx-common/syscounter.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-#ifndef _ASM_ARCH_MX7_TIMER_H
-#define _ASM_ARCH_MX7_TIMER_H
+#ifndef _ASM_ARCH_SYSTEM_COUNTER_H
+#define _ASM_ARCH_SYSTEM_COUNTER_H
/* System Counter */
struct sctr_regs {