aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon/xmon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-30 21:37:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-30 21:37:27 -0500
commit8af03e782cae1e0a0f530ddd22301cdd12cf9dc0 (patch)
treec4af13a38bd3cc1a811a37f2358491f171052070 /arch/powerpc/xmon/xmon.c
parent6232665040f9a23fafd9d94d4ae8d5a2dc850f65 (diff)
parent99e139126ab2e84be67969650f92eb37c12ab5cd (diff)
Merge branch 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.25' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (454 commits) [POWERPC] Cell IOMMU fixed mapping support [POWERPC] Split out the ioid fetching/checking logic [POWERPC] Add support to cell_iommu_setup_page_tables() for multiple windows [POWERPC] Split out the IOMMU logic from cell_dma_dev_setup() [POWERPC] Split cell_iommu_setup_hardware() into two parts [POWERPC] Split out the logic that allocates struct iommus [POWERPC] Allocate the hash table under 1G on cell [POWERPC] Add set_dma_ops() to match get_dma_ops() [POWERPC] 83xx: Clean up / convert mpc83xx board DTS files to v1 format. [POWERPC] 85xx: Only invalidate TLB0 and TLB1 [POWERPC] 83xx: Fix typo in mpc837x compatible entries [POWERPC] 85xx: convert sbc85* boards to use machine_device_initcall [POWERPC] 83xx: rework platform Kconfig [POWERPC] 85xx: rework platform Kconfig [POWERPC] 86xx: Remove unused IRQ defines [POWERPC] QE: Explicitly set address-cells and size cells for muram [POWERPC] Convert StorCenter DTS file to /dts-v1/ format. [POWERPC] 86xx: Convert all 86xx DTS files to /dts-v1/ format. [PPC] Remove 85xx from arch/ppc [PPC] Remove 83xx from arch/ppc ...
Diffstat (limited to 'arch/powerpc/xmon/xmon.c')
-rw-r--r--arch/powerpc/xmon/xmon.c75
1 files changed, 63 insertions, 12 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 121b04d165d1..a34172ddc468 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -40,6 +40,7 @@
40#include <asm/spu.h> 40#include <asm/spu.h>
41#include <asm/spu_priv1.h> 41#include <asm/spu_priv1.h>
42#include <asm/firmware.h> 42#include <asm/firmware.h>
43#include <asm/setjmp.h>
43 44
44#ifdef CONFIG_PPC64 45#ifdef CONFIG_PPC64
45#include <asm/hvcall.h> 46#include <asm/hvcall.h>
@@ -71,12 +72,9 @@ static unsigned long ncsum = 4096;
71static int termch; 72static int termch;
72static char tmpstr[128]; 73static char tmpstr[128];
73 74
74#define JMP_BUF_LEN 23
75static long bus_error_jmp[JMP_BUF_LEN]; 75static long bus_error_jmp[JMP_BUF_LEN];
76static int catch_memory_errors; 76static int catch_memory_errors;
77static long *xmon_fault_jmp[NR_CPUS]; 77static long *xmon_fault_jmp[NR_CPUS];
78#define setjmp xmon_setjmp
79#define longjmp xmon_longjmp
80 78
81/* Breakpoint stuff */ 79/* Breakpoint stuff */
82struct bpt { 80struct bpt {
@@ -153,13 +151,15 @@ static const char *getvecname(unsigned long vec);
153 151
154static int do_spu_cmd(void); 152static int do_spu_cmd(void);
155 153
154#ifdef CONFIG_44x
155static void dump_tlb_44x(void);
156#endif
157
156int xmon_no_auto_backtrace; 158int xmon_no_auto_backtrace;
157 159
158extern void xmon_enter(void); 160extern void xmon_enter(void);
159extern void xmon_leave(void); 161extern void xmon_leave(void);
160 162
161extern long setjmp(long *);
162extern void longjmp(long *, long);
163extern void xmon_save_regs(struct pt_regs *); 163extern void xmon_save_regs(struct pt_regs *);
164 164
165#ifdef CONFIG_PPC64 165#ifdef CONFIG_PPC64
@@ -231,6 +231,9 @@ Commands:\n\
231#ifdef CONFIG_PPC_STD_MMU_32 231#ifdef CONFIG_PPC_STD_MMU_32
232" u dump segment registers\n" 232" u dump segment registers\n"
233#endif 233#endif
234#ifdef CONFIG_44x
235" u dump TLB\n"
236#endif
234" ? help\n" 237" ? help\n"
235" zr reboot\n\ 238" zr reboot\n\
236 zh halt\n" 239 zh halt\n"
@@ -856,6 +859,11 @@ cmds(struct pt_regs *excp)
856 dump_segments(); 859 dump_segments();
857 break; 860 break;
858#endif 861#endif
862#ifdef CONFIG_4xx
863 case 'u':
864 dump_tlb_44x();
865 break;
866#endif
859 default: 867 default:
860 printf("Unrecognized command: "); 868 printf("Unrecognized command: ");
861 do { 869 do {
@@ -2527,16 +2535,33 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
2527static void dump_slb(void) 2535static void dump_slb(void)
2528{ 2536{
2529 int i; 2537 int i;
2530 unsigned long tmp; 2538 unsigned long esid,vsid,valid;
2539 unsigned long llp;
2531 2540
2532 printf("SLB contents of cpu %x\n", smp_processor_id()); 2541 printf("SLB contents of cpu %x\n", smp_processor_id());
2533 2542
2534 for (i = 0; i < SLB_NUM_ENTRIES; i++) { 2543 for (i = 0; i < mmu_slb_size; i++) {
2535 asm volatile("slbmfee %0,%1" : "=r" (tmp) : "r" (i)); 2544 asm volatile("slbmfee %0,%1" : "=r" (esid) : "r" (i));
2536 printf("%02d %016lx ", i, tmp); 2545 asm volatile("slbmfev %0,%1" : "=r" (vsid) : "r" (i));
2537 2546 valid = (esid & SLB_ESID_V);
2538 asm volatile("slbmfev %0,%1" : "=r" (tmp) : "r" (i)); 2547 if (valid | esid | vsid) {
2539 printf("%016lx\n", tmp); 2548 printf("%02d %016lx %016lx", i, esid, vsid);
2549 if (valid) {
2550 llp = vsid & SLB_VSID_LLP;
2551 if (vsid & SLB_VSID_B_1T) {
2552 printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n",
2553 GET_ESID_1T(esid),
2554 (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT_1T,
2555 llp);
2556 } else {
2557 printf(" 256M ESID=%9lx VSID=%13lx LLP:%3lx \n",
2558 GET_ESID(esid),
2559 (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT,
2560 llp);
2561 }
2562 } else
2563 printf("\n");
2564 }
2540 } 2565 }
2541} 2566}
2542 2567
@@ -2581,6 +2606,32 @@ void dump_segments(void)
2581} 2606}
2582#endif 2607#endif
2583 2608
2609#ifdef CONFIG_44x
2610static void dump_tlb_44x(void)
2611{
2612 int i;
2613
2614 for (i = 0; i < PPC44x_TLB_SIZE; i++) {
2615 unsigned long w0,w1,w2;
2616 asm volatile("tlbre %0,%1,0" : "=r" (w0) : "r" (i));
2617 asm volatile("tlbre %0,%1,1" : "=r" (w1) : "r" (i));
2618 asm volatile("tlbre %0,%1,2" : "=r" (w2) : "r" (i));
2619 printf("[%02x] %08x %08x %08x ", i, w0, w1, w2);
2620 if (w0 & PPC44x_TLB_VALID) {
2621 printf("V %08x -> %01x%08x %c%c%c%c%c",
2622 w0 & PPC44x_TLB_EPN_MASK,
2623 w1 & PPC44x_TLB_ERPN_MASK,
2624 w1 & PPC44x_TLB_RPN_MASK,
2625 (w2 & PPC44x_TLB_W) ? 'W' : 'w',
2626 (w2 & PPC44x_TLB_I) ? 'I' : 'i',
2627 (w2 & PPC44x_TLB_M) ? 'M' : 'm',
2628 (w2 & PPC44x_TLB_G) ? 'G' : 'g',
2629 (w2 & PPC44x_TLB_E) ? 'E' : 'e');
2630 }
2631 printf("\n");
2632 }
2633}
2634#endif /* CONFIG_44x */
2584void xmon_init(int enable) 2635void xmon_init(int enable)
2585{ 2636{
2586#ifdef CONFIG_PPC_ISERIES 2637#ifdef CONFIG_PPC_ISERIES