diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-11-16 02:23:33 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-02 21:56:26 -0500 |
commit | 5a8a1a28bb35a62561367c0a1144dbc5dcb95230 (patch) | |
tree | a07e4d48faf386e052e02e17483fb2ba40c0813e /arch/powerpc/xmon/xmon.c | |
parent | 5f1a7c811bb1aa5259afb8967c704f1306eaacb3 (diff) |
[POWERPC] Add xmon function to dump 44x TLB
This adds a function to xmon to dump the content of the 44x processor
TLB with a little bit of decoding (but not much).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/xmon/xmon.c')
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 121b04d165d1..381d467cf55b 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -153,6 +153,10 @@ static const char *getvecname(unsigned long vec); | |||
153 | 153 | ||
154 | static int do_spu_cmd(void); | 154 | static int do_spu_cmd(void); |
155 | 155 | ||
156 | #ifdef CONFIG_44x | ||
157 | static void dump_tlb_44x(void); | ||
158 | #endif | ||
159 | |||
156 | int xmon_no_auto_backtrace; | 160 | int xmon_no_auto_backtrace; |
157 | 161 | ||
158 | extern void xmon_enter(void); | 162 | extern void xmon_enter(void); |
@@ -231,6 +235,9 @@ Commands:\n\ | |||
231 | #ifdef CONFIG_PPC_STD_MMU_32 | 235 | #ifdef CONFIG_PPC_STD_MMU_32 |
232 | " u dump segment registers\n" | 236 | " u dump segment registers\n" |
233 | #endif | 237 | #endif |
238 | #ifdef CONFIG_44x | ||
239 | " u dump TLB\n" | ||
240 | #endif | ||
234 | " ? help\n" | 241 | " ? help\n" |
235 | " zr reboot\n\ | 242 | " zr reboot\n\ |
236 | zh halt\n" | 243 | zh halt\n" |
@@ -856,6 +863,11 @@ cmds(struct pt_regs *excp) | |||
856 | dump_segments(); | 863 | dump_segments(); |
857 | break; | 864 | break; |
858 | #endif | 865 | #endif |
866 | #ifdef CONFIG_4xx | ||
867 | case 'u': | ||
868 | dump_tlb_44x(); | ||
869 | break; | ||
870 | #endif | ||
859 | default: | 871 | default: |
860 | printf("Unrecognized command: "); | 872 | printf("Unrecognized command: "); |
861 | do { | 873 | do { |
@@ -2581,6 +2593,32 @@ void dump_segments(void) | |||
2581 | } | 2593 | } |
2582 | #endif | 2594 | #endif |
2583 | 2595 | ||
2596 | #ifdef CONFIG_44x | ||
2597 | static void dump_tlb_44x(void) | ||
2598 | { | ||
2599 | int i; | ||
2600 | |||
2601 | for (i = 0; i < PPC44x_TLB_SIZE; i++) { | ||
2602 | unsigned long w0,w1,w2; | ||
2603 | asm volatile("tlbre %0,%1,0" : "=r" (w0) : "r" (i)); | ||
2604 | asm volatile("tlbre %0,%1,1" : "=r" (w1) : "r" (i)); | ||
2605 | asm volatile("tlbre %0,%1,2" : "=r" (w2) : "r" (i)); | ||
2606 | printf("[%02x] %08x %08x %08x ", i, w0, w1, w2); | ||
2607 | if (w0 & PPC44x_TLB_VALID) { | ||
2608 | printf("V %08x -> %01x%08x %c%c%c%c%c", | ||
2609 | w0 & PPC44x_TLB_EPN_MASK, | ||
2610 | w1 & PPC44x_TLB_ERPN_MASK, | ||
2611 | w1 & PPC44x_TLB_RPN_MASK, | ||
2612 | (w2 & PPC44x_TLB_W) ? 'W' : 'w', | ||
2613 | (w2 & PPC44x_TLB_I) ? 'I' : 'i', | ||
2614 | (w2 & PPC44x_TLB_M) ? 'M' : 'm', | ||
2615 | (w2 & PPC44x_TLB_G) ? 'G' : 'g', | ||
2616 | (w2 & PPC44x_TLB_E) ? 'E' : 'e'); | ||
2617 | } | ||
2618 | printf("\n"); | ||
2619 | } | ||
2620 | } | ||
2621 | #endif /* CONFIG_44x */ | ||
2584 | void xmon_init(int enable) | 2622 | void xmon_init(int enable) |
2585 | { | 2623 | { |
2586 | #ifdef CONFIG_PPC_ISERIES | 2624 | #ifdef CONFIG_PPC_ISERIES |