diff options
Diffstat (limited to 'arch/mips/netlogic/xlr/wakeup.c')
-rw-r--r-- | arch/mips/netlogic/xlr/wakeup.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/mips/netlogic/xlr/wakeup.c b/arch/mips/netlogic/xlr/wakeup.c index db5d987d488..3ebf7411d67 100644 --- a/arch/mips/netlogic/xlr/wakeup.c +++ b/arch/mips/netlogic/xlr/wakeup.c | |||
@@ -33,6 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/delay.h> | ||
36 | #include <linux/threads.h> | 37 | #include <linux/threads.h> |
37 | 38 | ||
38 | #include <asm/asm.h> | 39 | #include <asm/asm.h> |
@@ -50,18 +51,34 @@ | |||
50 | 51 | ||
51 | int __cpuinit xlr_wakeup_secondary_cpus(void) | 52 | int __cpuinit xlr_wakeup_secondary_cpus(void) |
52 | { | 53 | { |
53 | unsigned int i, boot_cpu; | 54 | struct nlm_soc_info *nodep; |
55 | unsigned int i, j, boot_cpu; | ||
54 | 56 | ||
55 | /* | 57 | /* |
56 | * In case of RMI boot, hit with NMI to get the cores | 58 | * In case of RMI boot, hit with NMI to get the cores |
57 | * from bootloader to linux code. | 59 | * from bootloader to linux code. |
58 | */ | 60 | */ |
61 | nodep = nlm_get_node(0); | ||
59 | boot_cpu = hard_smp_processor_id(); | 62 | boot_cpu = hard_smp_processor_id(); |
60 | nlm_set_nmi_handler(nlm_rmiboot_preboot); | 63 | nlm_set_nmi_handler(nlm_rmiboot_preboot); |
61 | for (i = 0; i < NR_CPUS; i++) { | 64 | for (i = 0; i < NR_CPUS; i++) { |
62 | if (i == boot_cpu || (nlm_cpumask & (1u << i)) == 0) | 65 | if (i == boot_cpu || !cpumask_test_cpu(i, &nlm_cpumask)) |
63 | continue; | 66 | continue; |
64 | nlm_pic_send_ipi(nlm_pic_base, i, 1, 1); /* send NMI */ | 67 | nlm_pic_send_ipi(nodep->picbase, i, 1, 1); /* send NMI */ |
68 | } | ||
69 | |||
70 | /* Fill up the coremask early */ | ||
71 | nodep->coremask = 1; | ||
72 | for (i = 1; i < NLM_CORES_PER_NODE; i++) { | ||
73 | for (j = 1000000; j > 0; j--) { | ||
74 | if (nlm_cpu_ready[i * NLM_THREADS_PER_CORE]) | ||
75 | break; | ||
76 | udelay(10); | ||
77 | } | ||
78 | if (j != 0) | ||
79 | nodep->coremask |= (1u << i); | ||
80 | else | ||
81 | pr_err("Failed to wakeup core %d\n", i); | ||
65 | } | 82 | } |
66 | 83 | ||
67 | return 0; | 84 | return 0; |