changeset 443:b8b99761a77b

Add proper MPC8xx RESET support.
author gthomas
date Mon, 02 Dec 2002 20:42:57 +0000
parents cb9bc921600a
children f00b7ea8ac0e
files packages/hal/powerpc/adder/current/ChangeLog packages/hal/powerpc/adder/current/include/plf_intr.h packages/hal/powerpc/mbx/current/ChangeLog packages/hal/powerpc/mbx/current/include/plf_intr.h packages/hal/powerpc/mpc8xx/current/ChangeLog packages/hal/powerpc/mpc8xx/current/src/variant.S packages/hal/powerpc/ts1000/current/ChangeLog packages/hal/powerpc/ts1000/current/include/plf_intr.h packages/hal/powerpc/viper/current/ChangeLog packages/hal/powerpc/viper/current/include/plf_intr.h
diffstat 10 files changed, 68 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/powerpc/adder/current/ChangeLog
+++ b/packages/hal/powerpc/adder/current/ChangeLog
@@ -1,3 +1,7 @@
+2002-12-02  Gary Thomas  <gthomas@ecoscentric.com>
+
+	* include/plf_intr.h: Use MPC8xx variant RESET support.
+
 2002-11-26  Gary Thomas  <gthomas@ecoscentric.com>
 
 	* misc/redboot_ROMRAM.ecm: Export.
--- a/packages/hal/powerpc/adder/current/include/plf_intr.h
+++ b/packages/hal/powerpc/adder/current/include/plf_intr.h
@@ -45,7 +45,7 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):    jskov
-// Contributors: jskov
+// Contributors: jskov, gthomas
 // Date:         2000-06-13
 // Purpose:      Define platform specific interrupt support
 //              
@@ -72,9 +72,8 @@
 //----------------------------------------------------------------------------
 // Reset.
 
-// The ADDER does not have a watchdog (not one we can easily use for this
-// purpose anyway).
-#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT
+externC void _mpc8xx_reset(void);
+#define HAL_PLATFORM_RESET() _mpc8xx_reset()
 
 #define HAL_PLATFORM_RESET_ENTRY 0xfe000100
 
--- a/packages/hal/powerpc/mbx/current/ChangeLog
+++ b/packages/hal/powerpc/mbx/current/ChangeLog
@@ -1,3 +1,7 @@
+2002-12-02  Gary Thomas  <gthomas@ecoscentric.com>
+
+	* include/plf_intr.h: Use MPC8xx variant RESET support.
+
 2002-11-26  Gary Thomas  <gthomas@ecoscentric.com>
 
 	* cdl/hal_powerpc_mbx.cdl: Move platform defines to platform package.
--- a/packages/hal/powerpc/mbx/current/include/plf_intr.h
+++ b/packages/hal/powerpc/mbx/current/include/plf_intr.h
@@ -12,6 +12,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
@@ -44,7 +45,7 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):    jskov
-// Contributors: jskov
+// Contributors: jskov, gthomas
 // Date:         2000-06-13
 // Purpose:      Define platform specific interrupt support
 //              
@@ -71,9 +72,8 @@
 //----------------------------------------------------------------------------
 // Reset.
 
-// The MBX does not have a watchdog (not one we can easily use for this
-// purpose anyway).
-#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT
+externC void _mpc8xx_reset(void);
+#define HAL_PLATFORM_RESET() _mpc8xx_reset()
 
 #define HAL_PLATFORM_RESET_ENTRY 0xfe000100
 
--- a/packages/hal/powerpc/mpc8xx/current/ChangeLog
+++ b/packages/hal/powerpc/mpc8xx/current/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-02  Gary Thomas  <gthomas@ecoscentric.com>
+
+	* src/variant.S (_mpc8xx_reset): New function, used to cause a
+	hardware reset of the platform.
+
 2002-11-25  Gary Thomas  <gthomas@ecoscentric.com>
 
 	* include/var_regs.h: Add CICR definitions.
--- a/packages/hal/powerpc/mpc8xx/current/src/variant.S
+++ b/packages/hal/powerpc/mpc8xx/current/src/variant.S
@@ -9,6 +9,7 @@
 ## -------------------------------------------
 ## This file is part of eCos, the Embedded Configurable Operating System.
 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+## Copyright (C) 2002 Gary Thomas
 ##
 ## eCos is free software; you can redistribute it and/or modify it under
 ## the terms of the GNU General Public License as published by the Free
