Skip to content

Commit e504c4b

Browse files
baruchsiachczankel
authored andcommitted
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>
1 parent ed9dfed commit e504c4b

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

arch/xtensa/include/asm/timex.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@
3636
#endif
3737

3838
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
39-
extern unsigned long ccount_per_jiffy;
40-
extern unsigned long nsec_per_ccount;
41-
#define CCOUNT_PER_JIFFY ccount_per_jiffy
39+
extern unsigned long ccount_freq;
40+
#define CCOUNT_PER_JIFFY (ccount_freq / HZ)
4241
#else
4342
#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ))
4443
#endif

arch/xtensa/kernel/platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ _F(void, pcibios_init, (void), { });
4141
_F(void, calibrate_ccount, (void),
4242
{
4343
pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10MHz.\n");
44-
ccount_per_jiffy = 10 * (1000000UL/HZ);
44+
ccount_freq = 10 * 1000000UL;
4545
});
4646
#endif

arch/xtensa/kernel/time.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
#include <asm/platform.h>
2929

3030
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
31-
unsigned long ccount_per_jiffy; /* per 1/HZ */
32-
unsigned long nsec_per_ccount; /* nsec per ccount increment */
31+
unsigned long ccount_freq; /* ccount Hz */
3332
#endif
3433

3534
static cycle_t ccount_read(struct clocksource *cs)
@@ -57,8 +56,8 @@ void __init time_init(void)
5756
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
5857
printk("Calibrating CPU frequency ");
5958
platform_calibrate_ccount();
60-
printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ),
61-
(int)(ccount_per_jiffy/(10000/HZ))%100);
59+
printk("%d.%02d MHz\n", (int)ccount_freq/1000000,
60+
(int)(ccount_freq/10000)%100);
6261
#endif
6362
clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);
6463

arch/xtensa/platforms/xtfpga/setup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ void __init platform_calibrate_ccount(void)
179179
if (!clk_freq)
180180
clk_freq = *(long *)XTFPGA_CLKFRQ_VADDR;
181181

182-
ccount_per_jiffy = clk_freq / HZ;
183-
nsec_per_ccount = 1000000000UL / clk_freq;
182+
ccount_freq = clk_freq;
184183
}
185184

186185
#endif

arch/xtensa/variants/s6000/delay.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ void platform_calibrate_ccount(void)
2222
a = b;
2323
} while (--i >= 0);
2424
b -= a;
25-
nsec_per_ccount = (LOOPS * 10000) / b;
26-
ccount_per_jiffy = b * (100000UL / (LOOPS * HZ));
25+
ccount_freq = b * (100000UL / LOOPS);
2726
}

0 commit comments

Comments
 (0)