diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 11:38:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 11:38:26 -0400 |
commit | ac3c1c4f1c77190408162aee559c655090597072 (patch) | |
tree | 6c0e1ddbada6d6dbfb59b7f8d766dfd38b7321f1 /arch | |
parent | 5e0b3a4e88012d259e8b2c0f02f393c79686daf9 (diff) | |
parent | cfb6d656d569510ac9239583ce09e4c92ad54719 (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:
"Various clocksource driver updates: extend the core with memory mapped
hardware (mmio) support and add new (ARM) Moxart SoC and sun4i
hardware support"
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
clocksource: arch_timer: Add support for memory mapped timers
clocksource: arch_timer: Push the read/write wrappers deeper
Documentation: Add memory mapped ARM architected timer binding
clocksource: arch_timer: Pass clock event to set_mode callback
clocksource: arch_timer: Make register accessors less error-prone
ARM: clocksource: moxart: documentation: Update device tree bindings document
ARM: clocksource: moxart: Add bitops.h include
ARM: clocksource: moxart: documentation: Fix device tree bindings document
ARM: clocksource: Add support for MOXA ART SoCs
clocksource: cadence_ttc: Reuse clocksource as sched_clock
clocksource: cadence_ttc: Remove unused header
clocksource: sun4i: Fix bug when switching from periodic to oneshot modes
clocksource: sun4i: Cleanup parent clock setup
clocksource: sun4i: Remove TIMER_SCAL variable
clocksource: sun4i: Factor out some timer code
clocksource: sun4i: Fix the next event code
clocksource: sun4i: Don't forget to enable the clock we use
clocksource: sun4i: Add clocksource and sched clock drivers
clocksource: sun4i: rename AUTORELOAD define to RELOAD
clocksource: sun4i: Wrap macros arguments in parenthesis
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/arch_timer.h | 14 | ||||
-rw-r--r-- | arch/arm64/include/asm/arch_timer.h | 23 |
2 files changed, 15 insertions, 22 deletions
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h index e406d575c94f..5665134bfa3e 100644 --- a/arch/arm/include/asm/arch_timer.h +++ b/arch/arm/include/asm/arch_timer.h | |||
@@ -17,7 +17,8 @@ int arch_timer_arch_init(void); | |||
17 | * nicely work out which register we want, and chuck away the rest of | 17 | * nicely work out which register we want, and chuck away the rest of |
18 | * the code. At least it does so with a recent GCC (4.6.3). | 18 | * the code. At least it does so with a recent GCC (4.6.3). |
19 | */ | 19 | */ |
20 | static inline void arch_timer_reg_write(const int access, const int reg, u32 val) | 20 | static __always_inline |
21 | void arch_timer_reg_write_cp15(int access, enum arch_timer_reg reg, u32 val) | ||
21 | { | 22 | { |
22 | if (access == ARCH_TIMER_PHYS_ACCESS) { | 23 | if (access == ARCH_TIMER_PHYS_ACCESS) { |
23 | switch (reg) { | 24 | switch (reg) { |
@@ -28,9 +29,7 @@ static inline void arch_timer_reg_write(const int access, const int reg, u32 val | |||
28 | asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); | 29 | asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); |
29 | break; | 30 | break; |
30 | } | 31 | } |
31 | } | 32 | } else if (access == ARCH_TIMER_VIRT_ACCESS) { |
32 | |||
33 | if (access == ARCH_TIMER_VIRT_ACCESS) { | ||
34 | switch (reg) { | 33 | switch (reg) { |
35 | case ARCH_TIMER_REG_CTRL: | 34 | case ARCH_TIMER_REG_CTRL: |
36 | asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val)); | 35 | asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val)); |
@@ -44,7 +43,8 @@ static inline void arch_timer_reg_write(const int access, const int reg, u32 val | |||
44 | isb(); | 43 | isb(); |
45 | } | 44 | } |
46 | 45 | ||
47 | static inline u32 arch_timer_reg_read(const int access, const int reg) | 46 | static __always_inline |
47 | u32 arch_timer_reg_read_cp15(int access, enum arch_timer_reg reg) | ||
48 | { | 48 | { |
49 | u32 val = 0; | 49 | u32 val = 0; |
50 | 50 | ||
@@ -57,9 +57,7 @@ static inline u32 arch_timer_reg_read(const int access, const int reg) | |||
57 | asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); | 57 | asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); |
58 | break; | 58 | break; |
59 | } | 59 | } |
60 | } | 60 | } else if (access == ARCH_TIMER_VIRT_ACCESS) { |
61 | |||
62 | if (access == ARCH_TIMER_VIRT_ACCESS) { | ||
63 | switch (reg) { | 61 | switch (reg) { |
64 | case ARCH_TIMER_REG_CTRL: | 62 | case ARCH_TIMER_REG_CTRL: |
65 | asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val)); | 63 | asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val)); |
diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h index 98abd476992d..c9f1d2816c2b 100644 --- a/arch/arm64/include/asm/arch_timer.h +++ b/arch/arm64/include/asm/arch_timer.h | |||
@@ -26,7 +26,13 @@ | |||
26 | 26 | ||
27 | #include <clocksource/arm_arch_timer.h> | 27 | #include <clocksource/arm_arch_timer.h> |
28 | 28 | ||
29 | static inline void arch_timer_reg_write(int access, int reg, u32 val) | 29 | /* |
30 | * These register accessors are marked inline so the compiler can | ||
31 | * nicely work out which register we want, and chuck away the rest of | ||
32 | * the code. | ||
33 | */ | ||
34 | static __always_inline | ||
35 | void arch_timer_reg_write_cp15(int access, enum arch_timer_reg reg, u32 val) | ||
30 | { | 36 | { |
31 | if (access == ARCH_TIMER_PHYS_ACCESS) { | 37 | if (access == ARCH_TIMER_PHYS_ACCESS) { |
32 | switch (reg) { | 38 | switch (reg) { |
@@ -36,8 +42,6 @@ static inline void arch_timer_reg_write(int access, int reg, u32 val) | |||
36 | case ARCH_TIMER_REG_TVAL: | 42 | case ARCH_TIMER_REG_TVAL: |
37 | asm volatile("msr cntp_tval_el0, %0" : : "r" (val)); | 43 | asm volatile("msr cntp_tval_el0, %0" : : "r" (val)); |
38 | break; | 44 | break; |
39 | default: | ||
40 | BUILD_BUG(); | ||
41 | } | 45 | } |
42 | } else if (access == ARCH_TIMER_VIRT_ACCESS) { | 46 | } else if (access == ARCH_TIMER_VIRT_ACCESS) { |
43 | switch (reg) { | 47 | switch (reg) { |
@@ -47,17 +51,14 @@ static inline void arch_timer_reg_write(int access, int reg, u32 val) | |||
47 | case ARCH_TIMER_REG_TVAL: | 51 | case ARCH_TIMER_REG_TVAL: |
48 | asm volatile("msr cntv_tval_el0, %0" : : "r" (val)); | 52 | asm volatile("msr cntv_tval_el0, %0" : : "r" (val)); |
49 | break; | 53 | break; |
50 | default: | ||
51 | BUILD_BUG(); | ||
52 | } | 54 | } |
53 | } else { | ||
54 | BUILD_BUG(); | ||
55 | } | 55 | } |
56 | 56 | ||
57 | isb(); | 57 | isb(); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline u32 arch_timer_reg_read(int access, int reg) | 60 | static __always_inline |
61 | u32 arch_timer_reg_read_cp15(int access, enum arch_timer_reg reg) | ||
61 | { | 62 | { |
62 | u32 val; | 63 | u32 val; |
63 | 64 | ||
@@ -69,8 +70,6 @@ static inline u32 arch_timer_reg_read(int access, int reg) | |||
69 | case ARCH_TIMER_REG_TVAL: | 70 | case ARCH_TIMER_REG_TVAL: |
70 | asm volatile("mrs %0, cntp_tval_el0" : "=r" (val)); | 71 | asm volatile("mrs %0, cntp_tval_el0" : "=r" (val)); |
71 | break; | 72 | break; |
72 | default: | ||
73 | BUILD_BUG(); | ||
74 | } | 73 | } |
75 | } else if (access == ARCH_TIMER_VIRT_ACCESS) { | 74 | } else if (access == ARCH_TIMER_VIRT_ACCESS) { |
76 | switch (reg) { | 75 | switch (reg) { |
@@ -80,11 +79,7 @@ static inline u32 arch_timer_reg_read(int access, int reg) | |||
80 | case ARCH_TIMER_REG_TVAL: | 79 | case ARCH_TIMER_REG_TVAL: |
81 | asm volatile("mrs %0, cntv_tval_el0" : "=r" (val)); | 80 | asm volatile("mrs %0, cntv_tval_el0" : "=r" (val)); |
82 | break; | 81 | break; |
83 | default: | ||
84 | BUILD_BUG(); | ||
85 | } | 82 | } |
86 | } else { | ||
87 | BUILD_BUG(); | ||
88 | } | 83 | } |
89 | 84 | ||
90 | return val; | 85 | return val; |