From 23b6a131fdae9fdd995e10cf43eec82536d434a7 Mon Sep 17 00:00:00 2001
From: Stefan Agner <stefan.agner@toradex.com>
Date: Fri, 5 Jan 2018 15:08:18 +0100
Subject: [PATCH] imx: introduce CONFIG_GPT_TIMER

Introduce a new config symbol to select the i.MX
General Purpose Timer (GPT).

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 arch/arm/mach-imx/Kconfig     | 3 +++
 arch/arm/mach-imx/Makefile    | 3 ++-
 arch/arm/mach-imx/mx5/Kconfig | 1 +
 arch/arm/mach-imx/mx6/Kconfig | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 653819123c7..3aec89d440a 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -10,6 +10,9 @@ config ROM_UNIFIED_SECTIONS
 config SYSCOUNTER_TIMER
 	bool
 
+config GPT_TIMER
+	bool
+
 config IMX_RDC
 	bool "i.MX Resource domain controller driver"
 	depends on ARCH_MX6 || ARCH_MX7
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index d77c10e1768..9322c1ce835 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -11,7 +11,8 @@ 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_GPT_TIMER) += timer.o
 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs))
diff --git a/arch/arm/mach-imx/mx5/Kconfig b/arch/arm/mach-imx/mx5/Kconfig
index 250194b6231..3ce6bcfc889 100644
--- a/arch/arm/mach-imx/mx5/Kconfig
+++ b/arch/arm/mach-imx/mx5/Kconfig
@@ -1,6 +1,7 @@
 if ARCH_MX5
 
 config MX5
+	select GPT_TIMER
 	bool
 	default y
 
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 2552a50bddf..89444320447 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -9,6 +9,7 @@ config MX6_SMP
 
 config MX6
 	select ARM_ERRATA_743622 if !MX6UL && !MX6ULL
+	select GPT_TIMER
 	bool
 	default y
 	imply CMD_FUSE
-- 
GitLab