]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
arc: use timer driver for ARC boards
authorVlad Zakharov <vzakhar@synopsys.com>
Tue, 21 Mar 2017 11:49:49 +0000 (14:49 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Fri, 24 Mar 2017 11:47:52 +0000 (14:47 +0300)
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>
arch/Kconfig
arch/arc/lib/Makefile
arch/arc/lib/timer.c [deleted file]
configs/axs101_defconfig
configs/axs103_defconfig
include/configs/axs10x.h
include/configs/nsim.h
include/configs/tb100.h

index 76c690f6675e78eae2dfa07717d1009db6e3ec7f..308c6ead023279bf033358d0356d8e4747dc6294 100644 (file)
@@ -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"
index eb62b3c427480918ce016a24ba907606f1f2c051..12097bf3bee79e0b4588b22de35d799d5ce04aed 100644 (file)
@@ -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 (file)
index a0acbbc..0000000
+++ /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);
-}
index b2d4bcabdeacf5b994a16236b5f59aaa12d6118a..1af505d9ebc42d96dbdc7dbdf418fe3ce77699f1 100644 (file)
@@ -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
index 431eaa43c5452e9f073d6c04aa457a40128f9e25..fb8e72ff6c9ded4ec1578a50fc0a553184509862 100644 (file)
@@ -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
index d60db65fd20c1390742817f7ae2d5d4367f45e6c..768e8fbfa4230854284c599a6f5c346edc2ea01b 100644 (file)
@@ -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)
index 0cc55b7bed9f4c1e8f6fd209f3425ce4084fd9c3..d6d26c74b43b5ccfdc0789d06623b139ad3f1570 100644 (file)
@@ -9,11 +9,6 @@
 
 #include <linux/sizes.h>
 
-/*
- *  CPU configuration
- */
-#define CONFIG_SYS_TIMER_RATE          CONFIG_SYS_CLK_FREQ
-
 /*
  * Memory configuration
  */
index b7199430a5cf2dbccc8fb5f6f94da92d2fbceb87..115b3b3c5be53a627ef19836032dfba007780cfa 100644 (file)
@@ -9,11 +9,6 @@
 
 #include <linux/sizes.h>
 
-/*
- *  CPU configuration
- */
-#define CONFIG_SYS_TIMER_RATE          CONFIG_SYS_CLK_FREQ
-
 /*
  * Memory configuration
  */