diff options
-rw-r--r-- | MAINTAINERS | 1 | ||||
-rw-r--r-- | arch/arc/Kconfig | 7 | ||||
-rw-r--r-- | arch/arc/kernel/Makefile | 2 | ||||
-rw-r--r-- | drivers/clocksource/Kconfig | 20 | ||||
-rw-r--r-- | drivers/clocksource/Makefile | 1 | ||||
-rw-r--r-- | drivers/clocksource/arc_timer.c (renamed from arch/arc/kernel/time.c) | 27 |
6 files changed, 31 insertions, 27 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 8d4148406923..34160a2dd131 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -11662,6 +11662,7 @@ S: Supported | |||
11662 | F: arch/arc/ | 11662 | F: arch/arc/ |
11663 | F: Documentation/devicetree/bindings/arc/* | 11663 | F: Documentation/devicetree/bindings/arc/* |
11664 | F: Documentation/devicetree/bindings/interrupt-controller/snps,arc* | 11664 | F: Documentation/devicetree/bindings/interrupt-controller/snps,arc* |
11665 | F: drivers/clocksource/arc_timer.c | ||
11665 | F: drivers/tty/serial/arc_uart.c | 11666 | F: drivers/tty/serial/arc_uart.c |
11666 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git | 11667 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git |
11667 | 11668 | ||
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index bde3e558d8bc..ab12723d39a0 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig | |||
@@ -8,9 +8,9 @@ | |||
8 | 8 | ||
9 | config ARC | 9 | config ARC |
10 | def_bool y | 10 | def_bool y |
11 | select ARC_TIMERS | ||
11 | select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC | 12 | select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC |
12 | select BUILDTIME_EXTABLE_SORT | 13 | select BUILDTIME_EXTABLE_SORT |
13 | select CLKSRC_OF | ||
14 | select CLONE_BACKWARDS | 14 | select CLONE_BACKWARDS |
15 | select COMMON_CLK | 15 | select COMMON_CLK |
16 | select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC) | 16 | select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC) |
@@ -115,6 +115,7 @@ config ISA_ARCOMPACT | |||
115 | 115 | ||
116 | config ISA_ARCV2 | 116 | config ISA_ARCV2 |
117 | bool "ARC ISA v2" | 117 | bool "ARC ISA v2" |
118 | select ARC_TIMERS_64BIT | ||
118 | help | 119 | help |
119 | ISA for the Next Generation ARC-HS cores | 120 | ISA for the Next Generation ARC-HS cores |
120 | 121 | ||
@@ -410,10 +411,6 @@ config ARC_HAS_DIV_REM | |||
410 | bool "Insn: div, divu, rem, remu" | 411 | bool "Insn: div, divu, rem, remu" |
411 | default y | 412 | default y |
412 | 413 | ||
413 | config ARC_TIMERS_64BIT | ||
414 | bool "64-bit r/o cycle counters RTC (up) and GFRC (smp)" | ||
415 | default y | ||
416 | |||
417 | config ARC_NUMBER_OF_INTERRUPTS | 414 | config ARC_NUMBER_OF_INTERRUPTS |
418 | int "Number of interrupts" | 415 | int "Number of interrupts" |
419 | range 8 240 | 416 | range 8 240 |
diff --git a/arch/arc/kernel/Makefile b/arch/arc/kernel/Makefile index cfcdedf52ff8..8942c5c3b4c5 100644 --- a/arch/arc/kernel/Makefile +++ b/arch/arc/kernel/Makefile | |||
@@ -8,7 +8,7 @@ | |||
8 | # Pass UTS_MACHINE for user_regset definition | 8 | # Pass UTS_MACHINE for user_regset definition |
9 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' | 9 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
10 | 10 | ||
11 | obj-y := arcksyms.o setup.o irq.o time.o reset.o ptrace.o process.o devtree.o | 11 | obj-y := arcksyms.o setup.o irq.o reset.o ptrace.o process.o devtree.o |
12 | obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o | 12 | obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o disasm.o |
13 | obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o | 13 | obj-$(CONFIG_ISA_ARCOMPACT) += entry-compact.o intc-compact.o |
14 | obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o | 14 | obj-$(CONFIG_ISA_ARCV2) += entry-arcv2.o intc-arcv2.o |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index e2c6e43cf8ca..4866f7aa32e6 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
@@ -282,6 +282,26 @@ config CLKSRC_MPS2 | |||
282 | select CLKSRC_MMIO | 282 | select CLKSRC_MMIO |
283 | select CLKSRC_OF | 283 | select CLKSRC_OF |
284 | 284 | ||
285 | config ARC_TIMERS | ||
286 | bool "Support for 32-bit TIMERn counters in ARC Cores" if COMPILE_TEST | ||
287 | depends on GENERIC_CLOCKEVENTS | ||
288 | select CLKSRC_OF | ||
289 | help | ||
290 | These are legacy 32-bit TIMER0 and TIMER1 counters found on all ARC cores | ||
291 | (ARC700 as well as ARC HS38). | ||
292 | TIMER0 serves as clockevent while TIMER1 provides clocksource | ||
293 | |||
294 | config ARC_TIMERS_64BIT | ||
295 | bool "Support for 64-bit counters in ARC HS38 cores" if COMPILE_TEST | ||
296 | depends on GENERIC_CLOCKEVENTS | ||
297 | depends on ARC_TIMERS | ||
298 | select CLKSRC_OF | ||
299 | help | ||
300 | This enables 2 different 64-bit timers: RTC (for UP) and GFRC (for SMP) | ||
301 | RTC is implemented inside the core, while GFRC sits outside the core in | ||
302 | ARConnect IP block. Driver automatically picks one of them for clocksource | ||
303 | as appropriate. | ||
304 | |||
285 | config ARM_ARCH_TIMER | 305 | config ARM_ARCH_TIMER |
286 | bool | 306 | bool |
287 | select CLKSRC_OF if OF | 307 | select CLKSRC_OF if OF |
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index cf87f407f1ad..a14111e1f087 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile | |||
@@ -51,6 +51,7 @@ obj-$(CONFIG_CLKSRC_TI_32K) += timer-ti-32k.o | |||
51 | obj-$(CONFIG_CLKSRC_NPS) += timer-nps.o | 51 | obj-$(CONFIG_CLKSRC_NPS) += timer-nps.o |
52 | obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o | 52 | obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o |
53 | 53 | ||
54 | obj-$(CONFIG_ARC_TIMERS) += arc_timer.o | ||
54 | obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o | 55 | obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o |
55 | obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o | 56 | obj-$(CONFIG_ARM_GLOBAL_TIMER) += arm_global_timer.o |
56 | obj-$(CONFIG_ARMV7M_SYSTICK) += armv7m_systick.o | 57 | obj-$(CONFIG_ARMV7M_SYSTICK) += armv7m_systick.o |
diff --git a/arch/arc/kernel/time.c b/drivers/clocksource/arc_timer.c index 94b9cd169374..a49748d826c0 100644 --- a/arch/arc/kernel/time.c +++ b/drivers/clocksource/arc_timer.c | |||
@@ -1,32 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2016-17 Synopsys, Inc. (www.synopsys.com) | ||
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | 3 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 6 | * it under the terms of the GNU General Public License version 2 as |
6 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
7 | * | ||
8 | * vineetg: Jan 1011 | ||
9 | * -sched_clock( ) no longer jiffies based. Uses the same clocksource | ||
10 | * as gtod | ||
11 | * | ||
12 | * Rajeshwarr/Vineetg: Mar 2008 | ||
13 | * -Implemented CONFIG_GENERIC_TIME (rather deleted arch specific code) | ||
14 | * for arch independent gettimeofday() | ||
15 | * -Implemented CONFIG_GENERIC_CLOCKEVENTS as base for hrtimers | ||
16 | * | ||
17 | * Vineetg: Mar 2008: Forked off from time.c which now is time-jiff.c | ||
18 | */ | 8 | */ |
19 | 9 | ||
20 | /* ARC700 has two 32bit independent prog Timers: TIMER0 and TIMER1 | 10 | /* ARC700 has two 32bit independent prog Timers: TIMER0 and TIMER1, Each can be |
21 | * Each can programmed to go from @count to @limit and optionally | 11 | * programmed to go from @count to @limit and optionally interrupt. |
22 | * interrupt when that happens. | 12 | * We've designated TIMER0 for clockevents and TIMER1 for clocksource |
23 | * A write to Control Register clears the Interrupt | ||
24 | * | ||
25 | * We've designated TIMER0 for events (clockevents) | ||
26 | * while TIMER1 for free running (clocksource) | ||
27 | * | 13 | * |
28 | * Newer ARC700 cores have 64bit clk fetching RTSC insn, preferred over TIMER1 | 14 | * ARCv2 based HS38 cores have RTC (in-core) and GFRC (inside ARConnect/MCIP) |
29 | * which however is currently broken | 15 | * which are suitable for UP and SMP based clocksources respectively |
30 | */ | 16 | */ |
31 | 17 | ||
32 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
@@ -37,7 +23,6 @@ | |||
37 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
38 | #include <linux/of.h> | 24 | #include <linux/of.h> |
39 | #include <linux/of_irq.h> | 25 | #include <linux/of_irq.h> |
40 | #include <asm/irq.h> | ||
41 | 26 | ||
42 | #include <soc/arc/timers.h> | 27 | #include <soc/arc/timers.h> |
43 | #include <soc/arc/mcip.h> | 28 | #include <soc/arc/mcip.h> |