@@ -41,7 +42,7 @@
 #######DESCRIPTIONBEGIN####
 ##
 ## Author(s): 	jskov
-## Contributors:jskov
+## Contributors:jskov, gthomas
 ## Date:	2000-02-04
 ## Purpose:	PowerPC MPC8xx variant code
 ## Description:	Variant specific code for PowerPC MPC8xx CPUs.
@@ -51,6 +52,9 @@
 ##=============================================================================
 
 #include <cyg/hal/arch.inc>
+#include <cyg/hal/ppc_regs.h>		/* on-chip resource layout, special */
+					/* registers, IMM layout...         */
+#include <cyg/hal/quicc/ppc8xx.h>       /* more of the same */
         
 #---------------------------------------------------------------------------
 # Interrupt vector tables.
@@ -81,5 +85,34 @@ hal_interrupt_objects:
         .long   0
         .endr
 
+        
+#---------------------------------------------------------------------------
+# Hard reset support
+#
+
+        .text                
+        .globl  _mpc8xx_reset
+_mpc8xx_reset:                                                  
+	lwi     r4,CYGARC_REG_IMM_BASE  # base address of control registers
+
+        // Enable checkstop reset
+        lwz     r3,PLPRCR(r4)
+        ori     r3,r3,0x0080  // Bit 24
+	stw	r3,PLPRCR(r4)
+        mfmsr   r3
+        lwi     r5,~MSR_ME
+        and     r3,r3,r5
+        mtmsr   r3
+
+        // Pull the plug by disabling CS0 & CS1.  This will cause a checkstop.
+        li      r0,0
+        stw     r0,BR0(r4)
+        stw     r0,BR1(r4)
+        lwi     r3,_end
+10:     nop
+        lwzu    r3,4(r2)        // Force a memory access
+        b       10b        
+                        
+
 ##-----------------------------------------------------------------------------
 ## end of variant.S
--- a/packages/hal/powerpc/ts1000/current/ChangeLog
+++ b/packages/hal/powerpc/ts1000/current/ChangeLog
@@ -1,3 +1,7 @@
+2002-12-02  Gary Thomas  <gthomas@ecoscentric.com>
+
+	* include/plf_intr.h: Use MPC8xx variant RESET support.
+
 2002-11-26  Gary Thomas  <gthomas@ecoscentric.com>
 
 	* cdl/hal_powerpc_ts1000.cdl: Move platform define to platform package.
--- a/packages/hal/powerpc/ts1000/current/include/plf_intr.h
+++ b/packages/hal/powerpc/ts1000/current/include/plf_intr.h
@@ -45,7 +45,7 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):    jskov
-// Contributors: jskov
+// Contributors: jskov, gthomas
 // Date:         2000-06-13
 // Purpose:      Define platform specific interrupt support
 //              
@@ -72,9 +72,8 @@
 //----------------------------------------------------------------------------
 // Reset.
 
-// The TS1000 does not have a watchdog (not one we can easily use for this
-// purpose anyway).
-#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT
+externC void _mpc8xx_reset(void);
+#define HAL_PLATFORM_RESET() _mpc8xx_reset()
 
 #define HAL_PLATFORM_RESET_ENTRY 0xfe000100
 
--- a/packages/hal/powerpc/viper/current/ChangeLog
+++ b/packages/hal/powerpc/viper/current/ChangeLog
@@ -1,3 +1,7 @@
+2002-12-02  Gary Thomas  <gthomas@ecoscentric.com>
+
+	* include/plf_intr.h: Use MPC8xx variant RESET support.
+
 2002-11-26  Gary Thomas  <gthomas@ecoscentric.com>
 
 	* cdl/hal_powerpc_viper.cdl: Move platform define to platform package.
--- a/packages/hal/powerpc/viper/current/include/plf_intr.h
+++ b/packages/hal/powerpc/viper/current/include/plf_intr.h
@@ -45,7 +45,7 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):    jskov
-// Contributors: jskov
+// Contributors: jskov, gthomas
 // Date:         2000-06-13
 // Purpose:      Define platform specific interrupt support
 //              
@@ -72,9 +72,8 @@
 //----------------------------------------------------------------------------
 // Reset.
 
-// The VIPER does not have a watchdog (not one we can easily use for this
-// purpose anyway).
-#define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT
+externC void _mpc8xx_reset(void);
+#define HAL_PLATFORM_RESET() _mpc8xx_reset()
 
 #define HAL_PLATFORM_RESET_ENTRY 0xfe000100