diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-11 20:36:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-11 20:36:00 -0500 |
commit | 87093826aa0172d9135ca1f301c4298a258ceee6 (patch) | |
tree | c73f1db366d6f616a81c9c6a8a9611208a6c05ac /arch/arm | |
parent | 39cf275a1a18ba3c7eb9b986c5c9b35b57332798 (diff) | |
parent | ee5872befc9324fa4c2583c24d7ee7120314a2b7 (diff) |
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer changes from Ingo Molnar:
"Main changes in this cycle were:
- Updated full dynticks support.
- Event stream support for architected (ARM) timers.
- ARM clocksource driver updates.
- Move arm64 to using the generic sched_clock framework & resulting
cleanup in the generic sched_clock code.
- Misc fixes and cleanups"
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits)
x86/time: Honor ACPI FADT flag indicating absence of a CMOS RTC
clocksource: sun4i: remove IRQF_DISABLED
clocksource: sun4i: Report the minimum tick that we can program
clocksource: sun4i: Select CLKSRC_MMIO
clocksource: Provide timekeeping for efm32 SoCs
clocksource: em_sti: convert to clk_prepare/unprepare
time: Fix signedness bug in sysfs_get_uname() and its callers
timekeeping: Fix some trivial typos in comments
alarmtimer: return EINVAL instead of ENOTSUPP if rtcdev doesn't exist
clocksource: arch_timer: Do not register arch_sys_counter twice
timer stats: Add a 'Collection: active/inactive' line to timer usage statistics
sched_clock: Remove sched_clock_func() hook
arch_timer: Move to generic sched_clock framework
clocksource: tcb_clksrc: Remove IRQF_DISABLED
clocksource: tcb_clksrc: Improve driver robustness
clocksource: tcb_clksrc: Replace clk_enable/disable with clk_prepare_enable/disable_unprepare
clocksource: arm_arch_timer: Use clocksource for suspend timekeeping
clocksource: dw_apb_timer_of: Mark a few more functions as __init
clocksource: Put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrally
arm: zynq: Enable arm_global_timer
...
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/boot/dts/zynq-7000.dtsi | 8 | ||||
-rw-r--r-- | arch/arm/include/asm/arch_timer.h | 36 | ||||
-rw-r--r-- | arch/arm/include/uapi/asm/hwcap.h | 1 | ||||
-rw-r--r-- | arch/arm/kernel/arch_timer.c | 14 | ||||
-rw-r--r-- | arch/arm/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-msm/timer.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-zynq/Kconfig | 1 |
8 files changed, 43 insertions, 20 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 04163fece49f..aa8300333bc5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -54,6 +54,7 @@ config ARM | |||
54 | select HAVE_REGS_AND_STACK_ACCESS_API | 54 | select HAVE_REGS_AND_STACK_ACCESS_API |
55 | select HAVE_SYSCALL_TRACEPOINTS | 55 | select HAVE_SYSCALL_TRACEPOINTS |
56 | select HAVE_UID16 | 56 | select HAVE_UID16 |
57 | select HAVE_VIRT_CPU_ACCOUNTING_GEN | ||
57 | select IRQ_FORCED_THREADING | 58 | select IRQ_FORCED_THREADING |
58 | select KTIME_SCALAR | 59 | select KTIME_SCALAR |
59 | select MODULES_USE_ELF_REL | 60 | select MODULES_USE_ELF_REL |
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi index e32b92b949d2..e7f73b2e4550 100644 --- a/arch/arm/boot/dts/zynq-7000.dtsi +++ b/arch/arm/boot/dts/zynq-7000.dtsi | |||
@@ -92,6 +92,14 @@ | |||
92 | }; | 92 | }; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | global_timer: timer@f8f00200 { | ||
96 | compatible = "arm,cortex-a9-global-timer"; | ||
97 | reg = <0xf8f00200 0x20>; | ||
98 | interrupts = <1 11 0x301>; | ||
99 | interrupt-parent = <&intc>; | ||
100 | clocks = <&clkc 4>; | ||
101 | }; | ||
102 | |||
95 | ttc0: ttc0@f8001000 { | 103 | ttc0: ttc0@f8001000 { |
96 | interrupt-parent = <&intc>; | 104 | interrupt-parent = <&intc>; |
97 | interrupts = < 0 10 4 0 11 4 0 12 4 >; | 105 | interrupts = < 0 10 4 0 11 4 0 12 4 >; |
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h index 5665134bfa3e..0704e0cf5571 100644 --- a/arch/arm/include/asm/arch_timer.h +++ b/arch/arm/include/asm/arch_timer.h | |||
@@ -87,17 +87,43 @@ static inline u64 arch_counter_get_cntvct(void) | |||
87 | return cval; | 87 | return cval; |
88 | } | 88 | } |
89 | 89 | ||
90 | static inline void arch_counter_set_user_access(void) | 90 | static inline u32 arch_timer_get_cntkctl(void) |
91 | { | 91 | { |
92 | u32 cntkctl; | 92 | u32 cntkctl; |
93 | |||
94 | asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); | 93 | asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl)); |
94 | return cntkctl; | ||
95 | } | ||
95 | 96 | ||
96 | /* disable user access to everything */ | 97 | static inline void arch_timer_set_cntkctl(u32 cntkctl) |
97 | cntkctl &= ~((3 << 8) | (7 << 0)); | 98 | { |
98 | |||
99 | asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); | 99 | asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); |
100 | } | 100 | } |
101 | |||
102 | static inline void arch_counter_set_user_access(void) | ||
103 | { | ||
104 | u32 cntkctl = arch_timer_get_cntkctl(); | ||
105 | |||
106 | /* Disable user access to both physical/virtual counters/timers */ | ||
107 | /* Also disable virtual event stream */ | ||
108 | cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN | ||
109 | | ARCH_TIMER_USR_VT_ACCESS_EN | ||
110 | | ARCH_TIMER_VIRT_EVT_EN | ||
111 | | ARCH_TIMER_USR_VCT_ACCESS_EN | ||
112 | | ARCH_TIMER_USR_PCT_ACCESS_EN); | ||
113 | arch_timer_set_cntkctl(cntkctl); | ||
114 | } | ||
115 | |||
116 | static inline void arch_timer_evtstrm_enable(int divider) | ||
117 | { | ||
118 | u32 cntkctl = arch_timer_get_cntkctl(); | ||
119 | cntkctl &= ~ARCH_TIMER_EVT_TRIGGER_MASK; | ||
120 | /* Set the divider and enable virtual event stream */ | ||
121 | cntkctl |= (divider << ARCH_TIMER_EVT_TRIGGER_SHIFT) | ||
122 | | ARCH_TIMER_VIRT_EVT_EN; | ||
123 | arch_timer_set_cntkctl(cntkctl); | ||
124 | elf_hwcap |= HWCAP_EVTSTRM; | ||
125 | } | ||
126 | |||
101 | #endif | 127 | #endif |
102 | 128 | ||
103 | #endif | 129 | #endif |
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h index 6d34d080372a..7dcc10d67253 100644 --- a/arch/arm/include/uapi/asm/hwcap.h +++ b/arch/arm/include/uapi/asm/hwcap.h | |||
@@ -26,5 +26,6 @@ | |||
26 | #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ | 26 | #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ |
27 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) | 27 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) |
28 | #define HWCAP_LPAE (1 << 20) | 28 | #define HWCAP_LPAE (1 << 20) |
29 | #define HWCAP_EVTSTRM (1 << 21) | ||
29 | 30 | ||
30 | #endif /* _UAPI__ASMARM_HWCAP_H */ | 31 | #endif /* _UAPI__ASMARM_HWCAP_H */ |
diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c index 221f07b11ccb..1791f12c180b 100644 --- a/arch/arm/kernel/arch_timer.c +++ b/arch/arm/kernel/arch_timer.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/sched_clock.h> | ||
15 | 14 | ||
16 | #include <asm/delay.h> | 15 | #include <asm/delay.h> |
17 | 16 | ||
@@ -22,13 +21,6 @@ static unsigned long arch_timer_read_counter_long(void) | |||
22 | return arch_timer_read_counter(); | 21 | return arch_timer_read_counter(); |
23 | } | 22 | } |
24 | 23 | ||
25 | static u32 sched_clock_mult __read_mostly; | ||
26 | |||
27 | static unsigned long long notrace arch_timer_sched_clock(void) | ||
28 | { | ||
29 | return arch_timer_read_counter() * sched_clock_mult; | ||
30 | } | ||
31 | |||
32 | static struct delay_timer arch_delay_timer; | 24 | static struct delay_timer arch_delay_timer; |
33 | 25 | ||
34 | static void __init arch_timer_delay_timer_register(void) | 26 | static void __init arch_timer_delay_timer_register(void) |
@@ -48,11 +40,5 @@ int __init arch_timer_arch_init(void) | |||
48 | 40 | ||
49 | arch_timer_delay_timer_register(); | 41 | arch_timer_delay_timer_register(); |
50 | 42 | ||
51 | /* Cache the sched_clock multiplier to save a divide in the hot path. */ | ||
52 | sched_clock_mult = NSEC_PER_SEC / arch_timer_rate; | ||
53 | sched_clock_func = arch_timer_sched_clock; | ||
54 | pr_info("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n", | ||
55 | arch_timer_rate / 1000, sched_clock_mult); | ||
56 | |||
57 | return 0; | 43 | return 0; |
58 | } | 44 | } |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 0e1e2b3afa45..5d65438685d8 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -975,6 +975,7 @@ static const char *hwcap_str[] = { | |||
975 | "idivt", | 975 | "idivt", |
976 | "vfpd32", | 976 | "vfpd32", |
977 | "lpae", | 977 | "lpae", |
978 | "evtstrm", | ||
978 | NULL | 979 | NULL |
979 | }; | 980 | }; |
980 | 981 | ||
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 696fb73296d0..1e9c3383daba 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -274,7 +274,6 @@ static void __init msm_dt_timer_init(struct device_node *np) | |||
274 | pr_err("Unknown frequency\n"); | 274 | pr_err("Unknown frequency\n"); |
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | of_node_put(np); | ||
278 | 277 | ||
279 | event_base = base + 0x4; | 278 | event_base = base + 0x4; |
280 | sts_base = base + 0x88; | 279 | sts_base = base + 0x88; |
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index 04f8a4a6e755..6b04260aa142 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig | |||
@@ -13,5 +13,6 @@ config ARCH_ZYNQ | |||
13 | select HAVE_SMP | 13 | select HAVE_SMP |
14 | select SPARSE_IRQ | 14 | select SPARSE_IRQ |
15 | select CADENCE_TTC_TIMER | 15 | select CADENCE_TTC_TIMER |
16 | select ARM_GLOBAL_TIMER | ||
16 | help | 17 | help |
17 | Support for Xilinx Zynq ARM Cortex A9 Platform | 18 | Support for Xilinx Zynq ARM Cortex A9 Platform |