aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/xmon/xmon.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 121b04d165d..381d467cf55 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
154static int do_spu_cmd(void); 154static int do_spu_cmd(void);
155 155
156#ifdef CONFIG_44x
157static void dump_tlb_44x(void);
158#endif
159
156int xmon_no_auto_backtrace; 160int xmon_no_auto_backtrace;
157 161
158extern void xmon_enter(void); 162extern 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
2597static 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 */
2584void xmon_init(int enable) 2622void xmon_init(int enable)
2585{ 2623{
2586#ifdef CONFIG_PPC_ISERIES 2624#ifdef CONFIG_PPC_ISERIES