diff options
author | Paul Burton <paul.burton@imgtec.com> | 2015-09-25 11:59:37 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-09-27 08:14:47 -0400 |
commit | 651ca7f4dab77f07fdac9cfb68bcab6bd2b7f827 (patch) | |
tree | 281fe7b561d953858181a5e7e7c6328b55d9814f | |
parent | def3ab5d0a0fe53026c2495b054dcc46cf923dac (diff) |
MIPS: print MAAR configuration during boot
Verifying that the MAAR configuration is as expected is useful when
debugging the performance of a system. Print out the memory regions
configured via MAAR along with their attributes.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: David Hildenbrand <dahi@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Patchwork: https://patchwork.linux-mips.org/patch/11238/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/mm/init.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 074ac5459026..023c164b9eb6 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -291,6 +291,7 @@ unsigned __weak platform_maar_init(unsigned num_pairs) | |||
291 | static void maar_init(void) | 291 | static void maar_init(void) |
292 | { | 292 | { |
293 | unsigned num_maars, used, i; | 293 | unsigned num_maars, used, i; |
294 | phys_addr_t lower, upper, attr; | ||
294 | 295 | ||
295 | if (!cpu_has_maar) | 296 | if (!cpu_has_maar) |
296 | return; | 297 | return; |
@@ -313,6 +314,34 @@ static void maar_init(void) | |||
313 | write_c0_maar(0); | 314 | write_c0_maar(0); |
314 | back_to_back_c0_hazard(); | 315 | back_to_back_c0_hazard(); |
315 | } | 316 | } |
317 | |||
318 | pr_info("MAAR configuration:\n"); | ||
319 | for (i = 0; i < num_maars; i += 2) { | ||
320 | write_c0_maari(i); | ||
321 | back_to_back_c0_hazard(); | ||
322 | upper = read_c0_maar(); | ||
323 | |||
324 | write_c0_maari(i + 1); | ||
325 | back_to_back_c0_hazard(); | ||
326 | lower = read_c0_maar(); | ||
327 | |||
328 | attr = lower & upper; | ||
329 | lower = (lower & MIPS_MAAR_ADDR) << 4; | ||
330 | upper = ((upper & MIPS_MAAR_ADDR) << 4) | 0xffff; | ||
331 | |||
332 | pr_info(" [%d]: ", i / 2); | ||
333 | if (!(attr & MIPS_MAAR_V)) { | ||
334 | pr_cont("disabled\n"); | ||
335 | continue; | ||
336 | } | ||
337 | |||
338 | pr_cont("%pa-%pa", &lower, &upper); | ||
339 | |||
340 | if (attr & MIPS_MAAR_S) | ||
341 | pr_cont(" speculate"); | ||
342 | |||
343 | pr_cont("\n"); | ||
344 | } | ||
316 | } | 345 | } |
317 | 346 | ||
318 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 347 | #ifndef CONFIG_NEED_MULTIPLE_NODES |