diff options
Diffstat (limited to 'arch/mips/netlogic/xlp/wakeup.c')
-rw-r--r-- | arch/mips/netlogic/xlp/wakeup.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c index 88ce38d096f0..cb9010642ac3 100644 --- a/arch/mips/netlogic/xlp/wakeup.c +++ b/arch/mips/netlogic/xlp/wakeup.c | |||
@@ -79,32 +79,38 @@ static int xlp_wakeup_core(uint64_t sysbase, int core) | |||
79 | 79 | ||
80 | static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) | 80 | static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) |
81 | { | 81 | { |
82 | uint64_t syspcibase, sysbase; | 82 | struct nlm_soc_info *nodep; |
83 | uint64_t syspcibase; | ||
83 | uint32_t syscoremask; | 84 | uint32_t syscoremask; |
84 | int core, n; | 85 | int core, n, cpu; |
85 | 86 | ||
86 | for (n = 0; n < 4; n++) { | 87 | for (n = 0; n < NLM_NR_NODES; n++) { |
87 | syspcibase = nlm_get_sys_pcibase(n); | 88 | syspcibase = nlm_get_sys_pcibase(n); |
88 | if (nlm_read_reg(syspcibase, 0) == 0xffffffff) | 89 | if (nlm_read_reg(syspcibase, 0) == 0xffffffff) |
89 | break; | 90 | break; |
90 | 91 | ||
91 | /* read cores in reset from SYS and account for boot cpu */ | 92 | /* read cores in reset from SYS and account for boot cpu */ |
92 | sysbase = nlm_get_sys_regbase(n); | 93 | nlm_node_init(n); |
93 | syscoremask = nlm_read_sys_reg(sysbase, SYS_CPU_RESET); | 94 | nodep = nlm_get_node(n); |
95 | syscoremask = nlm_read_sys_reg(nodep->sysbase, SYS_CPU_RESET); | ||
94 | if (n == 0) | 96 | if (n == 0) |
95 | syscoremask |= 1; | 97 | syscoremask |= 1; |
96 | 98 | ||
97 | for (core = 0; core < 8; core++) { | 99 | for (core = 0; core < NLM_CORES_PER_NODE; core++) { |
98 | /* see if the core exists */ | 100 | /* see if the core exists */ |
99 | if ((syscoremask & (1 << core)) == 0) | 101 | if ((syscoremask & (1 << core)) == 0) |
100 | continue; | 102 | continue; |
101 | 103 | ||
102 | /* see if at least the first thread is enabled */ | 104 | /* see if at least the first thread is enabled */ |
103 | if (!cpumask_test_cpu((n * 8 + core) * 4, wakeup_mask)) | 105 | cpu = (n * NLM_CORES_PER_NODE + core) |
106 | * NLM_THREADS_PER_CORE; | ||
107 | if (!cpumask_test_cpu(cpu, wakeup_mask)) | ||
104 | continue; | 108 | continue; |
105 | 109 | ||
106 | /* wake up the core */ | 110 | /* wake up the core */ |
107 | if (!xlp_wakeup_core(sysbase, core)) | 111 | if (xlp_wakeup_core(nodep->sysbase, core)) |
112 | nodep->coremask |= 1u << core; | ||
113 | else | ||
108 | pr_err("Failed to enable core %d\n", core); | 114 | pr_err("Failed to enable core %d\n", core); |
109 | } | 115 | } |
110 | } | 116 | } |