[PATCH] kvme080 board support patch

Sangmoon Kim dogoil at etinsys.com
Fri Jan 12 12:45:15 EST 2007


Hi,

> >
> > +static void
> > +kvme080_restart(char *cmd)
> > +{
> > +	unsigned long srr;
> > +
> > +	local_irq_disable();
> > +	asm volatile(
> > +	" lis %0,0xfff0\n \
> > +	  ori %0,%0,0x0100\n \
> > +	  mtspr 26,%0\n \
> > +	  sync\n \
> > +	  lis %0,0x0000\n \
> > +	  ori %0,%0,0x0000\n \
> > +	  mtspr 27,%0\n \
> > +	  sync\n \
> > +	  rfi "
> > +	  : "=r" (srr));
> > +}
> 
> Does this restart actually work for you?  Do you not have any issues with
devices being in a funny state and not actually being restated?

Actually we have some issues with some pci devices not properly initialized
when restarting.
Although it causes some delay, the board eventually boot.
I am considering to put a hardware reset function here.

> Also, you can do mtspr(SPRN_SRR0, val); mtspr(SPRN_SRR1, val); and then
the asm for the "rfi".

Thank you for the good comment.
I made the incremental patch.

Signed-off-by: Sangmoon Kim <dogoil at etinsys.com>

diff --git a/arch/powerpc/platforms/embedded6xx/kvme080.c
b/arch/powerpc/platforms/embedded6xx/kvme080.c
index 6f904ca..8da3464 100644
--- a/arch/powerpc/platforms/embedded6xx/kvme080.c
+++ b/arch/powerpc/platforms/embedded6xx/kvme080.c
@@ -130,20 +130,10 @@ kvme080_init_IRQ(void)
 static void
 kvme080_restart(char *cmd)
 {
-	unsigned long srr;
-
 	local_irq_disable();
-	asm volatile(
-	" lis %0,0xfff0\n \
-	  ori %0,%0,0x0100\n \
-	  mtspr 26,%0\n \
-	  sync\n \
-	  lis %0,0x0000\n \
-	  ori %0,%0,0x0000\n \
-	  mtspr 27,%0\n \
-	  sync\n \
-	  rfi "
-	  : "=r" (srr));
+	mtspr(SPRN_SRR0, 0xfff00100);
+	mtspr(SPRN_SRR1, 0x00000000);
+	asm volatile("rfi");
 }
 
 static void

Regards,
Sangmoon Kim




More information about the Linuxppc-dev mailing list