summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Zakharov <vzakhar@synopsys.com>2017-03-21 14:49:49 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2017-03-24 14:47:52 +0300
commit3daa7c7b831ddeed0e490a899710a58691ee20c3 (patch)
tree0d7bfbccd9a92bc5484e48ac707f3fccd9275916
parent0c77092e8163c716b637cffe681e4556db17ac31 (diff)
arc: use timer driver for ARC boards
This commit replaces legacy timer code with usage of arc timer driver. It removes arch/arc/lib/time.c file and selects CONFIG_CLK, CONFIG_TIMER and CONFIG_ARC_TIMER options for all ARC boards by default. Therefore we remove CONFIG_CLK option from less common axs101 and axs103 defconfigs. Also it removes legacy CONFIG_SYS_TIMER_RATE config symbol from axs10x.h, tb100.h and nsim.h configs files as it is no longer required. Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/Kconfig3
-rw-r--r--arch/arc/lib/Makefile1
-rw-r--r--arch/arc/lib/timer.c24
-rw-r--r--configs/axs101_defconfig1
-rw-r--r--configs/axs103_defconfig1
-rw-r--r--include/configs/axs10x.h2
-rw-r--r--include/configs/nsim.h5
-rw-r--r--include/configs/tb100.h5
8 files changed, 3 insertions, 39 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 76c690f667..308c6ead02 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -13,6 +13,9 @@ config ARC
select HAVE_PRIVATE_LIBGCC
select SUPPORT_OF_CONTROL
select ARCH_EARLY_INIT_R
+ select CLK
+ select TIMER
+ select ARC_TIMER
config ARM
bool "ARM architecture"
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index eb62b3c427..12097bf3be 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -18,7 +18,6 @@ obj-y += memcmp.o
obj-y += memcpy-700.o
obj-y += memset.o
obj-y += reset.o
-obj-y += timer.o
obj-y += ints_low.o
obj-y += init_helpers.o
diff --git a/arch/arc/lib/timer.c b/arch/arc/lib/timer.c
deleted file mode 100644
index a0acbbc01a..0000000000
--- a/arch/arc/lib/timer.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <asm/arcregs.h>
-
-#define NH_MODE (1 << 1) /* Disable timer if CPU is halted */
-
-int timer_init(void)
-{
- write_aux_reg(ARC_AUX_TIMER0_CTRL, NH_MODE);
- /* Set max value for counter/timer */
- write_aux_reg(ARC_AUX_TIMER0_LIMIT, 0xffffffff);
- /* Set initial count value and restart counter/timer */
- write_aux_reg(ARC_AUX_TIMER0_CNT, 0);
- return 0;
-}
-
-unsigned long timer_read_counter(void)
-{
- return read_aux_reg(ARC_AUX_TIMER0_CNT);
-}
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index b2d4bcabde..1af505d9eb 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -19,7 +19,6 @@ CONFIG_OF_CONTROL=y
CONFIG_OF_EMBED=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DM=y
-CONFIG_CLK=y
CONFIG_SYS_I2C_DW=y
CONFIG_MMC=y
CONFIG_MMC_DW=y
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index 431eaa43c5..fb8e72ff6c 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -18,7 +18,6 @@ CONFIG_OF_CONTROL=y
CONFIG_OF_EMBED=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_DM=y
-CONFIG_CLK=y
CONFIG_SYS_I2C_DW=y
CONFIG_MMC=y
CONFIG_MMC_DW=y
diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h
index d60db65fd2..768e8fbfa4 100644
--- a/include/configs/axs10x.h
+++ b/include/configs/axs10x.h
@@ -11,8 +11,6 @@
/*
* CPU configuration
*/
-#define CONFIG_SYS_TIMER_RATE CONFIG_SYS_CLK_FREQ
-
#define ARC_FPGA_PERIPHERAL_BASE 0xE0000000
#define ARC_APB_PERIPHERAL_BASE 0xF0000000
#define ARC_DWMMC_BASE (ARC_FPGA_PERIPHERAL_BASE + 0x15000)
diff --git a/include/configs/nsim.h b/include/configs/nsim.h
index 0cc55b7bed..d6d26c74b4 100644
--- a/include/configs/nsim.h
+++ b/include/configs/nsim.h
@@ -10,11 +10,6 @@
#include <linux/sizes.h>
/*
- * CPU configuration
- */
-#define CONFIG_SYS_TIMER_RATE CONFIG_SYS_CLK_FREQ
-
-/*
* Memory configuration
*/
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index b7199430a5..115b3b3c5b 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -10,11 +10,6 @@
#include <linux/sizes.h>
/*
- * CPU configuration
- */
-#define CONFIG_SYS_TIMER_RATE CONFIG_SYS_CLK_FREQ
-
-/*
* Memory configuration
*/
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE