summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2015-05-04 17:15:29 +0800
committerYe.Li <B37916@freescale.com>2015-05-04 22:27:30 +0800
commit25a0ba04a051e5b3c03cc628c849551aa803409d (patch)
tree0661c0faae359910b28aedea7d7b658e9cdb0f15 /arch
parentcab4e299b24cb2ae3a429d7d52d9b4d9f9bfd163 (diff)
downloadu-boot-imx-25a0ba04a051e5b3c03cc628c849551aa803409d.zip
u-boot-imx-25a0ba04a051e5b3c03cc628c849551aa803409d.tar.gz
u-boot-imx-25a0ba04a051e5b3c03cc628c849551aa803409d.tar.bz2
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 2b09f5b..6c1764f 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 a50b52c..70f22b2 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
obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
diff --git a/arch/arm/cpu/armv7/mx7/timer.c b/arch/arm/imx-common/syscounter.c
index fdbf1e8..f5e5cdc 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 c9eb530..6fea6fe 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 0bb2ebe..ddb412e 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 {