LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix e500 v2 core reboot bug
@ 2007-03-07 18:22 Jon Loeliger
  2007-03-07 18:34 ` Kumar Gala
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Loeliger @ 2007-03-07 18:22 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

From: Roy Zang <tie-fei.zang@freescale.com>

For e500 v2 core, a new reset control register is added.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Acked-by: Jon Loeliger <jdl@freescale.com>
---
 arch/powerpc/platforms/85xx/misc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/misc.c b/arch/powerpc/platforms/85xx/misc.c
index 3e62fcb..9fcbf56 100644
--- a/arch/powerpc/platforms/85xx/misc.c
+++ b/arch/powerpc/platforms/85xx/misc.c
@@ -13,11 +13,21 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <asm/irq.h>
+#include <asm/io.h>
+#include <sysdev/fsl_soc.h>
 
 extern void abort(void);
 
 void mpc85xx_restart(char *cmd)
 {
+	unsigned int pvr;
+
+	pvr = mfspr(SPRN_PVR);
+	if ((pvr >> 16) & 0x1){
+		u32 __iomem *rstcr;
+		rstcr = ioremap(get_immrbase() + 0xE00B0, 0x100);
+		*rstcr = 0x2;           /* HRESET_REQ */
+	}
 	local_irq_disable();
 	abort();
 }
-- 
1.5.0.1.213.g509b

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix e500 v2 core reboot bug
  2007-03-07 18:22 [PATCH] Fix e500 v2 core reboot bug Jon Loeliger
@ 2007-03-07 18:34 ` Kumar Gala
  0 siblings, 0 replies; 2+ messages in thread
From: Kumar Gala @ 2007-03-07 18:34 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev@ozlabs.org

On Mar 7, 2007, at 12:22 PM, Jon Loeliger wrote:

> From: Roy Zang <tie-fei.zang@freescale.com>
>
> For e500 v2 core, a new reset control register is added.
>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> Acked-by: Jon Loeliger <jdl@freescale.com>

Nack.  See comments below.

- k

> ---
>  arch/powerpc/platforms/85xx/misc.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/platforms/85xx/misc.c b/arch/powerpc/ 
> platforms/85xx/misc.c
> index 3e62fcb..9fcbf56 100644
> --- a/arch/powerpc/platforms/85xx/misc.c
> +++ b/arch/powerpc/platforms/85xx/misc.c
> @@ -13,11 +13,21 @@
>  #include <linux/irq.h>
>  #include <linux/module.h>
>  #include <asm/irq.h>
> +#include <asm/io.h>
> +#include <sysdev/fsl_soc.h>
>
>  extern void abort(void);
>
>  void mpc85xx_restart(char *cmd)
>  {
> +	unsigned int pvr;
> +
> +	pvr = mfspr(SPRN_PVR);
> +	if ((pvr >> 16) & 0x1){

Testing the PVR isn't proper.. you are using a system feature that  
has nothing to do with the core revision.

Maybe add an attribute in the soc node for this?

> +		u32 __iomem *rstcr;
> +		rstcr = ioremap(get_immrbase() + 0xE00B0, 0x100);

You can't do the ioremap here, this my get called from interrupt  
context..  See 83xx/misc.c for a slightly better example.  The  
unprotected arch_initcall is still an issue on 83xx.

> +		*rstcr = 0x2;           /* HRESET_REQ */

we should be using out_be32()

> +	}
>  	local_irq_disable();
>  	abort();
>  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-07 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-07 18:22 [PATCH] Fix e500 v2 core reboot bug Jon Loeliger
2007-03-07 18:34 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox