提交 e38cdccf 编写于 作者: H Hang Xiaoqian 提交者: guzitao

sw64: switch to generic calibrate_delay()

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG

--------------------------------

There is no need to use per cpu loops_per_jiffy, so we
remove loops_per_jiffy from struct cpuinfo_sw64.
Signed-off-by: NHang Xiaoqian <hangxiaoqian@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 50f49674
......@@ -142,6 +142,10 @@ config ARCH_HAS_ILOG2_U64
config GENERIC_GPIO
bool
config GENERIC_CALIBRATE_DELAY
bool
default y
config ZONE_DMA32
bool
default y
......
......@@ -18,7 +18,6 @@ struct cache_desc {
};
struct cpuinfo_sw64 {
unsigned long loops_per_jiffy;
unsigned long last_asn;
unsigned long ipi_count;
struct cache_desc icache; /* Primary I-cache */
......
......@@ -143,7 +143,6 @@ EXPORT_SYMBOL(screen_info);
*/
void store_cpu_data(int cpu)
{
cpu_data[cpu].loops_per_jiffy = loops_per_jiffy;
cpu_data[cpu].last_asn = ASN_FIRST_VERSION;
}
......
......@@ -374,18 +374,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
void __init native_smp_cpus_done(unsigned int max_cpus)
{
int cpu;
unsigned long bogosum = 0;
for (cpu = 0; cpu < NR_CPUS; cpu++)
if (cpu_online(cpu))
bogosum += cpu_data[cpu].loops_per_jiffy;
smp_booted = 1;
pr_info("SMP: Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
num_online_cpus(),
(bogosum + 2500) / (500000/HZ),
((bogosum + 2500) / (5000/HZ)) % 100);
pr_info("SMP: Total of %d processors activated.\n", num_online_cpus());
}
int setup_profiling_timer(unsigned int multiplier)
......
......@@ -111,14 +111,8 @@ time_init(void)
of_clk_init(NULL);
/* Startup the timer source. */
setup_timer();
}
void calibrate_delay(void)
{
loops_per_jiffy = get_cpu_freq() / HZ;
pr_info("Clock rate yields %lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy / (500000 / HZ),
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
/* Calibrate the delay loop directly */
lpj_fine = cycle_freq / HZ;
}
static void __init calibrate_sched_clock(void)
......
......@@ -28,12 +28,6 @@ void __delay(unsigned long loops)
}
EXPORT_SYMBOL(__delay);
#ifdef CONFIG_SMP
#define LPJ cpu_data[smp_processor_id()].loops_per_jiffy
#else
#define LPJ loops_per_jiffy
#endif
void udelay(unsigned long usecs)
{
unsigned long loops = usecs * get_cpu_freq() / 1000000;
......
......@@ -40,10 +40,8 @@ static int sw64_cpu_freq_notifier(struct notifier_block *nb,
unsigned long cpu;
for_each_online_cpu(cpu) {
if (val == CPUFREQ_POSTCHANGE) {
if (val == CPUFREQ_POSTCHANGE)
sw64_update_clockevents(cpu, freqs->new * 1000);
current_cpu_data.loops_per_jiffy = loops_per_jiffy;
}
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册