aboutsummaryrefslogtreecommitdiff
path: root/arch/ppc/xmon/xmon.c
diff options
context:
space:
mode:
authorJosh Boyer <jdub@us.ibm.com>2006-09-07 13:27:58 -0500
committerPaul Mackerras <paulus@samba.org>2006-09-13 18:39:52 +1000
commitb7e89214aadf82fa5eaff28f50f2078fa6ae773c (patch)
tree877bfd9e81dcdb68a2a66080ee562fc4796b0975 /arch/ppc/xmon/xmon.c
parent477bcae4c289a60f2303fbd4a3a875dcca647cf8 (diff)
[POWERPC] PPC 4xx: Enable XMON on PPC 4xx boards
The following patch allows XMON to run on the 4xx platform. Tested on Walnut, Ebony, and Nova (440GX based) eval boards. 440EP, 440SP, and 440SPE boards should work as well. Patch is against 2.6.18-rc6. Signed-off-by: Josh Boyer <jdub@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc/xmon/xmon.c')
-rw-r--r--arch/ppc/xmon/xmon.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 37d234f93394..25d032b2aec7 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -153,6 +153,12 @@ static int xmon_trace[NR_CPUS];
#define SSTEP 1 /* stepping because of 's' command */
#define BRSTEP 2 /* stepping over breakpoint */
+#ifdef CONFIG_4xx
+#define MSR_SSTEP_ENABLE 0x200
+#else
+#define MSR_SSTEP_ENABLE 0x400
+#endif
+
static struct pt_regs *xmon_regs[NR_CPUS];
extern inline void sync(void)
@@ -211,6 +217,14 @@ static void get_tb(unsigned *p)
p[1] = lo;
}
+static inline void xmon_enable_sstep(struct pt_regs *regs)
+{
+ regs->msr |= MSR_SSTEP_ENABLE;
+#ifdef CONFIG_4xx
+ mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
+#endif
+}
+
int xmon(struct pt_regs *excp)
{
struct pt_regs regs;
@@ -254,10 +268,10 @@ int xmon(struct pt_regs *excp)
cmd = cmds(excp);
if (cmd == 's') {
xmon_trace[smp_processor_id()] = SSTEP;
- excp->msr |= 0x400;
+ xmon_enable_sstep(excp);
} else if (at_breakpoint(excp->nip)) {
xmon_trace[smp_processor_id()] = BRSTEP;
- excp->msr |= 0x400;
+ xmon_enable_sstep(excp);
} else {
xmon_trace[smp_processor_id()] = 0;
insert_bpts();
@@ -298,7 +312,7 @@ xmon_bpt(struct pt_regs *regs)
remove_bpts();
excprint(regs);
xmon_trace[smp_processor_id()] = BRSTEP;
- regs->msr |= 0x400;
+ xmon_enable_sstep(regs);
} else {
xmon(regs);
}
@@ -385,7 +399,7 @@ insert_bpts(void)
}
store_inst((void *) bp->address);
}
-#if !defined(CONFIG_8xx)
+#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
if (dabr.enabled)
set_dabr(dabr.address);
if (iabr.enabled)
@@ -400,7 +414,7 @@ remove_bpts(void)
struct bpt *bp;
unsigned instr;
-#if !defined(CONFIG_8xx)
+#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
set_dabr(0);
set_iabr(0);
#endif
@@ -677,7 +691,7 @@ bpt_cmds(void)
cmd = inchar();
switch (cmd) {
-#if !defined(CONFIG_8xx)
+#if ! (defined(CONFIG_8xx) || defined(CONFIG_4xx))
case 'd':
mode = 7;
cmd = inchar();