* [PATCH] PPC 4xx: Enable XMON on PPC 4xx boards
@ 2006-09-06 18:58 Josh Boyer
2006-09-06 22:55 ` Paul Mackerras
0 siblings, 1 reply; 3+ messages in thread
From: Josh Boyer @ 2006-09-06 18:58 UTC (permalink / raw)
To: mporter, paulus; +Cc: linuxppc-dev
Hi All,
The following patch allows XMON to run on the 4xx platform. Tested on
Walnut, Ebony, and Nova (440GX based) eval boards. Patch is against
2.6.18-rc6.
Signed-off-by: Josh Boyer <jdub@us.ibm.com>
---
arch/ppc/xmon/start.c | 6 ++++++
arch/ppc/xmon/xmon.c | 24 ++++++++++++++++++------
2 files changed, 24 insertions(+), 6 deletions(-)
--- linux-2.6.orig/arch/ppc/xmon/xmon.c
+++ linux-2.6/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)
@@ -254,10 +260,16 @@ int xmon(struct pt_regs *excp)
cmd = cmds(excp);
if (cmd == 's') {
xmon_trace[smp_processor_id()] = SSTEP;
- excp->msr |= 0x400;
+ excp->msr |= MSR_SSTEP_ENABLE;
+#ifdef CONFIG_4xx
+ mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
+#endif
} else if (at_breakpoint(excp->nip)) {
xmon_trace[smp_processor_id()] = BRSTEP;
- excp->msr |= 0x400;
+ excp->msr |= MSR_SSTEP_ENABLE;
+#ifdef CONFIG_4xx
+ mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
+#endif
} else {
xmon_trace[smp_processor_id()] = 0;
insert_bpts();
@@ -298,7 +310,7 @@ xmon_bpt(struct pt_regs *regs)
remove_bpts();
excprint(regs);
xmon_trace[smp_processor_id()] = BRSTEP;
- regs->msr |= 0x400;
+ regs->msr |= MSR_SSTEP_ENABLE;
} else {
xmon(regs);
}
@@ -385,7 +397,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 +412,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 +689,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();
--- linux-2.6.orig/arch/ppc/xmon/start.c
+++ linux-2.6/arch/ppc/xmon/start.c
@@ -73,6 +73,12 @@ xmon_map_scc(void)
TXRDY = 0x20;
RXRDY = 1;
DLAB = 0x80;
+#elif ( defined(CONFIG_440) || defined(CONFIG_440GX) )
+ sccd = (volatile unsigned char *) ioremap64(0x0000000140000200ULL, 8);
+ sccc = sccd + 5;
+ TXRDY = 0x20;
+ RXRDY = 1;
+ DLAB = 0x80;
#endif /* platform */
register_sysrq_key('x', &sysrq_xmon_op);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PPC 4xx: Enable XMON on PPC 4xx boards
2006-09-06 18:58 [PATCH] PPC 4xx: Enable XMON on PPC 4xx boards Josh Boyer
@ 2006-09-06 22:55 ` Paul Mackerras
2006-09-06 23:50 ` Josh Boyer
0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2006-09-06 22:55 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev, mporter
Josh Boyer writes:
> - excp->msr |= 0x400;
> + excp->msr |= MSR_SSTEP_ENABLE;
> +#ifdef CONFIG_4xx
> + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
> +#endif
> } else if (at_breakpoint(excp->nip)) {
> xmon_trace[smp_processor_id()] = BRSTEP;
> - excp->msr |= 0x400;
> + excp->msr |= MSR_SSTEP_ENABLE;
> +#ifdef CONFIG_4xx
> + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
> +#endif
This would be neater with a little inline xmon_enable_sstep(excp)
function...
Other than that, looks fine.
Paul.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] PPC 4xx: Enable XMON on PPC 4xx boards
2006-09-06 22:55 ` Paul Mackerras
@ 2006-09-06 23:50 ` Josh Boyer
0 siblings, 0 replies; 3+ messages in thread
From: Josh Boyer @ 2006-09-06 23:50 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, mporter
On Thu, 2006-09-07 at 08:55 +1000, Paul Mackerras wrote:
> Josh Boyer writes:
>
> > - excp->msr |= 0x400;
> > + excp->msr |= MSR_SSTEP_ENABLE;
> > +#ifdef CONFIG_4xx
> > + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
> > +#endif
> > } else if (at_breakpoint(excp->nip)) {
> > xmon_trace[smp_processor_id()] = BRSTEP;
> > - excp->msr |= 0x400;
> > + excp->msr |= MSR_SSTEP_ENABLE;
> > +#ifdef CONFIG_4xx
> > + mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
> > +#endif
>
> This would be neater with a little inline xmon_enable_sstep(excp)
> function...
>
> Other than that, looks fine.
Agreed. I'll make that change and resend in the morning.
josh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-09-06 23:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-06 18:58 [PATCH] PPC 4xx: Enable XMON on PPC 4xx boards Josh Boyer
2006-09-06 22:55 ` Paul Mackerras
2006-09-06 23:50 ` Josh Boyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox