aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2013-06-17 04:29:43 -0400
committerChris Zankel <chris@zankel.net>2013-07-08 04:11:37 -0400
commite504c4b6076d9ec1caccaac65803fe3fc29afec8 (patch)
tree9a068eafb50e22b431cdc2d02590c7a92ae36d70
parented9dfed62c6c057c1c51295d4373ae55c9284a10 (diff)
xtensa: cleanup ccount frequency tracking
Remove unused nsec_per_ccount, and rename ccount_per_jiffy to ccount_preq. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Chris Zankel <chris@zankel.net>
-rw-r--r--arch/xtensa/include/asm/timex.h5
-rw-r--r--arch/xtensa/kernel/platform.c2
-rw-r--r--arch/xtensa/kernel/time.c7
-rw-r--r--arch/xtensa/platforms/xtfpga/setup.c3
-rw-r--r--arch/xtensa/variants/s6000/delay.c3
5 files changed, 8 insertions, 12 deletions
diff --git a/arch/xtensa/include/asm/timex.h b/arch/xtensa/include/asm/timex.h
index c47989a0e3ad..69f901713fb6 100644
--- a/arch/xtensa/include/asm/timex.h
+++ b/arch/xtensa/include/asm/timex.h
@@ -36,9 +36,8 @@
36#endif 36#endif
37 37
38#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 38#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
39extern unsigned long ccount_per_jiffy; 39extern unsigned long ccount_freq;
40extern unsigned long nsec_per_ccount; 40#define CCOUNT_PER_JIFFY (ccount_freq / HZ)
41#define CCOUNT_PER_JIFFY ccount_per_jiffy
42#else 41#else
43#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ)) 42#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ))
44#endif 43#endif
diff --git a/arch/xtensa/kernel/platform.c b/arch/xtensa/kernel/platform.c
index da827cbb2f59..1cf008284dd2 100644
--- a/arch/xtensa/kernel/platform.c
+++ b/arch/xtensa/kernel/platform.c
@@ -41,6 +41,6 @@ _F(void, pcibios_init, (void), { });
41_F(void, calibrate_ccount, (void), 41_F(void, calibrate_ccount, (void),
42{ 42{
43 pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10MHz.\n"); 43 pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10MHz.\n");
44 ccount_per_jiffy = 10 * (1000000UL/HZ); 44 ccount_freq = 10 * 1000000UL;
45}); 45});
46#endif 46#endif
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index ffb474104311..a32bc2ea7982 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -28,8 +28,7 @@
28#include <asm/platform.h> 28#include <asm/platform.h>
29 29
30#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 30#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
31unsigned long ccount_per_jiffy; /* per 1/HZ */ 31unsigned long ccount_freq; /* ccount Hz */
32unsigned long nsec_per_ccount; /* nsec per ccount increment */
33#endif 32#endif
34 33
35static cycle_t ccount_read(struct clocksource *cs) 34static cycle_t ccount_read(struct clocksource *cs)
@@ -57,8 +56,8 @@ void __init time_init(void)
57#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 56#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
58 printk("Calibrating CPU frequency "); 57 printk("Calibrating CPU frequency ");
59 platform_calibrate_ccount(); 58 platform_calibrate_ccount();
60 printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ), 59 printk("%d.%02d MHz\n", (int)ccount_freq/1000000,
61 (int)(ccount_per_jiffy/(10000/HZ))%100); 60 (int)(ccount_freq/10000)%100);
62#endif 61#endif
63 clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ); 62 clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);
64 63
diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
index c7ce62ff73f7..74bb74fa3f87 100644
--- a/arch/xtensa/platforms/xtfpga/setup.c
+++ b/arch/xtensa/platforms/xtfpga/setup.c
@@ -179,8 +179,7 @@ void __init platform_calibrate_ccount(void)
179 if (!clk_freq) 179 if (!clk_freq)
180 clk_freq = *(long *)XTFPGA_CLKFRQ_VADDR; 180 clk_freq = *(long *)XTFPGA_CLKFRQ_VADDR;
181 181
182 ccount_per_jiffy = clk_freq / HZ; 182 ccount_freq = clk_freq;
183 nsec_per_ccount = 1000000000UL / clk_freq;
184} 183}
185 184
186#endif 185#endif
diff --git a/arch/xtensa/variants/s6000/delay.c b/arch/xtensa/variants/s6000/delay.c
index 54b2b573f166..baefd3a3c2aa 100644
--- a/arch/xtensa/variants/s6000/delay.c
+++ b/arch/xtensa/variants/s6000/delay.c
@@ -22,6 +22,5 @@ void platform_calibrate_ccount(void)
22 a = b; 22 a = b;
23 } while (--i >= 0); 23 } while (--i >= 0);
24 b -= a; 24 b -= a;
25 nsec_per_ccount = (LOOPS * 10000) / b; 25 ccount_freq = b * (100000UL / LOOPS);
26 ccount_per_jiffy = b * (100000UL / (LOOPS * HZ));
27} 26}