ARC: RIP broken 64bit RTSC
authorVineet Gupta <vgupta@synopsys.com>
Sat, 7 Mar 2015 11:36:09 +0000 (17:06 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Fri, 19 Jun 2015 12:39:24 +0000 (18:09 +0530)
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/Kconfig
arch/arc/Makefile
arch/arc/configs/nsim_700_defconfig
arch/arc/configs/nsimosci_defconfig
arch/arc/configs/tb10x_defconfig
arch/arc/kernel/setup.c
arch/arc/kernel/time.c

index a35d57a9f3437e6ed4cf019ff2c4893f16530b08..8e8de4c3442ea638899bd68f983fc7e2a9f57eda 100644 (file)
@@ -311,11 +311,6 @@ config ARC_HAS_SWAPE
        bool "Insn: SWAPE (endian-swap)"
        default y
 
-config ARC_HAS_RTSC
-       bool "Insn: RTSC (64-bit r/o cycle counter)"
-       default y
-       depends on !SMP
-
 endmenu   # "ARC CPU Configuration"
 
 config LINUX_LINK_BASE
index 50bc5bc5ab74c8a15c573c3ad89a53a35386d68d..87e0e5b36ce13b970f32f78f33748cad32bdfd7e 100644 (file)
@@ -33,7 +33,7 @@ cflags-$(atleast_gcc44)                       += -fsection-anchors
 
 cflags-$(CONFIG_ARC_HAS_LLSC)          += -mlock
 cflags-$(CONFIG_ARC_HAS_SWAPE)         += -mswape
-cflags-$(CONFIG_ARC_HAS_RTSC)          += -mrtsc
+
 cflags-$(CONFIG_ARC_DW2_UNWIND)                += -fasynchronous-unwind-tables
 
 # By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok
index 281baa0b40f50e76e9b17cf83511816f1023c323..e6aa1ed09c6d7ff822967cc339bd315972005484 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_MODULES=y
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARC_PLAT_FPGA_LEGACY=y
-# CONFIG_ARC_HAS_RTSC is not set
 CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
 CONFIG_PREEMPT=y
 # CONFIG_COMPACTION is not set
index 70d0de478024a9aed5c8bacf2259cb0ea2641590..1aad2365bef89c9872d5fd87cbe9dc2fd34a21e5 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_MODULES=y
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARC_PLAT_FPGA_LEGACY=y
-# CONFIG_ARC_HAS_RTSC is not set
 CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci"
 # CONFIG_COMPACTION is not set
 CONFIG_NET=y
index 2242a06df30bd17cb67699e4b63be385c8c00616..3b4dc9cebcf15234f3d42a4efd2e40b9c5bd4150 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLOCK is not set
 CONFIG_ARC_PLAT_TB10X=y
 CONFIG_ARC_CACHE_LINE_SHIFT=5
-# CONFIG_ARC_HAS_RTSC is not set
 CONFIG_ARC_STACK_NONEXEC=y
 CONFIG_HZ=250
 CONFIG_ARC_BUILTIN_DTB_NAME="abilis_tb100_dvk"
index 1d167c6df8caae8a48d59b2aa08539e9f20b51d6..5086c75681b561e13c2db3c44124c235a000dc4b 100644 (file)
@@ -180,10 +180,9 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
                       (unsigned int)(arc_get_core_freq() / 1000000),
                       (unsigned int)(arc_get_core_freq() / 10000) % 100);
 
-       n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ",
+       n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s\nISA Extn\t: ",
                       IS_AVAIL1(cpu->timers.t0, "Timer0 "),
-                      IS_AVAIL1(cpu->timers.t1, "Timer1 "),
-                      IS_AVAIL2(cpu->timers.rtsc, "64-bit RTSC ", CONFIG_ARC_HAS_RTSC));
+                      IS_AVAIL1(cpu->timers.t1, "Timer1 "));
 
        n += i = scnprintf(buf + n, len - n, "%s%s",
                           IS_AVAIL2(atomic, "atomic ", CONFIG_ARC_HAS_LLSC));
@@ -254,9 +253,6 @@ static void arc_chk_core_config(void)
        if (!cpu->timers.t1)
                panic("Timer1 is not present!\n");
 
-       if (IS_ENABLED(CONFIG_ARC_HAS_RTSC) && !cpu->timers.rtsc)
-               panic("RTSC is not present\n");
-
 #ifdef CONFIG_ARC_HAS_DCCM
        /*
         * DCCM can be arbit placed in hardware.
index dbe74f418019bf7e498ed95bcdc08149a752ff51..9307f87f25728e63229e7b80d69b739c3cbea59b 100644 (file)
@@ -26,6 +26,7 @@
  * while TIMER1 for free running (clocksource)
  *
  * Newer ARC700 cores have 64bit clk fetching RTSC insn, preferred over TIMER1
+ * which however is currently broken
  */
 
 #include <linux/spinlock.h>
 
 /********** Clock Source Device *********/
 
-#ifdef CONFIG_ARC_HAS_RTSC
-
-int arc_counter_setup(void)
-{
-       /*
-        * For SMP this needs to be 0. However Kconfig glue doesn't
-        * enable this option for SMP configs
-        */
-       return 1;
-}
-
-static cycle_t arc_counter_read(struct clocksource *cs)
-{
-       unsigned long flags;
-       union {
-#ifdef CONFIG_CPU_BIG_ENDIAN
-               struct { u32 high, low; };
-#else
-               struct { u32 low, high; };
-#endif
-               cycle_t  full;
-       } stamp;
-
-       flags = arch_local_irq_save();
-
-       __asm__ __volatile(
-       "       .extCoreRegister tsch, 58,  r, cannot_shortcut  \n"
-       "       rtsc %0, 0      \n"
-       "       mov  %1, 0      \n"
-       : "=r" (stamp.low), "=r" (stamp.high));
-
-       arch_local_irq_restore(flags);
-
-       return stamp.full;
-}
-
-static struct clocksource arc_counter = {
-       .name   = "ARC RTSC",
-       .rating = 300,
-       .read   = arc_counter_read,
-       .mask   = CLOCKSOURCE_MASK(32),
-       .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-#else /* !CONFIG_ARC_HAS_RTSC */
-
 static bool is_usable_as_clocksource(void)
 {
 #ifdef CONFIG_SMP
@@ -139,8 +94,6 @@ static struct clocksource arc_counter = {
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-#endif
-
 /********** Clock Event Device *********/
 
 /*