Commit d31f9e64 authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by Paul Burton

MIPS: SGI-IP27: Store cpu speed when scanning for CPUs and use it later

Remember CPU speed while scanning for available CPUs to avoid
looking it up a second time when printing CPU speed.
Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
parent 78691e4f
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
struct cpuinfo_ip27 { struct cpuinfo_ip27 {
nasid_t p_nasid; /* my node ID in numa-as-id-space */ nasid_t p_nasid; /* my node ID in numa-as-id-space */
unsigned short p_speed; /* cpu speed in MHz */
unsigned char p_slice; /* Physical position on node board */ unsigned char p_slice; /* Physical position on node board */
}; };
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
extern nasid_t master_nasid; extern nasid_t master_nasid;
extern void cpu_node_probe(void); extern void cpu_node_probe(void);
extern void cpu_time_init(void);
extern void hub_rt_clock_event_init(void); extern void hub_rt_clock_event_init(void);
extern void hub_rtc_init(nasid_t nasid); extern void hub_rtc_init(nasid_t nasid);
extern void install_cpu_nmi_handler(int slice); extern void install_cpu_nmi_handler(int slice);
......
...@@ -83,7 +83,8 @@ void per_cpu_init(void) ...@@ -83,7 +83,8 @@ void per_cpu_init(void)
per_hub_init(nasid); per_hub_init(nasid);
cpu_time_init(); pr_info("CPU %d clock is %dMHz.\n", cpu, sn_cpu_info[cpu].p_speed);
install_ipi(); install_ipi();
/* Install our NMI handler if symmon hasn't installed one. */ /* Install our NMI handler if symmon hasn't installed one. */
......
...@@ -47,6 +47,8 @@ static int node_scan_cpus(nasid_t nasid, int highest) ...@@ -47,6 +47,8 @@ static int node_scan_cpus(nasid_t nasid, int highest)
set_cpu_possible(cpuid, true); set_cpu_possible(cpuid, true);
cputonasid(cpus_found) = nasid; cputonasid(cpus_found) = nasid;
cputoslice(cpus_found) = acpu->cpu_info.physid; cputoslice(cpus_found) = acpu->cpu_info.physid;
sn_cpu_info[cpus_found].p_speed =
acpu->cpu_speed;
cpus_found++; cpus_found++;
} }
acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu, acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu,
......
...@@ -150,25 +150,6 @@ void __init plat_time_init(void) ...@@ -150,25 +150,6 @@ void __init plat_time_init(void)
hub_rt_clock_event_init(); hub_rt_clock_event_init();
} }
void cpu_time_init(void)
{
lboard_t *board;
klcpu_t *cpu;
int cpuid;
/* Don't use ARCS. ARCS is fragile. Klconfig is simple and sane. */
board = find_lboard(KL_CONFIG_INFO(get_nasid()), KLTYPE_IP27);
if (!board)
panic("Can't find board info for myself.");
cpuid = LOCAL_HUB_L(PI_CPU_NUM) ? IP27_CPU0_INDEX : IP27_CPU1_INDEX;
cpu = (klcpu_t *) KLCF_COMP(board, cpuid);
if (!cpu)
panic("No information about myself?");
printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed);
}
void hub_rtc_init(nasid_t nasid) void hub_rtc_init(nasid_t nasid)
{ {
......
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