Commit fedc21dc authored by Baruch Siach's avatar Baruch Siach Committed by Chris Zankel

xtensa: fix !CONFIG_XTENSA_CALIBRATE_CCOUNT build failure

Commits 925f5532 (xtensa: ccount based clockevent implementation) and e3f43291
(xtensa: ccount based sched_clock) introduced users of ccount_freq. This
variable doesn't exist when CONFIG_XTENSA_CALIBRATE_CCOUNT is disabled. Add
ccount_freq definition in this case.
Reported-by: default avatarChen Gang <gang.chen@asianux.com>
Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 123f15e6
...@@ -35,13 +35,8 @@ ...@@ -35,13 +35,8 @@
# error "Bad timer number for Linux configurations!" # error "Bad timer number for Linux configurations!"
#endif #endif
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
extern unsigned long ccount_freq; extern unsigned long ccount_freq;
#define CCOUNT_PER_JIFFY (ccount_freq / HZ) #define CCOUNT_PER_JIFFY (ccount_freq / HZ)
#else
#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ))
#endif
typedef unsigned long long cycles_t; typedef unsigned long long cycles_t;
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
#include <asm/timex.h> #include <asm/timex.h>
#include <asm/platform.h> #include <asm/platform.h>
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
unsigned long ccount_freq; /* ccount Hz */ unsigned long ccount_freq; /* ccount Hz */
#endif
static cycle_t ccount_read(struct clocksource *cs) static cycle_t ccount_read(struct clocksource *cs)
{ {
...@@ -129,6 +127,8 @@ void __init time_init(void) ...@@ -129,6 +127,8 @@ void __init time_init(void)
platform_calibrate_ccount(); platform_calibrate_ccount();
printk("%d.%02d MHz\n", (int)ccount_freq/1000000, printk("%d.%02d MHz\n", (int)ccount_freq/1000000,
(int)(ccount_freq/10000)%100); (int)(ccount_freq/10000)%100);
#else
ccount_freq = CONFIG_XTENSA_CPU_CLOCK*1000000UL;
#endif #endif
clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ); clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment